Learn R Programming

emax.glm (version 0.1.2)

em.fit_pracma: Carry our the Newton-Raphson optimization of the parameters for given weights via the pracma hessian,

Description

Carry our the Newton-Raphson optimization of the parameters for given weights via the pracma hessian,

Usage

em.fit_pracma(u, b, x, y, class_probs, weight, tol = 1e-08,
  debug = FALSE, family = poisson(), maxiter = Inf)

Arguments

u

A 'model.loglike' function.

b

The starting parameters.

x

An n-by-p design matrix.

y

A vector of observation of length n.

class_probs

An n length vector of probabilities for the proposed model.

weight

A n length vector of observation weight terms. This is currently designed to be either the exposure for a Poisson model or the number of trials for a Logistic model.

tol

The tolerance to repeat the Newton-Raphson optimization till.

debug

Debugging flag - set to TRUE to output step-by-step change in parameter values.

family

The GLM family being considered.

maxiter

Maximum number of NR steps to take.

Value

The parameter values on convergence.

Examples

Run this code
# NOT RUN {
x <- model.matrix(~ 1 + factor(wool) + factor(tension), data = warpbreaks)
y <- warpbreaks$breaks
class_probs = rep(1,54)
b <- c(1, 1, 1, 1)

u <- make.logLike(x, y, class_probs = class_probs)

em.fit_pracma(u, b, x, y, class_probs, weight = c(1))
# }

Run the code above in your browser using DataLab