IARinterpolation {iAR} | R Documentation |
Interpolation from IAR model
Description
Interpolation of missing values from models fitted by IARkalman
Usage
IARinterpolation(
x,
y,
st,
delta = 0,
yini = 0,
zero.mean = TRUE,
standardized = TRUE
)
Arguments
x |
A given phi coefficient of the IAR model. |
y |
Array with the time series observations. |
st |
Array with the irregular observational times. |
delta |
Array with the measurements error standard deviations. |
yini |
a single value, initial value for the estimation of the missing value of the time series. |
zero.mean |
logical; if TRUE, the array y has zero mean; if FALSE, y has a mean different from zero. |
standardized |
logical; if TRUE, the array y is standardized; if FALSE, y contains the raw time series. |
Value
A list with the following components:
fitted Estimation of a missing value of the IAR process.
ll Value of the negative log likelihood evaluated in the fitted missing values.
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
Examples
set.seed(6714)
st<-gentime(n=100)
y<-IARsample(phi=0.99,st=st,n=100)
y<-y$series
phi=IARkalman(y=y,st=st)$phi
print(phi)
napos=10
y0=y
y[napos]=NA
xest=phi
yest=IARinterpolation(xest,y=y,st=st)
yest$fitted
mse=(y0[napos]-yest$fitted)^2
print(mse)
plot(st,y,type='l',xlim=c(st[napos-5],st[napos+5]))
points(st,y,pch=20)
points(st[napos],yest$fitted,col="red",pch=20)