Description Usage Arguments Value References See Also Examples
View source: R/kernel_operator.R
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.
1 | kernel_operator(ker, f)
|
ker |
The kernel function of the integral operator defined as a function of two variables, |
f |
The discretized function |
Vector of the same size as f representing the discretized function - the result of the application "ker(f)".
Rubin, Panaretos. Simulation of stationary functional time series with given spectral density. arXiv, 2020
rank_one_tensor, filter_simulate
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 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.