IARforecast {iAR} | R Documentation |
Forecast from IAR model
Description
Forecast from models fitted by IARloglik
Usage
IARforecast(phi, y, st, standardized = TRUE, zero.mean = TRUE, tAhead)
Arguments
phi |
Estimated phi parameter by the iAR model. |
y |
Array with the time series observations. |
st |
Array with the irregular observational times. |
standardized |
logical; if TRUE, the array y is standardized; if FALSE, y contains the raw time series |
zero.mean |
logical; if TRUE, the array y has zero mean; if FALSE, y has a mean different from zero. |
tAhead |
The time ahead for forecast is required. |
Value
Forecasted value from the iAR model
References
Eyheramendy S, Elorrieta F, Palma W (2018). “An irregular discrete time series model to identify residuals with autocorrelation in astronomical light curves.” Monthly Notices of the Royal Astronomical Society, 481(4), 4311–4322. ISSN 0035-8711, doi: 10.1093/mnras/sty2487, https://academic.oup.com/mnras/article-pdf/481/4/4311/25906473/sty2487.pdf.
See Also
gentime
, IARsample
, IARloglik
, IARkalman
, IARfit
Examples
set.seed(6714)
st<-gentime(n=100)
y<-IARsample(phi=0.99,st=st,n=100)
y<-y$series
n=length(y)
p=trunc(n*0.99)
ytr=y[1:p]
yte=y[(p+1):n]
str=st[1:p]
ste=st[(p+1):n]
tahead=ste-str[p]
phi=IARloglik(y=ytr,st=str)$phi
forIAR=IARforecast(phi=phi,y=ytr,st=str,tAhead=tahead)