CIARinterpolation: Interpolation from CIAR model

View source: R/CIARinterpolation.R

CIARinterpolationR Documentation

Interpolation from CIAR model

Description

Interpolation of missing values from models fitted by CIARkalman

Usage

CIARinterpolation(
  x,
  y,
  t,
  delta = 0,
  yini = 0,
  zero.mean = TRUE,
  standardized = TRUE,
  c = 1,
  seed = 1234
)

Arguments

x

An array with the parameters of the CIAR model. The elements of the array are, in order, the real (phiR) and the imaginary (phiI) part of the coefficient of CIAR model.

y

Array with the time series observations.

t

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.

c

Nuisance parameter corresponding to the variance of the imaginary part.

seed

a single value, interpreted as the seed of the random process.

Value

A list with the following components:

  • fitted Estimation of a missing value of the CIAR process.

  • ll Value of the negative log likelihood evaluated in the fitted missing values.

References

\insertRef

Elorrieta_2019iAR

See Also

gentime, CIARsample, CIARkalman

Examples

n=100
set.seed(6714)
st<-gentime(n)
x=CIARsample(n=n,phiR=0.9,phiI=0,st=st,c=1)
y=x$y
y1=y/sd(y)
ciar=CIARkalman(y=y1,t=st)
ciar
napos=10
y0=y1
y1[napos]=NA
xest=c(ciar$phiR,ciar$phiI)
yest=CIARinterpolation(xest,y=y1,t=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*sd(y),col="red",pch=20)

iAR documentation built on Nov. 25, 2022, 1:06 a.m.

Related to CIARinterpolation in iAR...