solveGel-methods: ~~ Methods for Function 'solveGel' in Package 'momentfit' ~~

solveGel-methodsR Documentation

~~ Methods for Function solveGel in Package momentfit ~~

Description

It fits a moment-based model using GEL methods.

Usage

## S4 method for signature 'momentModel'
solveGel(object, gelType="EL", theta0=NULL,
                                  lambda0=NULL, lamSlv=NULL,
                                  coefSlv=c("optim","nlminb","constrOptim"),
                                  rhoFct=NULL, 
                                  lControl=list(), tControl=list())

Arguments

object

An object of class "gelModels"

gelType

The type of GEL. It is either "EL", "ET", "EEL", "HD", "ETEL" or "ETHD".

theta0

The vector of coefficients for the starting values used in minimization algorithm. If NULL, the starting values in the object is used. For linear models, it must be provided because "linearGel" objects do not have a theta0 slot.

lambda0

The q \times 1 vector of starting values for the Lagrange multipliers. By default a zero vector is used.

lamSlv

An alternative solver for the Lagrange multiplier. By default, either Wu_lam, EEL_lam, REEL_lam or getLambda is used.

coefSlv

Minimization solver for the coefficient vector.

rhoFct

An alternative objective function for GEL. This argument is only used if we want to fit the model with a different GEL method. see rhoFct.

lControl

A list of controls for the Lagrange multiplier algorithm.

tControl

A list of controls for the coefficient algorithm.

Value

A list with the following:

theta

The vector of solution

lambda

The vector of Lagrange multiplier

lconvergence

convergence code for the Lagrange multiplier. 0 means normal convergence.

convergence

convergence code for the coefficients. 0 means normal convergence. For higher numbers, see optim, constrOptim or nlminb

Methods

signature(object = "momentModel")

The method applies to all GEL classes.

Examples

data(simData)
model1 <- momentModel(y~x1, ~z1+z2, data=simData)

## Get a good starting value
theta0 <- gmmFit(model1)@theta

## EL by default, with Wu algorithm
res2 <- solveGel(model1, theta0=theta0)

## Change solver parameters
res3 <- solveGel(model1, theta0=theta0,
                 tControl=list(method="Nelder", control=list(maxit=2000)))


momentfit documentation built on June 7, 2023, 6:30 p.m.