Learn R Programming

geex (version 1.1.1)

diagnose_roots: Diagnose roots of estimating equations

Description

Computes the value of $$G_m = sum_i psi(O_i, \hat{\theta})$$, i.e., the estimating equations at theta. Used to verify that \(G_m = 0\) (or close to 0).

Usage

diagnose_roots(GFUN, theta)

Value

a numeric vector

Arguments

GFUN

a function of theta

theta

parameter estimates to use in evaluating the estimating equations.

Examples

Run this code
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))

Run the code above in your browser using DataLab