kernel_operator: Apply the integral operator defined by its kernel

Description Usage Arguments Value References See Also Examples

View source: R/kernel_operator.R

Description

This function applies the integral operator with the kernel ker onto the function f. Can be useful for defining custom filter to be used for the filtered white noise simulation approach, see filter_simulate.

Usage

1

Arguments

ker

The kernel function of the integral operator defined as a function of two variables, x and y, returning the value of the integral kernel at the point (x,y). It is evaluated at the grid of [0,1]^2 where the resolution is matched to the length of the vector f.

f

The discretized function f represented as a vector. Assumes equidistant partition of [0,1].

Value

Vector of the same size as f representing the discretized function - the result of the application "ker(f)".

References

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

See Also

rank_one_tensor, filter_simulate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# define kernel
ker <- function(x,y){ exp(x^2+y^2) }

# discretize sinus function
grid <- seq(0,1, length.out = 101)
f <- sin(grid)

# apply onto function
plot(f, type="l", col="blue", ylim=c(-0.5,2.5))
lines( kernel_operator(ker,f), col="red" )
legend("topleft",c("f","ker(f)"), col=c("blue","red"), lty=1)

# Note that the above kernel function is in fact a rank one tensor, thus the application could be implemented as (which is faster to evaluate): rank_one_tensor( function(x) exp(x^2), function(x) exp(x^2), f )

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