View source: R/NonparTrawlEstimation.R
| trawl_deriv_mod | R Documentation |
This function estimates the derivative of the trawl function using the modified version proposed in Sauri and Veraart (2022).
trawl_deriv_mod(data, Delta, lag = 100)
data |
The data set used to compute the derivative of the trawl function |
Delta |
The width Delta of the observation grid |
lag |
The lag until which the trawl function should be estimated |
According to Sauri and Veraart (2022), the derivative of the trawl function can be estimated based on observations X_0, X_{Δ_n}, …, X_{(n-1)Δ_n} by
\widehat a(t)=\frac{1}{√{ nΔ_{n}^2}} ∑_{k=l+1}^{n-2}(X_{(k+1)Δ_n}-X_{kΔ_n}) (X_{(k-l+1)Δ_n}-X_{(k-l)Δ_n}),
for Δ_nl≤q t < (l+1)Δ_n.
The function returns the lag-dimensional vector (\hat a'(0), \hat a'(Δ), …, \hat a'((lag-1) Δ)).
##Simulate a trawl process
##Determine the sampling grid
my_n <- 1000
my_delta <- 0.1
my_t <- my_n*my_delta
###Choose the model parameter
#Exponential trawl function:
my_lambda <- 2
#Poisson marginal distribution trawl
my_v <- 1
#Set the seed
set.seed(123)
#Simulate the trawl process
Poi_data <- sim_weighted_trawl(my_n, my_delta,
"Exp", my_lambda, "Poi", my_v)$path
#Estimate the trawl function
my_lag <- 100+1
trawl <- nonpar_trawlest(Poi_data, my_delta, lag=my_lag)$a_hat
#Estimate the derivative of the trawl function
trawl_deriv <- trawl_deriv_mod(Poi_data, my_delta, lag=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.