Displaying 1 result from an estimated 1 matches for "daily_ret".
2013 May 01
0
log returns, error
...says log is not meaningful for
>factors. How can I make him not to count them?
>http://www.file-upload.net/download-7537530/daily.csv.html
>
>############################
>data <- read.csv("daily.csv", sep=",")
>data
>#Step 1: Daily Log Returns
>daily_ret <- NULL
>for (i in c(2:ncol(data))){
> subsample <- data[ ,i]
> daily_ret_subsample <- diff(log(subsample))
> daily_ret <- cbind(daily_ret, daily_ret_subsample)
>}
>daily_ret <- cbind(tail(x=data[ ,1], n=nrow(daily_ret)), daily_ret)
>colnames(daily_ret) &l...