Skip to content
Prev 13096 / 15274 Next

racd package

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
Error in as.data.frame.default(roll) :
  cannot coerce class "structure("ACDroll", package = "racd")" to a
data.frame
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: