estfun {lite}R Documentation

Functions for the estfun method

Description

Functions to calculate contributions to the score vector from individual observations for a fitted model object.

Usage

## S3 method for class 'Bernoulli'
estfun(x, ...)

## S3 method for class 'GP'
estfun(x, eps = 1e-05, m = 3, ...)

Arguments

x

A fitted model object.

...

Further arguments. None are used for estfun.Bernoulli or estfun.GP.

eps, m

These control the estimation of the observed information in gpObsInfo when the GP shape parameter \xi is very close to zero. In these cases, direct calculation is unreliable. eps is a (small, positive) numeric scalar. If the absolute value of the input value of \xi, that is, pars[2], is smaller than eps then we approximate the [2, 2] element using a Taylor series expansion in \xi, evaluated up to and including the mth term.

Details

An estfun method is used by meatCL to calculate the meat in the sandwich covariance estimator on which the log-likelihood adjustments in flite are based. Specifically, meatCL is used to calculate the argument V passed to adjust_loglik.

Value

An n \times k matrix containing contributions to the score function from n observations for each of the k parameters.

estfun.Bernoulli: an n \times 2 matrix, where n is the sample size, the length of the input data to fitBernoulli. The column is named prob.

estfun.GP: an n \times 2 matrix, where n is the sample size, the length of the input data to fitGP. The columns are named sigma[u] and xi.

See Also

Bernoulli for maximum likelihood inference for the Bernoulli distribution.

generalisedPareto for maximum likelihood inference for the generalised Pareto distribution.

Examples

library(sandwich)

# estfun.Bernoulli
bfit <- fitBernoulli(c(exdex::cheeseboro) > 45)
head(estfun(bfit))

# estfun.generalisedPareto
gpfit <- fitGP(c(exdex::cheeseboro), u = 45)
head(estfun(gpfit))

[Package lite version 1.1.1 Index]