Description Usage Arguments Value References See Also Examples
Simulate functional time series sample given its harmonic Karhunen-Loeve decomposition.
1 2 3 4 5 6 7 8 9 | CKL_simulate(
harmonic_eigenvalues,
harmonic_eigenfunctions,
t_max,
n_grid,
n_pc,
seed_number = NULL,
include_freq_zero = F
)
|
harmonic_eigenvalues |
function of two variables, |
harmonic_eigenfunctions |
function of three variables, |
t_max |
Time horizon to be simulated. Must be an even number, otherwise it is increased by one. |
n_grid |
Number of grid points (spatial resolution) of the discretisation of [0,1] where the FTS is to be simulated. |
n_pc |
The number of harmonic eigenfunctions to be used for the simulation at each frequency. |
seed_number |
The random seed inicialization for the simulation. The value "NULL" means no inicialization |
include_freq_zero |
If set |
functional time series sample, matrix of size (n_grid
,t_max
)
Rubin, Panaretos. Simulation of stationary functional time series with given spectral density. arXiv, 2020
CKL_covlagh_operator
, spec_density_simulate
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Define the eigenvalues and eigenfunction of the process to simulate
harmonic_eigenvalues <- function( omega, n ){ 1/( (1-0.9 *cos(omega)) * (n*pi)^2 ) }
harmonic_eigenfunctions <- function(omega, n, x){ sqrt(2)*sin( n*(pi*x-omega) ) }
# simulation setting
t_max <- 1000
n_grid <- 101
n_pc <- 100
# simulate trajectory
fts_x <- CKL_simulate(harmonic_eigenvalues, harmonic_eigenfunctions, t_max, n_grid, n_pc)
# display the first curve
plot( fts_x[,1], type='l' )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.