[R-SIG-Finance] rugarch intraday plot ugarchroll
Frank
fr@nkm60606 @ending from gm@il@com
Tue Dec 4 13:44:26 CET 2018
I have
pdf("V0_SPY_Scatter_Plot.pdf")
before I do my labels and plotting.
Best,
Frank
Chicago
From: R-SIG-Finance <r-sig-finance-bounces using r-project.org> On Behalf Of ???????? ??????
Sent: Tuesday, December 04, 2018 3:34 AM
To: r-sig-finance <r-sig-finance using r-project.org>
Subject: [R-SIG-Finance] rugarch intraday plot ugarchroll
Hey Alexios and fellow R users,
I tried plotting the ugarchroll result when using intraday data and it didnt plot anything. However, if we substitute as.Date with as.POSIXct, everything works like charm:
in rugarch-plots.r file:
# rolling sigma forecast comparison plot
plot_sigma = function(x, VaR.alpha = 0.01, density.support = c(-0.15, 0.15), ...) {
density = x using forecast$density
plot(as.POSIXct(rownames(density)), abs(density[, 6]), type = "l", col = "grey",
main = paste("Sigma Forecast vs |Series|", sep = ""),
ylab = "", xlab = "", cex.main = 0.7, cex.axis = 0.8, cex.lab = 0.9)
lines(as.POSIXct(rownames(density)), abs(density[, 2]), col = "steelblue", lwd = 1.5)
grid()
invisible(x)
}
# rolling series forecast comparison plot
plot_mu = function(x, VaR.alpha = 0.01, density.support = c(-0.15, 0.15), ...) {
density = x using forecast$density
plot(as.POSIXct(rownames(density)), density[, 6], type = "l", col = "grey",
main = paste("Series Forecast vs Realized", sep = ""),
ylab = "", xlab = "", cex.main = 0.7, cex.axis = 0.8, cex.lab = 0.9)
lines(as.POSIXct(rownames(density)), (density[, 1]), col = "tomato1", lwd = 1.5)
grid()
invisible(x)
}
best
Vladimir
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list