[R-SIG-Finance] racd package

Samit Paul samitpaulin at gmail.com
Tue Jan 27 07:45:24 CET 2015


Dear Alexios and Team,

Finally, I have successfully installed "racd" package after downloading
latest version of R and mapped to the new directory (instead of program
files) as per your advice. Thanks a lot for your guidance. I sincerely
appreciate it.

I ran the codes as per the package and found a problem in getting the
output in ".csv" format. The codes and the output are listed below.

*Codes:*

spec = acdspec(variance.model=list(variance.targeting = TRUE),

 mean.model=list(armaOrder=c(1,0)),distribution.model=list(model = "jsu",

 skewOrder=c(1,1,0), shapeOrder=c(1,1,0)))
roll = acdroll(spec, Hsidesret, n.ahead = 1, forecast.length = 2108,
                     n.start = NULL, refit.every = 1000, refit.window =
"moving",
                     window.size = NULL, solver = "msoptim", fit.control =
list(),
                     solver.control = list(), calculate.VaR = TRUE,
VaR.alpha = 0.05)
roll
as.data.frame(roll)
write.csv(as.data.frame(roll)),"as.data.frame(roll).csv")

*Output:*

*-------------------------------------*
*              ACD Roll               *
*-------------------------------------*
No.Refits : 3
Refit Horizon : 1000
No.Forecasts : 2108
GARCH Model : sGARCH(1,1)
Mean Model : ARFIMA(1,0,0)

ACD Skew Model : quad(1,1,0)
ACD Shape Model : quad(1,1,0)
Distribution : jsu

Forecast Density:
                         Mu  Sigma    Skew  Shape Shape(GIG) Realized
1991-10-15 05:30:00 -0.0456 0.8481  0.0626 1.4358          0  -0.7995
1991-10-16 05:30:00  0.0206 0.8544 -0.1891 1.4378          0   2.4770
1991-10-17 05:30:00 -0.1283 1.0273  0.3050 1.4333          0  -0.1631
1991-10-18 05:30:00 -0.0083 0.9953 -0.0544 1.4368          0   1.6249
1991-10-19 05:30:00 -0.0896 1.0432  0.1712 1.4348          0   1.1472
1991-10-20 05:30:00 -0.0679 1.0526  0.1148 1.4353          0  -1.4614

..........................
                         Mu  Sigma    Skew  Shape Shape(GIG) Realized
1997-07-17 05:30:00 -0.0165 0.9810 -0.0418 1.5033          0   0.3328
1997-07-18 05:30:00 -0.0258 0.9578  0.0091 1.4976          0   0.6218
1997-07-19 05:30:00 -0.0340 0.9466  0.0565 1.4923          0   0.8430
1997-07-20 05:30:00 -0.0402 0.9480  0.0931 1.4881          0  -0.7663
1997-07-21 05:30:00  0.0054 0.9414 -0.1620 1.5163          0  -0.4917
1997-07-22 05:30:00 -0.0024 0.9265 -0.1251 1.5123          0   1.5108

Elapsed: 47.21225 secs
> as.data.frame(roll)
Error in as.data.frame.default(roll) :
  cannot coerce class "structure("ACDroll", package = "racd")" to a
data.frame
> write.csv(as.data.frame(roll)),"as.data.frame(roll).csv")
Error: unexpected ',' in "write.csv(as.data.frame(roll)),"

As you may see, the codes are running fine. But I can't convert it into
data frame, hence cannot get an output in csv format. Could you please help
me on this.

Thanks and regards,

Samit Paul

On Sun, Jan 25, 2015 at 12:47 AM, Samit Paul <samitpaulin at gmail.com> wrote:

> Dear Alexios,
>
> Thanks a lot for your time and such a prompt response. Let me answer your
> queries one by one:
>
> 1) Yes, I had Rtools installed
>
> 2) I tried installing all six packages from the list. Out of them parma
> and spd are successfully installed. Rest of them were unsuccessful.
> However, I could install rugarch and rmgarch from CRAN. But racd and
> twinkle are not yet installed.
>
> 3) I would definitely try to install a latest version of R under a
> directory and run the code.
>
> 4) All additional dependencies  as per your list, were installed
>
> Sorry for not providing you sessionInfo() in the earlier mail. Please find
> the same. I will try to follow your suggestion as per point 3 and if you
> have anything else as an advice.
>
> > sessionInfo()
> R version 3.0.3 (2014-03-06)
> Platform: i386-w64-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252
> [3] LC_MONETARY=English_India.1252 LC_NUMERIC=C
> [5] LC_TIME=English_India.1252
>
> attached base packages:
> [1] parallel  stats     graphics  grDevices utils     datasets  methods
> base
>
> other attached packages:
>  [1] spd_2.0-0                  parma_1.5-2                nloptr_1.0.0
>
>  [4] Matrix_1.1-2               numDeriv_2012.9-1          ucminf_1.1-3
>
>  [7] Rsolnp_1.15                truncnorm_1.0-7            pracma_1.6.4
>
> [10] devtools_1.7.0             fArma_3010.79              rmgarch_1.2-8
>
> [13] rbenchmark_1.0.0           psych_1.4.5                corrgram_1.5
>
> [16] seriation_1.0-13           copula_0.999-8             sos_1.3-8
>
> [19] brew_1.0-6                 ismev_1.39                 mgcv_1.7-28
>
> [22] evir_1.7-3                 gPdtest_0.4                vars_1.5-2
>
> [25] lmtest_0.9-31              strucchange_1.5-0          arfima_1.2-5
>
> [28] ltsa_1.4.4                 moments_0.13               tseries_0.10-32
>
> [31] POT_1.1-3                  plm_1.3-1                  sandwich_2.2-10
>
> [34] Formula_1.1-1              nlme_3.1-113               bdsmatrix_1.3-1
>
> [37] ggplot2_0.9.3.1            fracdiff_1.4-2
> fExtremes_3010.81
> [40] fTrading_2160.77           fGarch_3010.82
> fUnitRoots_3010.78
> [43] fBasics_3010.86            MASS_7.3-29
>  timeSeries_3010.97
> [46] urca_1.2-7                 forecast_5.3
> timeDate_3010.98
> [49] rugarch_1.3-1              quantmod_0.4-0             TTR_0.22-0
>
> [52] Defaults_1.1-1             PerformanceAnalytics_1.1.0 xts_0.9-3
>
> [55] zoo_1.7-9
>
> loaded via a namespace (and not attached):
>  [1] ADGofTest_0.3               Bessel_0.5-5                bit_1.1-12
>
>  [4] bitops_1.0-6                cluster_1.14.4
>  colorspace_1.2-4
>  [7] corpcor_1.6.7               dichromat_2.0-0             digest_0.6.4
>
> [10] DistributionUtils_0.5-1     expm_0.99-1.1               ff_2.2-13
>
> [13] FRAPO_0.3-8                 gclus_1.3.1
> GeneralizedHyperbolic_0.8-1
> [16] grid_3.0.3                  gsl_1.9-10                  gtable_0.1.2
>
> [19] httr_0.6.1                  KernSmooth_2.23-10          ks_1.9.0
>
> [22] labeling_0.2                lattice_0.20-27             misc3d_0.8-4
>
> [25] munsell_0.4.2               mvtnorm_0.9-9997            nnet_7.3-7
>
> [28] pcaPP_1.9-49                plyr_1.8.1                  proto_0.3-10
>
> [31] pspline_1.0-16              quadprog_1.5-5
>  RColorBrewer_1.0-5
> [34] Rcpp_0.11.1                 RCurl_1.95-4.5
>  reshape2_1.2.2
> [37] rgl_0.93.996                Rglpk_0.6-0                 scales_0.2.3
>
> [40] SkewHyperbolic_0.3-2        slam_0.1-32
> stabledist_0.6-6
> [43] stats4_3.0.3                stringr_0.6.2               tools_3.0.3
>
> [46] TSP_1.0-9
>
>
> Regards,
>
> Samit
>
> On Sun, Jan 25, 2015 at 12:07 AM, alexios <alexios at 4dscape.com> wrote:
>
>> You've not provided a sessionInfo(), but I can see that that you are on
>> Windows and your R version is quite old now.
>>
>> 1. Do you have Rtools installed?
>> 2. Have you tried building any other program from source?
>> 3. On windows it is recommended that you have R installed under a
>> directory without spaces (NOT 'Program Files').
>> 4. There are additional dependencies which should probably also be
>> installed (e.g. rugarch, xts, Rsolnp, ucminf, numDeriv, zoo, parma, Matrix).
>>
>> I can't replicate this on R 3.1.2 so there is little else I can help you
>> with beyond the hints above.
>>
>> Alexios
>>
>>
>>
>> On 24/01/2015 17:54, Samit Paul wrote:
>>
>>> Hello Alexios and team,
>>>
>>> I tried to install racd package in R-studio from bitbucket. I installed
>>> and
>>> attached "devtools". But while I am trying to install "racd", I am
>>> getting
>>> the following error comment. I would highly appreciate if you kindly
>>> advise
>>> on the same.
>>>
>>>  require("devtools")
>>>>
>>>
>>>  install_bitbucket("racd","alexiosg")
>>>>
>>> Downloading bitbucket repo alexiosg/racd at master
>>> Installing racd
>>> "C:/PROGRA~1/R/R-30~1.3/bin/i386/R" --vanilla CMD INSTALL  \
>>>
>>> "C:/Users/Sumit/AppData/Local/Temp/RtmpQ3gpvM/
>>> devtools8ac319a4457/alexiosg-racd-45894f1c7ba3"
>>>   \
>>>    --library="C:/Users/Sumit/Documents/R/win-library/3.0"
>>> --install-tests
>>>
>>> * installing *source* package 'racd' ...
>>> ** libs
>>>
>>> *** arch - i386
>>> Warning: running command 'make -f
>>> "C:/PROGRA~1/R/R-30~1.3/etc/i386/Makeconf" -f
>>> "C:/PROGRA~1/R/R-30~1.3/share/make/winshlib.mk" SHLIB="racd.dll"
>>> OBJECTS="acd.o distributions.o filters.o gig.o nig.o racd.o"' had status
>>> 127
>>> ERROR: compilation failed for package 'racd'
>>> * removing 'C:/Users/Sumit/Documents/R/win-library/3.0/racd'
>>> Error: Command failed (1)
>>> In addition: Warning message:
>>> Username parameter is deprecated. Please use alexiosg/racd
>>>
>>>  build_vignettes=FALSE
>>>> vignette(package="racd")
>>>>
>>>
>>> Error in find.package(package, lib.loc) :
>>>    there is no package called ‘racd’
>>>
>>> Regards,
>>>
>>> Samit
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-SIG-Finance at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>>> -- Subscriber-posting only. If you want to post, subscribe first.
>>> -- Also note that this is not the r-help list where general R questions
>>> should go.
>>>
>>>
>>
>

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list