estimate_GFUN_roots: Estimate roots for a set of estimating equations

View source: R/estimate_funs.R

estimate_GFUN_rootsR Documentation

Estimate roots for a set of estimating equations

Description

Using the rootFUN specified by the user (defaults to multiroot), this function estimates the roots of the equations:

G_m = sum_i psi(O_i, \hat{\theta}) = 0

Usage

estimate_GFUN_roots(.basis)

Arguments

.basis

an object of class m_estimation_basis

Details

This is primilary an internal function used within m_estimate, but it is exported for use in debugging and development.

For an example of how to use a different rootFUN, see the root solver vignette, vignette('geex_root_solvers', package = 'geex').

Value

the output of the rootFUN function

Examples


myee <- function(data){
  function(theta){
    c(data$Y1 - theta[1],
     (data$Y1 - theta[1])^2 - theta[2])
   }
 }

# Start with a basic basis
mybasis <- create_basis(
  estFUN = myee,
  data   = geexex)

# Add a control for the root solver
mycontrol <- new('geex_control', .root = setup_root_control(start = c(1, 1)))
mybasis@.control <- mycontrol

# Now estimate roots of GFUN
roots <- estimate_GFUN_roots(mybasis)
roots


bsaul/geex documentation built on July 4, 2023, 6:40 p.m.