kernel_from_eig: Produces a kernel function from given eigendecomposition

Description Usage Arguments Value References See Also Examples

View source: R/kernel_from_eig.R

Description

Takes as its arguments the eigendecomposition of a self-adjoint operator and returns the function of two variables as the kernel of this operator.

Usage

1
kernel_from_eig(eigenvalues, eigenfunctions, n_pc_if_functions = 100)

Arguments

eigenvalues

The eigendecomposition can be defined either as (i) a list of finite number of eigenvalues/eigenfunctions, or (ii) a function returning the eigenvalue/eigenfunction of given order. In the case (i), the eigenvalues parameter is simply a vector of eigenvalues. In the case (ii), the eigenvalues parameter is a function of the variable n which returns the n-th eigenvalue.

eigenfunctions

See eigenvalues before. In the case (i), the eigenfunctions parameter is a list of functions with the same length as the parameter eigenvalues. Each function is a function of the variable x that returns the value of the eigenfunction at point x. The order of the functions in the list determine the order of eigenfunctions. In the case (ii), the eigenfunctions parameter is a function of two variables, n and x, that returns the value of the n-th eigenfunction at the point x.

n_pc_if_functions

In the case (ii) where the eigenvalues and the eigenfunctions are defined as functions representing the infinite rank eigendecomposition, take only n_pc_if_functions eigenfunctions. In the case (i), this parameter has no effect.

Value

the function of two variables, x and y, returning the value of the kernel at point (x,y)

References

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

See Also

FARFIMA_simulate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# define as infinite rank operator, definition as functions
eigenvalues <- function(n) { 1/((n-0.5)*pi)^2 }
eigenfunctions <- function(n,x) { sqrt(2)*sin((n-0.5)*pi*x) }

# # Alternative: define as finite rank operator, definition as lists
# eigenvalues <- c(1, 0.6, 0.3, 0.1, 0.1, 0.1, 0.05, 0.05, 0.05, 0.05)
# eigenfunctions <- list(
#   function(x){ sin(2*pi*x) },
#   function(x){ cos(2*pi*x) },
#   function(x){ sin(4*pi*x) },
#   function(x){ cos(4*pi*x) },
#   function(x){ sin(6*pi*x) },
#   function(x){ cos(6*pi*x) },
#   function(x){ sin(8*pi*x) },
#   function(x){ cos(8*pi*x) },
#   function(x){ sin(10*pi*x) },
#   function(x){ cos(10*pi*x) }
#  )


# create the kernel
ker <- kernel_from_eig(eigenvalues,eigenfunctions)

# evaluate the kernel at point (x,y) = (0.1, 0.6)
ker(0.1, 0.6)

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