rank_one_tensor: Apply the rank-one-tensor onto a function

Description Usage Arguments Value References See Also Examples

View source: R/rank_one_tensor.R

Description

This function applies the operator given as a rank-one tensor defines rank one operator defined as: "(g1 'otimes' g2)(f) = <f,g2>g1"

Usage

1
rank_one_tensor(g1, g2, f)

Arguments

g1

The function g1 for the rank-one-tensor define as a function of variable x returning the the value "g1(x)".

g2

The function g2 for the rank-one-tensor define as a function of variable x returning the the value "g2(x)".

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 "(g1 'otimes' g2)(f)".

References

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

See Also

kernel_operator, filter_simulate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# define kernel
g1 <- function(x){ exp(x^2) }
g2 <- function(x){ sin(x) }

# 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,1))
lines( rank_one_tensor(g1,g2,f), col="red" )
legend("topleft",c("f","<f,g2>g1"), col=c("blue","red"), lty=1)

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