Hot answers tagged

1

You need to assign each of the target variables to their own column and then train a model for each of your forecast horizons library(quantmod) symbol= getSymbols("AAPL",from="2010-03-01", auto.assign=F) close<-Cl(symbol) open<-Op(symbol) lc1<-lag(close) lc2<-lag(close,2) lc3<-lag(close,3) lo1<-lag(open) lo2<-lag(open,2) ...



Only top voted, non community-wiki answers of a minimum length are eligible