Description Usage Arguments Value References See Also Examples
View source: R/kernel_from_eig.R
Takes as its arguments the eigendecomposition of a self-adjoint operator and returns the function of two variables as the kernel of this operator.
1 | kernel_from_eig(eigenvalues, eigenfunctions, n_pc_if_functions = 100)
|
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 |
eigenfunctions |
See |
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 |
the function of two variables, x
and y
, returning the value of the kernel at point (x
,y
)
Rubin, Panaretos. Simulation of stationary functional time series with given spectral density. arXiv, 2020
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.