Learn R Programming

emax.glm (version 0.1.2)

make_param_errors: Calculate parameter errors via inversion of the Hessian matrix (either pracma or numeric approximations).

Description

Calculate parameter errors via inversion of the Hessian matrix (either pracma or numeric approximations).

Usage

make_param_errors(params, x, y, weight, family = poisson(),
  method = "numeric", dispersion = 1)

Arguments

params

Optimal parameters

x

An n-by-p design matrix.

y

A vector of observation of length n.

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.

family

GLM family to fit.

method

Control string. Set to 'numeric' or 'pracma'.

dispersion

Model dispersion parameter for over/ under-dispersed models. Defaults to 1.

Value

Calculate the errors associated with each set of parameters.

Examples

Run this code
# NOT RUN {
x <- model.matrix(~ factor(wool) + factor(tension), warpbreaks)
y <- warpbreaks$breaks

m <- em.glm(x = x, y = y, K = 2, b.init = "random")
make_param_errors(m$params, x = x, y = y ,weight = c(1))

# }

Run the code above in your browser using DataLab