deltamethod: First-order Taylor Series Expansion of Functions of Random...

Description Usage Arguments Details Value Author(s) Examples

Description

The delta method for approximating the standard error of a transformation g(X) of a random variable X = (x1, x2, ...), given estimates of the mean and covariance matrix of X.

Usage

1
deltamethod(g, mean, cov, ses = TRUE)

Arguments

g

A formula representing the transformation. The variables must be labelled x1, x2, ... For example, ~ 1 / (x1 + x2). If the transformation returns a vector, then a list of formulae representing (g1, g2, ...) can be provided, for example list( ~ x1 + x2, ~ x1 / (x1 + x2) ).

mean

The estimated mean of X.

cov

The estimated covariance matrix of X.

ses

If TRUE, then the standard errors of g1(X), g2(X), ... are returned. Otherwise the covariance matrix of g(X) is returned.

Details

This function was copied from package msm.

It is used in CatDyn to backtransform from the logarithm because CatDyn parameters are all estimated in the log scale to improve numerical performance.

For more details see the help pages for function deltamethod of package msm.

Value

A vector containing the standard errors of g1(X), g2(X), ... or a matrix containing the covariance of g(X).

Author(s)

C. H. Jackson <chris.jackson@mrc-bsu.cam.ac.uk>

Examples

1
#See the examples in package msm.

Example output

--------------------------------------------------------------
 Fishery Stock Assessment by Catch Dynamics Models
 CatDyn version 1.1-1 (built on 2018-12-18) is now loaded
--------------------------------------------------------------

CatDyn documentation built on May 2, 2019, 4:21 a.m.