Learn R Programming

ambit (version 0.2.3)

trawl_deriv: Estimating the derivative of the trawl function using the empirical derivative

Description

This function estimates the derivative of the trawl function using the empirical derivative of the trawl function.

Usage

trawl_deriv(data, Delta, lag = 100)

Value

Numeric vector of length lag containing the estimated derivative values \((\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

This function first estimates the trawl function \(\hat{a}(t)\) using nonpar_trawlest, then computes the derivative using finite differences: $$\widehat{a'}(l\Delta_n) = \frac{\hat{a}((l+1)\Delta_n) - \hat{a}(l\Delta_n)}{\Delta_n},$$ for \(l = 0, 1, \ldots, lag-1\).

See Also

nonpar_trawlest for the underlying trawl function estimation

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(Poi_data, my_delta, lag=100)

Run the code above in your browser using DataLab