genD.TSestModel: Generate Bates and Watts D Matrix

Description Usage Arguments Details Value See Also Examples

View source: R/dsecurve.R

Description

Generate a matrix of function derivative information.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
    ## S3 method for class 'TSestModel'
genD(func, x=coef(func),
        method="Richardson", method.args=list(d=0.01, eps=1e-4, r=6, v=2),
        Shape=TSmodel(func), data=TSdata(func), ...)
    ## S3 method for class 'ARMA'
genD(func, x=coef(func),
        method="Richardson", method.args=list(d=0.01, eps=1e-4, r=6, v=2),
        Shape=TSmodel(func), data=TSdata(func), ...)
    ## S3 method for class 'innov'
genD(func, x=coef(func),
        method="Richardson", method.args=list(d=0.01, eps=1e-4, r=6, v=2),
        Shape=TSmodel(func), data=TSdata(func), ...)

Arguments

func

a TSestModel or TSmodel object which is used as a function mapping coefficients (parameters) to residuals.

x

parameter vector first argument to function func indicating the point with respect to which the derivative is calculated.

method

string indicating the numerical approximation method.

method.args

list with arguments to method (see grad).

Shape

a TSmodel in which the parameters should be used.

data

TSdata to use in teh evaluation.

...

additional arguments passed to func.

Details

The derivatives are calculated numerically using Richardson improvement.

Value

A list with three elements as follows: D is a matrix of first(gradients) and second order partial derivatives organized in the same manner as Bates and Watts. (The first p columns are the gradients and the next p(p-1)/2 columns are the lower triangle of the Hessian). p is the dimension of the parameter space=dim of the tangent space. f0 is the function value at the point where the matrix D was calculated.

See Also

genD grad curvature

Examples

1
2
3
4
5
6
   require("dse")
   data("eg1.DSE.data.diff", package="dse")
   model <- estVARXls(TSdata( output=outputData(eg1.DSE.data.diff, series=1:2)),
                      max.lag=2)
   require("numDeriv")
   z <- genD(model)

curve documentation built on May 2, 2019, 5:31 p.m.

Related to genD.TSestModel in curve...