BIARfit {iAR} | R Documentation |
Fitted Values of BIAR model
Description
Fit a BIAR model to a bivariate irregularly observed time series.
Usage
BIARfit(phiValues, y1, y2, t, yerr1, yerr2, zeroMean = TRUE)
Arguments
phiValues |
An array with the parameters of the BIAR model. The elements of the array are, in order, the autocorrelation and the cross correlation parameter of the BIAR model. |
y1 |
Array with the observations of the first time series of the BIAR process. |
y2 |
Array with the observations of the second time series of the BIAR process. |
t |
Array with the irregular observational times. |
yerr1 |
Array with the measurements error standard deviations of the first time series of the BIAR process. |
yerr2 |
Array with the measurements error standard deviations of the second time series of the BIAR process. |
zeroMean |
logical; if TRUE, the array y has zero mean; if FALSE, y has a mean different from zero. |
Value
A list with the following components:
rho Estimated value of the contemporary correlation coefficient.
innov.var Estimated value of the innovation variance.
fitted Fitted values of the BIAR model.
fitted.state Fitted state values of the BIAR model.
Lambda Lambda value estimated by the BIAR model at the last time point.
Theta Theta array estimated by the BIAR model at the last time point.
Sighat Covariance matrix estimated by the BIAR model at the last time point.
Qt Covariance matrix of the state equation estimated by the BIAR model at the last time point.
References
Elorrieta F, Eyheramendy S, Palma W, Ojeda C (2021). “A novel bivariate autoregressive model for predicting and forecasting irregularly observed time series.” Monthly Notices of the Royal Astronomical Society, 505(1), 1105–1116. ISSN 0035-8711, doi: 10.1093/mnras/stab1216, https://academic.oup.com/mnras/article-pdf/505/1/1105/38391762/stab1216.pdf.
See Also
gentime
, BIARsample
, BIARphikalman
, BIARkalman
Examples
n=80
set.seed(6714)
st<-gentime(n)
x=BIARsample(n=n,phiR=0.9,phiI=0.3,st=st,rho=0.9)
y=x$y
y1=y/apply(y,1,sd)
yerr1=rep(0,n)
yerr2=rep(0,n)
biar=BIARkalman(y1=y1[1,],y2=y1[2,],t=st,delta1 = yerr1,delta2=yerr2)
biar
predbiar=BIARfit(phiValues=c(biar$phiR,biar$phiI),y1=y1[1,],y2=y1[2,],t=st,yerr1
= rep(0,length(y[1,])),yerr2=rep(0,length(y[1,])))
rho=predbiar$rho
print(rho)
yhat=predbiar$fitted