I am estimating Value at Risk using PerfomanceAnalytics package. The variables 
are stored in a data frame. I formated the data variables using zoo() and 
as.xtx() but it is not working. The working example is below.
########################################################## 
reguire(zoo)
require(PerformanceAnalytics)
reguire(xts)
 
year<- c(1991-12-30, 1992-12-30, 1993-12-30, 1994-12-30)
R1 <- c(12, 9, 8, 13)
R2 <- c(5,2,9, 13)
d  <- data.frame(cbind(year, R1,R2))
 
d<- zoo(d,year) 
VaR(d)
#Error in checkData(R, method = "xts", ...)
 
#When I use
d <- as.xts(d,order.by =year, frequency = 1)
 
#Error in xts(coredata(x), order.by = order.by, frequency = frequency,  : 
 # order.by requires an appropriate time-based object


Peter Maclean
Department of Economics
UDSM

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to