diagnose_roots: Diagnose roots of estimating equations

View source: R/diagnose_funs.R

diagnose_rootsR Documentation

Diagnose roots of estimating equations

Description

Computes the value of

G_m = sum_i psi(O_i, theta)

, i.e., the estimating equations at theta. Used to verify that G_m = 0 (or close to 0).

Usage

diagnose_roots(GFUN, theta)

Arguments

GFUN

a function of theta

theta

parameter estimates to use in evaluating the estimating equations.

Value

a numeric vector

Examples

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

mest <- m_estimate(
   estFUN = myee,
   data   = geexex,
   root_control = setup_root_control(start = c(1, 1)))

f <- grab_GFUN(mest@basis)
# Should be close to zero
diagnose_roots(GFUN = f, theta = roots(mest))

geex documentation built on Aug. 8, 2022, 5:05 p.m.