IARginterpolation {iAR} | R Documentation |
Interpolation from IAR-Gamma model
Description
Interpolation of missing values from models fitted by IARgamma
Usage
IARginterpolation(x, y, st, yini = 1)
Arguments
x |
A given array with the parameters of the IAR-Gamma model. The first element of the array corresponding to the phi parameter, the second to the level parameter mu, and the last one to the scale parameter sigma. |
y |
Array with the time series observations. |
st |
Array with the irregular observational times. |
yini |
a single value, initial value for the estimation of the missing value of the time series. |
Value
A list with the following components:
fitted Estimation of a missing value of the IAR-Gamma 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)
n<-100
st<-gentime(n)
y<-IARgsample(phi=0.9,st=st,n=n,sigma2=1,mu=1)
model<-IARgamma(y$y, st=st)
y<-y$y
napos=10
y0=y
y[napos]=NA
xest=c(model$phi,model$mu,model$sigma)
yest=IARginterpolation(x=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)