y1 = 2+ 0.15*(1:20) + rnorm(20,2)
y2 = y1[20]+ 0.3*(1:30) + rnorm(30,2)
y = as.ts(c(y1,y2))
## Rolling Origin Evaluation
rolOrig( y=y, forecFunction = ses, n1=40)
rolOrig( y=y, forecFunction = thetaM, n1=40)
rolOrig( y=y, forecFunction = otm, n1=40, theta=1)
rolOrig( y=y, forecFunction = otm, n1=40, theta=2)
rolOrig( y=y, forecFunction = otm, n1=40, theta=3)
## Fixed Origin Evaluation
fixOrig( y=y, forecFunction = ses, n1=40)
fixOrig( y=y, forecFunction = thetaM, n1=40)
fixOrig( y=y, forecFunction = otm, n1=40, theta=1)
fixOrig( y=y, forecFunction = otm, n1=40, theta=2)
fixOrig( y=y, forecFunction = otm, n1=40, theta=3)
## Generalised Rolling Origin Evaluation with two origin updates.
## Where the first is the 40th element and second is the 45th element
groe( y=y, forecFunction = ses, m=5, n1=40)
groe( y=y, forecFunction = thetaM, m=5, n1=40)
groe( y=y, forecFunction = otm, m=5, n1=40, theta=1)
groe( y=y, forecFunction = otm, m=5, n1=40, theta=2)
groe( y=y, forecFunction = otm, m=5, n1=40, theta=3)
Run the code above in your browser using DataLab