create_GFUN-methods: Creates a function that sums over psi functions

create_GFUNR Documentation

Creates a function that sums over psi functions

Description

From a list of \psi(O_i, \theta) for i = 1, ..., m, creates G_m = \sum_i \psi(O_i, \theta), called GFUN. Here, \psi(O_i, \theta) is the *inner* part of an estFUN, in that the data is fixed and G_m is a function of \theta).

Usage

create_GFUN(object, ...)

## S4 method for signature 'm_estimation_basis'
create_GFUN(object)

Arguments

object

an object of class m_estimation_basis

...

additional arguments passed to other methods

Value

a function

Examples

myee <- function(data){
   function(theta){
    c(data$Y1 - theta[1],
     (data$Y1 - theta[1])^2 - theta[2])
   }
 }
mybasis <- create_basis(
   estFUN = myee,
   data   = geexex)
f <- grab_GFUN(create_GFUN(mybasis))

# Evaluate GFUN at mean and variance: should be close to zero
n <- nrow(geexex)
f(c(mean(geexex$Y1), var(geexex$Y1) * (n - 1)/n))



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