CKL_covlagh_operator: Calculate the lag-h autocovariance operator for functional...

Description Usage Arguments Value References See Also Examples

View source: R/CKL_covlagh_operator.R

Description

Numerically calculate the lag-h covariance operators for functional time series dynamics defined by its harmonic Karhunen-Loeve expansion. The calculation is done by numerically integrating the inverse formula, i.e. the spectral density multiplied by exp(-1i*lag*omega)

Usage

1
2
3
4
5
6
7
8
CKL_covlagh_operator(
  harmonic_eigenvalues,
  harmonic_eigenfunctions,
  lag,
  n_grid,
  n_pc,
  n_grid_freq = 1000
)

Arguments

harmonic_eigenvalues

function of two variables, omega and n, that assigns the n-th harmonic eigenvalue at frequency omega. Must be well defined for frequencies (0,pi]. The interval [pi,2pi) is not used and is calculated by mirroring of (0,pi]..

harmonic_eigenfunctions

function of three variables, omega, n and x, that assigns the n-th harmonic eigenfunction at point x in [0,1] at frequency omega. Must be well defined for frequencies (0,pi]. The interval [pi,2pi) is not used and is calculated by mirroring of (0,pi].

lag

The lag of the autocovariance to evaluate.

n_grid

Number of grid points (spatial resolution) of the discretisation of [0,1]^2 for the operator kernel to evaluate.

n_pc

The number of harmonic eigenfunctions to be used for the numerical integration at each frequency.

n_grid_freq

The grid points for the spectral density to evaluate at. Partition of [0,pi].

Value

lag-h autocovariance operator, matrix of size (n_grid,n_grid)

References

Rubin, Panaretos. Simulation of stationary functional time series with given spectral density. arXiv, 2020

See Also

CKL_simulate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Define the eigenvalues and eigenfunction of the functional time series
harmonic_eigenvalues <- function( omega, n ){ 1/( (1-0.9 *cos(omega)) * (n*pi)^2 ) }
harmonic_eigenfunctions <- function(omega, n, x){ sqrt(2)*sin( n*(pi*x-omega)  ) }

# evaluation setting
lag <- 1 # change here to evaluate different lag-h autocovariance operator. put "lag <- 0" for lag-0 covariance operator
n_grid <- 101
n_pc <- 100

# calculate the lag-h autocovariance operator
covlagh <- CKL_covlagh_operator(harmonic_eigenvalues, harmonic_eigenfunctions, lag, n_grid, n_pc)

# visualise as a surface plot
persp(covlagh)

tomasrubin/specsimfts documentation built on March 26, 2021, 1:37 p.m.