search for: dailyreturn

Displaying 3 results from an estimated 3 matches for "dailyreturn".

2010 Jun 04
5
R Newbie, please help!
Hello Everyone, I just started a new job & it requires heavy use of R to analyze datasets. I have a data.table that looks like this. It is sorted by ID & Date, there are about 150 different IDs & the dataset spans 3 million rows. The main columns of concern are ID, date, and totret. What I need to do is to derive daily returns for each ID from totret, which is simply totret at time
2011 Dec 07
1
scatterplotting stock returns using quantmod and pairs()
...quot;,"ILF","EWJ","EPP","SAF","ASA") AdjClosePrices <- do.call(merge, lapply(tickers, function(x) Ad(get(x)))) #get adjusted close prices First try at getting returns and plotting: AdjCloseReturns <- do.call(merge, lapply(tickers, function(x) dailyReturn(Ad(get(x))) )) But the resulting pairs plot pairs(data.matrix(AdjCloseReturns),cex=0.01) has uninformative text "daily.returns" down the diag on the plot. Second try at getting returns and plotting: using lapply instead AdjCloseReturns <- lapply(AdjClosePrices,dailyReturn) head(AdjClo...
2009 Jun 15
2
GARCH:: False Convergence
...R users, I am trying to use tseries' garch function in order to determine the volatility of a return series generated by quantmod. Here is the code that I am using: > library(quantmod) > getSymbols("AAPL") convert daily closing prices into continuous log returns > dret<-dailyReturn(AAPL,type='log') check to see that the autocorrelations decay > acf(dret) autocorrelations seem to oscillate to zero load package tseries need for garch > library(tseries) run garch on the daily returns > garch(dret) When Garch runs there is false convergence, which leads me to di...