Learn R Programming

ambit (version 0.2.3)

trawl_deriv_mod: Estimating the derivative of the trawl function

Description

This function estimates the derivative of the trawl function using the modified version proposed in Sauri and Veraart (2022).

Usage

trawl_deriv_mod(data, Delta, lag = 100)

Value

The function returns the lag-dimensional vector \((\hat a'(0), \hat a'(\Delta), \ldots, \hat a'((lag-1) \Delta)).\)

Arguments

data

Numeric vector of data used to compute the derivative of the trawl function

Delta

Numeric value specifying the width Delta of the observation grid

lag

Integer specifying the lag until which the trawl function derivative should be estimated. Default is 100.

Details

According to Sauri and Veraart (2022), the derivative of the trawl function can be estimated based on observations \(X_0, X_{\Delta_n}, \ldots, X_{(n-1)\Delta_n}\) by $$\widehat a'(t)=\frac{1}{ n\Delta_{n}^2} \sum_{k=l+1}^{n-2}(X_{(k+1)\Delta_n}-X_{k\Delta_n}) (X_{(k-l)\Delta_n}-X_{(k-l-1)\Delta_n}),$$ for \(\Delta_nl\leq t < (l+1)\Delta_n\).

Examples

Run this code
##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)

Run the code above in your browser using DataLab