Learn R Programming

iAR (version 1.3.2)

pairingits: Pairing two irregularly observed time series

Description

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

Usage

pairingits(x, ...)

Value

An object of class `utilities` with the 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.

Arguments

x

An object of class `utilities`.

...

Additional arguments for pairing time series:

data1

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

data2

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

tol

A numeric value indicating the tolerance parameter.

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_2021iAR

Examples

Run this code
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)

Run the code above in your browser using DataLab