data(macrodata)
y=macrodata[,1,drop=FALSE]
timeframe=rollingWindows(y,estimation="300m",by="6m")
#estimation="300m", because macrodata is monthly
FROM=timeframe$from
TO=timeframe$to
data(ES_Daily)
y=ES_Daily[,1,drop=FALSE]
timeframe=rollingWindows(y,estimation ="60w",by="1w")
#60 weeks(300+ days) as estimation window and move by 1 week(5+ days).
FROM=timeframe$from
TO=timeframe$to
y=ES_Daily[,1,drop=FALSE]
timeframe=rollingWindows(y,estimation ="250d",by="10d")
#250-day as estimation window and move by 10 days.
# simulated quarterly data
tmp0=ts(rnorm(800),start=c(1900,1),freq=4)
tmp1=timeSeries::as.timeSeries(tmp0)
tmp2=zoo::as.zoo(tmp0)
tmp3=xts::as.xts(tmp0)
timeframe=rollingWindows(x=tmp3,estimation ="100q",by="12q")
FROM=timeframe$from
TO=timeframe$to
Run the code above in your browser using DataLab