View source: R/AmbitSimulation.R
sim_weighted_trawl | R Documentation |
This function simulates a weighted trawl process for various choices of the trawl function and the marginal distribution.
sim_weighted_trawl( n, Delta, trawlfct, trawlfct_par, distr, distr_par, kernelfct = NULL )
n |
number of grid points to be simulated (excluding the starting value) |
Delta |
grid-width |
trawlfct |
the trawl function a used in the simulation (Exp, supIG or LM) |
trawlfct_par |
parameter vector of trawl function (Exp: lambda, supIG: delta, gamma, LM: alpha, H) |
distr |
marginal distribution. Choose from "Gamma" (Gamma), "Gauss" (Gaussian), "Cauchy" (Cauchy), "NIG" (Normal Inverse Gaussian), Poi" (Poisson), "NegBin" (Negative Binomial) |
distr_par |
parameters of the marginal distribution: (Gamma: shape, scale; Gauss: mu, sigma (i.e. the second parameter is the standard deviation, not the variance); Cauchy: l, s; NIG: alpha, beta, delta, mu; Poi: v, NegBin: m, theta) |
kernelfct |
the kernel function p used in the ambit process |
This functions simulates a sample path from a weighted trawl process given by
Y_t =\int_{(-∞,t]\times (-∞, ∞)} p(t-s)I_{(0,a(t-s))}(x)L(dx,ds),
for t ≥ 0, and returns Y_0, Y_{Δ}, …, Y_{nΔ}.
path Simulated path
slice_sizes slice sizes used
S_matrix Matrix of all slices
kernelweights kernel weights used
#Simulation of a Gaussian trawl process with exponential trawl function n<-2000 Delta<-0.1 trawlfct="Exp" trawlfct_par <-0.5 distr<-"Gauss" distr_par<-c(0,1) #mean 0, std 1 set.seed(233) path <- sim_weighted_trawl(n, Delta, trawlfct, trawlfct_par, distr, distr_par)$path #Plot the path library(ggplot2) df <- data.frame(time = seq(0,n,1), value=path) p <- ggplot(df, aes(x=time, y=path))+ geom_line()+ xlab("l")+ ylab("Trawl process") p
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.