Displaying 1 result from an estimated 1 matches for "logpric".
Did you mean:
logpriv
2007 Mar 18
2
Lag operator in R does not work
Hi - I'm quite wondering what makes the lag operator does not work for my time series. I have a time series of length about 200000 elements. I would like to have a lag 1 of this time series. I did the following:
logprice = log(price, base=exp(1))
# this is my log price which is a vector of price time series of length 200000
ts_logprice = as.ts(logprice, frequency=1) # convert to time series
lag_logprice = lag(ts_logprice, 1) # get the lag
When I do:
ts_logprice[1:10] == lag_logprice[1:10]
The result returns TR...