I am fairly new to R and specially finance R, and I keep being stuck with an R mistake. I'm trying to compute Jensen's alpha for a fund (named A, imported XLS), using the Oslo Ex. Benchmark Index (OSEBX), the NIBOR interest level and the PerformanceAnalytics package (CAPM.jensenAlpha).
I already had problems with the data types, so I converted everything to timeSeries format and gave it the same row names, but when executing I get a bunch of NAs (additional question, can I use a time series for the Rf, or does it have to be constant?).
data_ose <- BatchGetSymbols(tickers = "OSEBX.OL",
first.date = "1993-03-01",
last.date = "2003-03-04",
freq.data = "monthly",
do.cache = FALSE,
thresh.bad.data = 0)
OSEBX_rtn <- data_ose$df.tickers$ret.adjusted.prices
OSEBXrtn_ts <- timeSeries(OSEBX_rtn)
nibor_ts <- timeSeries(nibor)
A <- timeSeries(Funds_data$A)
row.names(A) <- Funds_data$Date
row.names(OSEBXrtn_ts) <- Funds_data$Date
row.names(nibor_ts) <- Funds_data$Date
Outcome for a time series Rf
I'd really appreciate if someone could give me a hand.