Skip to contents

This method pairs the observational times of two irregularly observed time series.

Usage

pairingits(x, ...)

Arguments

x

An object of class `utilities`.

...

Additional arguments for pairing time series:

lc1

A data frame with three columns corresponding to the first irregularly observed time series.

lc2

A data frame with three columns corresponding to the second irregularly observed time series.

tol

A numeric value indicating the tolerance parameter.

Value

An object of class `utilities` with two slots:

series

A matrix containing the paired time series, where unmatched measurements are filled with `NA`.

series_esd

A matrix containing the paired error standard deviations of the time series, where unmatched measurements are filled with `NA`.

times

A numeric vector with the paired observational times.

Details

The method checks the observational times in both input time series and pairs the measurements if they fall within the specified tolerance (`tol`). If a measurement in one series cannot be paired, it is filled with `NA` values for the corresponding columns of the other series.

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.

Examples

data(cvnovag)
data(cvnovar)
datag=cvnovag
datar=cvnovar
o1=iAR::utilities()
o1<-pairingits(o1, datag,datar,tol=0.1)
pargr1=na.omit(o1@paired)
st=apply(pargr1[,c(1,4)],1,mean)
model_BiAR <- BiAR(times = st,series=pargr1[,c(2,5)],series_esd=pargr1[,c(3,6)])
model_BiAR <- kalman(model_BiAR)