Package 'trawl'

Title: Estimation and Simulation of Trawl Processes
Description: Contains R functions for simulating and estimating integer-valued trawl processes as described in the article Veraart (2019),"Modeling, simulation and inference for multivariate time series of counts using trawl processes", Journal of Multivariate Analysis, 169, pages 110-129, <doi:10.1016/j.jmva.2018.08.012> and for simulating random vectors from the bivariate negative binomial and the bi- and trivariate logarithmic series distributions.
Authors: Almut E. D. Veraart
Maintainer: Almut E. D. Veraart <[email protected]>
License: GPL-3
Version: 0.2.2
Built: 2025-02-14 04:27:42 UTC
Source: https://github.com/cran/trawl

Help Index


Autocorrelation function of the double exponential trawl function

Description

This function computes the autocorrelation function associated with the double exponential trawl function.

Usage

acf_DExp(x, w, lambda1, lambda2)

Arguments

x

The argument (lag) at which the autocorrelation function associated with the double exponential trawl function will be evaluated

w

parameter in the double exponential trawl

lambda1

parameter in the double exponential trawl

lambda2

parameter in the double exponential trawl

Details

The trawl function is parametrised by parameters 0w10\le w\le 1 and λ1,λ2>0\lambda_1, \lambda_2 > 0 as follows:

g(x)=weλ1x+(1w)eλ2x, for x0.g(x) = w e^{\lambda_1 x}+(1-w) e^{\lambda_2 x}, \mbox{ for } x \le 0.

Its autocorrelation function is given by:

r(x)=(weλ1x/λ1+(1w)eλ2x/λ2)/c, for x0,r(x) = (w e^{-\lambda_1 x}/\lambda_1+(1-w) e^{-\lambda_2 x}/\lambda_2)/c, \mbox{ for } x \ge 0,

where

c=w/λ1+(1w)/λ2.c = w/\lambda_1+(1-w)/\lambda_2.

Value

The autocorrelation function of the double exponential trawl function evaluated at x

Examples

acf_DExp(1,0.3,0.1,2)

Autocorrelation function of the exponential trawl function

Description

This function computes the autocorrelation function associated with the exponential trawl function.

Usage

acf_Exp(x, lambda)

Arguments

x

The argument (lag) at which the autocorrelation function associated with the exponential trawl function will be evaluated

lambda

parameter in the exponential trawl

Details

The trawl function is parametrised by the parameter λ>0\lambda > 0 as follows:

g(x)=eλx, for x0.g(x) = e^{\lambda x}, \mbox{ for } x \le 0.

Its autocorrelation function is given by:

r(x)=eλx, for x0.r(x) = e^{-\lambda x}, \mbox{ for } x \ge 0.

Value

The autocorrelation function of the exponential trawl function evaluated at x

Examples

acf_Exp(1,0.1)

Autocorrelation function of the long memory trawl function

Description

This function computes the autocorrelation function associated with the long memory trawl function.

Usage

acf_LM(x, alpha, H)

Arguments

x

The argument (lag) at which the autocorrelation function associated with the long memory trawl function will be evaluated

alpha

parameter in the long memory trawl

H

parameter in the long memory trawl

Details

The trawl function is parametrised by the two parameters H>1H> 1 and α>0\alpha > 0 as follows:

g(x)=(1x/α)H, for x0.g(x) = (1-x/\alpha)^{-H}, \mbox{ for } x \le 0.

Its autocorrelation function is given by

r(x)=(1+x/α)(1H), for x0.r(x)=(1+x/\alpha)^{(1-H)}, \mbox{ for } x \ge 0.

Value

The autocorrelation function of the long memory trawl function evaluated at x

Examples

acf_LM(1,0.3,1.5)

Autocorrelation function of the supIG trawl function

Description

This function computes the autocorrelation function associated with the supIG trawl function.

Usage

acf_supIG(x, delta, gamma)

Arguments

x

The argument (lag) at which the autocorrelation function associated with the supIG trawl function will be evaluated

delta

parameter in the supIG trawl

gamma

parameter in the supIG trawl

Details

The trawl function is parametrised by the two parameters δ0\delta \geq 0 and γ0\gamma \geq 0 as follows:

g(x)=(12xγ2)1/2exp(δγ(1(12xγ2)1/2)), for x0.g(x) = (1-2x\gamma^{-2})^{-1/2}\exp(\delta \gamma(1-(1-2x\gamma^{-2})^{1/2})), \mbox{ for } x \le 0.

It is assumed that δ\delta and γ\gamma are not simultaneously equal to zero. Its autocorrelation function is given by:

r(x)=exp(δγ(11+2x/γ2)), for x0.r(x) = \exp(\delta\gamma (1-\sqrt{1+2 x/\gamma^2})), \mbox{ for } x \ge 0.

Value

The autocorrelation function of the supIG trawl function evaluated at x

Examples

acf_supIG(1,0.3,0.1)

Simulates from the bivariate logarithmic series distribution

Description

Simulates from the bivariate logarithmic series distribution

Usage

Bivariate_LSDsim(N, p1, p2)

Arguments

N

number of data points to be simulated

p1

parameter p1p_1 of the bivariate logarithmic series distribution

p2

parameter p2p_2 of the bivariate logarithmic series distribution

Details

The probability mass function of a random vector X=(X1,X2)X=(X_1,X_2)' following the bivariate logarithmic series distribution with parameters 0<p1,p2<10<p_1, p_2<1 with p:=p1+p2<1p:=p_1+p_2<1 is given by

P(X1=x1,X2=x2)=Γ(x1+x2)x1!x2!p1x1p2x2(log(1p)),P(X_1=x_1,X_2=x_2)=\frac{\Gamma(x_1+x_2)}{x_1!x_2!} \frac{p_1^{x_1}p_2^{x_2}}{(-\log(1-p))},

for x1,x2=0,1,2,x_1,x_2=0,1,2,\dots such that x1+x2>0x_1+x_2>0. The simulation proceeds in two steps: First, X1X_1 is simulated from the modified logarithmic distribution with parameters p~1=p1/(1p2)\tilde p_1=p_1/(1-p_2) and δ1=log(1p2)/log(1p)\delta_1=\log(1-p_2)/\log(1-p). Then we simulate X2X_2 conditional on X1X_1. We note that X2X1=x1X_2|X_1=x_1 follows the logarithmic series distribution with parameter p2p_2 when x1=0x_1=0, and the negative binomial distribution with parameters (x1,p2)(x_1,p_2) when x1>0x_1>0.

Value

An N×2N \times 2 matrix with NN simulated values from the bivariate logarithmic series distribution


Simulates from the bivariate negative binomial distribution

Description

Simulates from the bivariate negative binomial distribution

Usage

Bivariate_NBsim(N, kappa, p1, p2)

Arguments

N

number of data points to be simulated

kappa

parameter κ\kappa of the bivariate negative binomial distribution

p1

parameter p1p_1 of the bivariate negative binomial distribution

p2

parameter p2p_2 of the bivariate negative binomial distribution

Details

A random vector X=(X1,X2){\bf X}=(X_1,X_2)' is said to follow the bivariate negative binomial distribution with parameters κ,p1,p2\kappa, p_1, p_2 if its probability mass function is given by

P(X=x)=Γ(x1+x2+κ)x1!x2!Γ(κ)p1x1p2x2(1p1p2)κ,P({\bf X}={\bf x})=\frac{\Gamma(x_1+x_2+\kappa)}{x_1!x_2! \Gamma(\kappa)}p_1^{x_1}p_2^{x_2}(1-p_1-p_2)^{\kappa},

where, for i=1,2i=1,2, xi{0,1,}x_i\in\{0,1,\dots\}, 0<pi<10<p_i<1 such that p1+p2<1p_1+p_2<1 and κ>0\kappa>0.

Value

An N×2N\times 2 matrix with NN simulated values from the bivariate negative binomial distribution


Computes the correlation of the components of a bivariate vector following the bivariate logarithmic series distribution

Description

Computes the correlation of the components of a bivariate vector following the bivariate logarithmic series distribution

Usage

BivLSD_Cor(p1, p2)

Arguments

p1

parameter p1p_1 of the bivariate logarithmic series distribution

p2

parameter p2p_2 of the bivariate logarithmic series distribution

Value

Correlation of the components of a bivariate vector following the bivariate logarithmic series distribution


Computes the covariance of the components of a bivariate vector following the bivariate logarithmic series distribution

Description

Computes the covariance of the components of a bivariate vector following the bivariate logarithmic series distribution

Usage

BivLSD_Cov(p1, p2)

Arguments

p1

parameter p1p_1 of the bivariate logarithmic series distribution

p2

parameter p2p_2 of the bivariate logarithmic series distribution

Value

Covariance of the components of a bivariate vector following the bivariate logarithmic series distribution


Computes the correlation of the components of a bivariate vector following the bivariate modified logarithmic series distribution

Description

Computes the correlation of the components of a bivariate vector following the bivariate modified logarithmic series distribution

Usage

BivModLSD_Cor(delta, p1, p2)

Arguments

delta

parameter δ\delta of the bivariate modified logarithmic series distribution

p1

parameter p1p_1 of the bivariate modified logarithmic series distribution

p2

parameter p2p_2 of the bivariate modified logarithmic series distribution

Value

Covariance of the components of a bivariate vector following the bivariate modified logarithmic series distribution


Computes the covariance of the components of a bivariate vector following the bivariate modified logarithmic series distribution

Description

Computes the covariance of the components of a bivariate vector following the bivariate modified logarithmic series distribution

Usage

BivModLSD_Cov(delta, p1, p2)

Arguments

delta

parameter δ\delta of the bivariate modified logarithmic series distribution

p1

parameter p1p_1 of the bivariate modified logarithmic series distribution

p2

parameter p2p_2 of the bivariate modified logarithmic series distribution

Value

Covariance of the components of a bivariate vector following the bivariate modified logarithmic series distribution


Fits the trawl function consisting of the weighted sum of two exponential functions

Description

Fits the trawl function consisting of the weighted sum of two exponential functions

Usage

fit_DExptrawl(x, Delta = 1, GMMlag = 5, plotacf = FALSE, lags = 100)

Arguments

x

vector of equidistant time series data

Delta

interval length of the time grid used in the time series, the default is 1

GMMlag

lag length used in the GMM estimation, the default is 5

plotacf

binary variable specifying whether or not the empirical and fitted autocorrelation function should be plotted

lags

number of lags to be used in the plot of the autocorrelation function

Details

The trawl function is parametrised by the three parameters 0w10\leq w \leq 1 and λ1,λ2>0\lambda_1,\lambda_2 > 0 as follows:

g(x)=weλ1x+(1w)eλ2x, for x0.g(x) = we^{\lambda_1 x}+(1-w)e^{\lambda_2 x}, \mbox{ for } x \le 0.

The Lebesgue measure of the corresponding trawl set is given by w/λ1+(1w)/λ2w/\lambda_1+(1-w)/\lambda_2.

Value

w: the weight parameter (restricted to be in [0,0.5] for identifiability reasons)

lambda1: the first memory parameter (denoted by λ1\lambda_1 above)

lambda2: the second memory parameter (denoted by λ2\lambda_2 above)

LM: The Lebesgue measure of the trawl set associated with the double exponential trawl


Fits an exponential trawl function to equidistant time series data

Description

Fits an exponential trawl function to equidistant time series data

Usage

fit_Exptrawl(x, Delta = 1, plotacf = FALSE, lags = 100)

Arguments

x

vector of equidistant time series data

Delta

interval length of the time grid used in the time series, the default is 1

plotacf

binary variable specifying whether or not the empirical and fitted autocorrelation function should be plotted

lags

number of lags to be used in the plot of the autocorrelation function

Details

The trawl function is parametrised by the parameter λ>0\lambda > 0 as follows:

g(x)=eλx, for x0.g(x) = e^{\lambda x}, \mbox{ for } x \le 0.

The Lebesgue measure of the corresponding trawl set is given by 1/λ1/\lambda.

Value

lambda: the memory parameter λ\lambda in the exponential trawl

LM: the Lebesgue measure of the trawl set associated with the exponential trawl, i.e. 1/λ1/\lambda.


Fits a long memory trawl function to equidistant univariate time series data

Description

Fits a long memory trawl function to equidistant univariate time series data

Usage

fit_LMtrawl(x, Delta = 1, GMMlag = 5, plotacf = FALSE, lags = 100)

Arguments

x

vector of equidistant time series data

Delta

interval length of the time grid used in the time series, the default is 1

GMMlag

lag length used in the GMM estimation, the default is 5

plotacf

binary variable specifying whether or not the empirical and fitted autocorrelation function should be plotted

lags

number of lags to be used in the plot of the autocorrelation function

Details

The trawl function is parametrised by the two parameters H>1H> 1 and α>0\alpha > 0 as follows:

g(x)=(1x/α)H, for x0.g(x) = (1-x/\alpha)^{-H},\mbox{ for } x \le 0.

The Lebesgue measure of the corresponding trawl set is given by α/(1H)\alpha/(1-H).

Value

alpha: parameter in the long memory trawl

H: parameter in the long memory trawl

LM: The Lebesgue measure of the trawl set associated with the long memory trawl


Fist a negative binomial distribution as marginal law

Description

Fist a negative binomial distribution as marginal law

Usage

fit_marginalNB(x, LM, plotdiag = FALSE)

Arguments

x

vector of equidistant time series data

LM

Lebesgue measure of the estimated trawl

plotdiag

binary variable specifying whether or not diagnostic plots should be provided

Details

The moment estimator for the parameters of the negative binomial distribution are given by

θ^=1E(X)/Var(X),\hat \theta = 1-\mbox{E}(X)/\mbox{Var}(X),

and

m^=E(X)(1θ^)/(LM^θ^).\hat m = \mbox{E}(X)(1-\hat \theta)/(\widehat{ \mbox{LM}} \hat \theta).

Value

m: parameter in the negative binomial marginal distribution

theta: parameter in the negative binomial marginal distribution

a: Here a=θ/(1θ)a=\theta/(1-\theta). This is given for an alternative parametrisation of the negative binomial marginal distribution


Fits a Poisson distribution as marginal law

Description

Fits a Poisson distribution as marginal law

Usage

fit_marginalPoisson(x, LM, plotdiag = FALSE)

Arguments

x

vector of equidistant time series data

LM

Lebesgue measure of the estimated trawl

plotdiag

binary variable specifying whether or not diagnostic plots should be provided

Details

The moment estimator for the Poisson rate parameter is given by

v^=E(X)/LM^.\hat v = \mbox{E}(X)/\widehat{ \mbox{LM}}.

Value

v: the rate parameter in the Poisson marginal distribution


Fits a supIG trawl function to equidistant univariate time series data

Description

Fits a supIG trawl function to equidistant univariate time series data

Usage

fit_supIGtrawl(x, Delta = 1, GMMlag = 5, plotacf = FALSE, lags = 100)

Arguments

x

vector of equidistant time series data

Delta

interval length of the time grid used in the time series, the default is 1

GMMlag

lag length used in the GMM estimation, the default is 5

plotacf

binary variable specifying whether or not the empirical and fitted autocorrelation function should be plotted

lags

number of lags to be used in the plot of the autocorrelation function

Details

The trawl function is parametrised by the two parameters δ0\delta \geq 0 and γ0\gamma \geq 0 as follows:

g(x)=(12xγ2)1/2exp(δγ(1(12xγ2)1/2)), for x0.g(x) = (1-2x\gamma^{-2})^{-1/2}\exp(\delta \gamma(1-(1-2x\gamma^{-2})^{1/2})), \mbox{ for } x \le 0.

It is assumed that δ\delta and γ\gamma are not simultaneously equal to zero. The Lebesgue measure of the corresponding trawl set is given by γ/δ\gamma/\delta.

Value

delta: parameter in the supIG trawl

gamma: parameter in the supIG trawl

LM: The Lebesgue measure of the trawl set associated with the supIG trawl


Finds the intersection of two trawl sets

Description

Finds the intersection of two trawl sets

Usage

fit_trawl_intersection(
  fct1 = base::c("Exp", "DExp", "supIG", "LM"),
  fct2 = base::c("Exp", "DExp", "supIG", "LM"),
  lambda11 = 0,
  lambda12 = 0,
  w1 = 0,
  delta1 = 0,
  gamma1 = 0,
  alpha1 = 0,
  H1 = 0,
  lambda21 = 0,
  lambda22 = 0,
  w2 = 0,
  delta2 = 0,
  gamma2 = 0,
  alpha2 = 0,
  H2 = 0,
  LM1,
  LM2,
  plotdiag = FALSE
)

Arguments

fct1

specifies the type of the first trawl function

fct2

specifies the type of the second trawl function

lambda11, lambda12, w1

parameters of the (double) exponential trawl functions of the first process

delta1, gamma1

parameters of the supIG trawl functions of the first process

alpha1, H1

parameters of the long memory trawl function of the first process

lambda21, lambda22, w2

parameters of the (double) exponential trawl functions of the second process

delta2, gamma2

parameters of the supIG trawl functions of the second process

alpha2, H2

parameters of the long memory trawl function of the second process

LM1

Lebesgue measure of the first trawl

LM2

Lebesgue measure of the second trawl

plotdiag

binary variable specifying whether or not diagnostic plots should be provided

Details

Computes R12(0)=Leb(A1A2)R_{12}(0)=\mbox{Leb}(A_1 \cap A_2) based on two trawl functions g1g_1 and g2g_2.

Value

The Lebesgue measure of the intersection of the two trawl sets


Finds the intersection of two exponential trawl sets

Description

Finds the intersection of two exponential trawl sets

Usage

fit_trawl_intersection_Exp(lambda1, lambda2, LM1, LM2, plotdiag = FALSE)

Arguments

lambda1, lambda2

parameters of the two exponential trawls

LM1

Lebesgue measure of the first trawl

LM2

Lebesgue measure of the second trawl

plotdiag

binary variable specifying whether or not diagnostic plots should be provided

Details

Computes R12(0)=Leb(A1A2)R_{12}(0)=\mbox{Leb}(A_1 \cap A_2) based on two trawl functions g1g_1 and g2g_2.

Value

The Lebesgue measure of the intersection of the two trawl sets


Finds the intersection of two long memory (LM) trawl sets

Description

Finds the intersection of two long memory (LM) trawl sets

Usage

fit_trawl_intersection_LM(alpha1, H1, alpha2, H2, LM1, LM2, plotdiag = FALSE)

Arguments

alpha1, H1, alpha2, H2

parameters of the two long memory trawls

LM1

Lebesgue measure of the first trawl

LM2

Lebesgue measure of the second trawl

plotdiag

binary variable specifying whether or not diagnostic plots should be provided

Details

Computes R12(0)=Leb(A1A2)R_{12}(0)=\mbox{Leb}(A_1 \cap A_2) based on two trawl functions g1g_1 and g2g_2.

Value

the Lebesgue measure of the intersection of the two trawl sets


Computes the mean of the logarithmic series distribution

Description

Computes the mean of the logarithmic series distribution

Usage

LSD_Mean(p)

Arguments

p

parameter of the logarithmic series distribution

Details

A random variable XX has logarithmic series distribution with parameter 0<p<10<p<1 if

P(X=x)=(1)/(log(1p))px/x, for x=1,2,.P(X=x)=(-1)/(\log(1-p))p^x/x, \mbox{ for } x=1,2,\dots.

Value

Mean of the logarithmic series distribution


Computes the variance of the logarithmic series distribution

Description

Computes the variance of the logarithmic series distribution

Usage

LSD_Var(p)

Arguments

p

parameter of the logarithmic series distribution

Details

A random variable XX has logarithmic series distribution with parameter 0<p<10<p<1 if

P(X=x)=(1)/(log(1p))px/x, for x=1,2,.P(X=x)=(-1)/(\log(1-p))p^x/x, \mbox{ for } x=1,2,\dots.

Value

Variance of the logarithmic series distribution


Computes the mean of the modified logarithmic series distribution

Description

Computes the mean of the modified logarithmic series distribution

Usage

ModLSD_Mean(delta, p)

Arguments

delta

parameter δ\delta of the modified logarithmic series distribution

p

parameter of the modified logarithmic series distribution

Details

A random variable XX has modified logarithmic series distribution with parameters 0δ<10 \le \delta <1 and 0<p<10<p<1 if P(X=0)=(1δ)P(X=0)=(1-\delta) and

P(X=x)=(1δ)(1)/(log(1p))px/x, for x=1,2,.P(X=x)=(1-\delta)(-1)/(\log(1-p))p^x/x, \mbox{ for } x=1,2,\dots.

Value

Mean of the modified logarithmic series distribution


Computes the variance of the modified logarithmic series distribution

Description

Computes the variance of the modified logarithmic series distribution

Usage

ModLSD_Var(delta, p)

Arguments

delta

parameter δ\delta of the modified logarithmic series distribution

p

parameter of the modified logarithmic series distribution

Details

A random variable XX has modified logarithmic series distribution with parameters 0δ<10\le \delta <1 and 0<p<10<p<1 if P(X=0)=(1δ)P(X=0)=(1-\delta) and

P(X=x)=(1δ)(1)/(log(1p))px/x, for x=1,2,.P(X=x)=(1-\delta)(-1)/(\log(1-p))p^x/x, \mbox{ for } x=1,2,\dots.

Value

Mean of the modified logarithmic series distribution


Plots the bivariate histogram of two time series together with the univariate histograms

Description

Plots the bivariate histogram of two time series together with the univariate histograms

Usage

plot_2and1hist(x, y)

Arguments

x

vector of equidistant time series data

y

vector of equidistant time series data (of the same length as x)

Details

This function plots the bivariate histogram of two time series together with the univariate histograms

Value

no return value


Plots the bivariate histogram of two time series together with the univariate histograms using ggplot2

Description

Plots the bivariate histogram of two time series together with the univariate histograms using ggplot2

Usage

plot_2and1hist_gg(x, y, bivbins = 50, xbins = 30, ybins = 30)

Arguments

x

vector of equidistant time series data

y

vector of equidistant time series data (of the same length as x)

bivbins

number of bins in the bivariate histogram

xbins

number of bins in the histogram of x

ybins

number of bins in the histogram of y

Details

This function plots the bivariate histogram of two time series together with the univariate histograms

Value

no return value


Simulates a bivariate trawl process

Description

Simulates a bivariate trawl process

Usage

sim_BivariateTrawl(
  t,
  Delta = 1,
  burnin = 10,
  marginal = base::c("Poi", "NegBin"),
  dependencetype = base::c("fullydep", "dep"),
  trawl1 = base::c("Exp", "DExp", "supIG", "LM"),
  trawl2 = base::c("Exp", "DExp", "supIG", "LM"),
  v1 = 0,
  v2 = 0,
  v12 = 0,
  kappa1 = 0,
  kappa2 = 0,
  kappa12 = 0,
  a1 = 0,
  a2 = 0,
  lambda11 = 0,
  lambda12 = 0,
  w1 = 0,
  delta1 = 0,
  gamma1 = 0,
  alpha1 = 0,
  H1 = 0,
  lambda21 = 0,
  lambda22 = 0,
  w2 = 0,
  delta2 = 0,
  gamma2 = 0,
  alpha2 = 0,
  H2 = 0
)

Arguments

t

parameter which specifying the length of the time interval [0,t][0,t] for which a simulation of the trawl process is required.

Delta

parameter Δ\Delta specifying the length of the time step, the default is 1

burnin

parameter specifying the length of the burn-in period at the beginning of the simulation

marginal

parameter specifying the marginal distribution of the trawl

dependencetype

Parameter specifying the type of dependence

trawl1

parameter specifying the type of the first trawl function

trawl2

parameter specifying the type of the second trawl function

v1, v2, v12

parameters of the Poisson distribution

kappa1, kappa2, kappa12, a1, a2

parameters of the (possibly bivariate) negative binomial distribution

lambda11, lambda12, w1

parameters of the exponential (or double-exponential) trawl function of the first process

delta1, gamma1

parameters of the supIG trawl function of the first process

alpha1, H1

parameter of the long memory trawl of the first process

lambda21, lambda22, w2

parameters of the exponential (or double-exponential) trawl function of the second process

delta2, gamma2

parameters of the supIG trawl function of the second process

alpha2, H2

parameter of the long memory trawl of the second process

Details

This function simulates a bivariate trawl process with either Poisson or negative binomial marginal law. For the trawl function there are currently four choices: exponential, double-exponential, supIG or long memory. More details on the precise simulation algorithm is available in the vignette.


Simulates a univariate trawl process

Description

Simulates a univariate trawl process

Usage

sim_UnivariateTrawl(
  t,
  Delta = 1,
  burnin = 10,
  marginal = base::c("Poi", "NegBin"),
  trawl = base::c("Exp", "DExp", "supIG", "LM"),
  v = 0,
  m = 0,
  theta = 0,
  lambda1 = 0,
  lambda2 = 0,
  w = 0,
  delta = 0,
  gamma = 0,
  alpha = 0,
  H = 0
)

Arguments

t

parameter which specifying the length of the time interval [0,t][0,t] for which a simulation of the trawl process is required.

Delta

parameter Δ\Delta specifying the length of the time step, the default is 1

burnin

parameter specifying the length of the burn-in period at the beginning of the simulation

marginal

parameter specifying the marginal distribution of the trawl

trawl

parameter specifying the type of trawl function

v

parameter of the Poisson distribution

m

parameter of the negative binomial distribution

theta

parameter θ\theta of the negative binomial distribution

lambda1

parameter λ1\lambda_1 of the exponential (or double-exponential) trawl function

lambda2

parameter λ2\lambda_2 of the double-exponential trawl function

w

parameter of the double-exponential trawl function

delta

parameter δ\delta of the supIG trawl function

gamma

parameter γ\gamma of the supIG trawl function

alpha

parameter α\alpha of the long memory trawl function

H

parameter of the long memory trawl function

Details

This function simulates a univariate trawl process with either Poisson or negative binomial marginal law. For the trawl function there are currently four choices: exponential, double-exponential, supIG or long memory. More details on the precise simulation algorithm is available in the vignette.


Evaluates the double exponential trawl function

Description

Evaluates the double exponential trawl function

Usage

trawl_DExp(x, w, lambda1, lambda2)

Arguments

x

the argument at which the double exponential trawl function will be evaluated

w

parameter in the double exponential trawl

lambda1

the parameter λ1\lambda_1 in the double exponential trawl

lambda2

the parameter λ2\lambda_2 in the double exponential trawl

Details

The trawl function is parametrised by parameters 0w10\leq w\leq 1 and λ1,λ2>0\lambda_1, \lambda_2 > 0 as follows:

g(x)=weλ1x+(1w)eλ2xz, for x0.g(x) = w e^{\lambda_1 x}+(1-w) e^{\lambda_2 xz}, \mbox{ for } x \le 0.

Value

The double exponential trawl function evaluated at x


Evaluates the exponential trawl function

Description

Evaluates the exponential trawl function

Usage

trawl_Exp(x, lambda)

Arguments

x

the argument at which the exponential trawl function will be evaluated

lambda

the parameter λ\lambda in the exponential trawl

Details

The trawl function is parametrised by parameter λ>0\lambda > 0 as follows:

g(x)=eλx, for x0.g(x) = e^{\lambda x}, \mbox{ for } x \le 0.

Value

The exponential trawl function evaluated at x


Evaluates the long memory trawl function

Description

Evaluates the long memory trawl function

Usage

trawl_LM(x, alpha, H)

Arguments

x

the argument at which the long memory trawl function will be evaluated

alpha

the parameter α\alpha in the long memory trawl

H

the parameter HH in the long memory trawl

Details

The trawl function is parametrised by the two parameters H>1H> 1 and α>0\alpha > 0 as follows:

g(x)=(1x/α)H, for x0.g(x) = (1-x/\alpha)^{-H}, \mbox{ for } x \le 0.

Value

the long memory trawl function evaluated at x


Evaluates the supIG trawl function

Description

Evaluates the supIG trawl function

Usage

trawl_supIG(x, delta, gamma)

Arguments

x

the argument at which the supIG trawl function will be evaluated

delta

the parameter δ\delta in the supIG trawl

gamma

the parameter γ\gamma in the supIG trawl

Details

The trawl function is parametrised by the two parameters δ0\delta \geq 0 and γ0\gamma \geq 0 as follows:

gd(x)=(12xγ2)1/2exp(δγ(1(12xγ2)1/2)), for x0.gd(x) = (1-2x\gamma^{-2})^{-1/2}\exp(\delta \gamma(1-(1-2x\gamma^{-2})^{1/2})), \mbox{ for } x \le 0.

It is assumed that δ\delta and γ\gamma are not simultaneously equal to zero.

Value

The supIG trawl function evaluated at x


Simulates from the trivariate logarithmic series distribution

Description

Simulates from the trivariate logarithmic series distribution

Usage

Trivariate_LSDsim(N, p1, p2, p3)

Arguments

N

number of data points to be simulated

p1

parameter p1p1 of the trivariate logarithmic series distribution

p2

parameter p2p2 of the trivariate logarithmic series distribution

p3

parameter p3p3 of the trivariate logarithmic series distribution

Details

The probability mass function of a random vector X=(X1,X2,X3)X=(X_1,X_2,X_3)' following the trivariate logarithmic series distribution with parameters 0<p1,p2,p3<10<p_1, p_2, p_3<1 with p:=p1+p2+p3<1p:=p_1+p_2+p_3<1 is given by

P(X1=x1,X2=x2,X3=x3)=Γ(x1+x2+x3)x1!x2!x3!p1x1p2x2p3x3(log(1p)),P(X_1=x_1,X_2=x_2,X_3=x_3)=\frac{\Gamma(x_1+x_2+x_3)}{x_1!x_2!x_3!} \frac{p_1^{x_1}p_2^{x_2}p_3^{x_3}}{(-\log(1-p))},

for x1,x2,x3=0,1,2,x_1,x_2,x_3=0,1,2,\dots such that x1+x2+x3>0x_1+x_2+x_3>0.

The simulation proceeds in two steps: First, X1X_1 is simulated from the modified logarithmic distribution with parameters p~1=p1/(1p2p3)\tilde p_1=p_1/(1-p_2-p_3) and δ1=log(1p2p3)/log(1p)\delta_1=\log(1-p_2-p_3)/\log(1-p). Then we simulate (X2,X3)(X_2,X_3)' conditional on X1X_1. We note that (X2,X3)X1=x1(X_2,X_3)'|X_1=x_1 follows the bivariate logarithmic series distribution with parameters (p2,p3)(p_2,p_3) when x1=0x_1=0, and the bivariate negative binomial distribution with parameters (x1,p2,p3)(x_1,p_2,p_3) when x1>0x_1>0.

Value

An N×3N \times 3 matrix with NN simulated values from the trivariate logarithmic series distribution