Learn R Programming

emax.glm (version 0.1.2)

init.fit: Method to initialize EM parameters. Carries out a single GLM fit and applies random noise to form starting space.

Description

Method to initialize EM parameters. Carries out a single GLM fit and applies random noise to form starting space.

Usage

init.fit(y, x, K, weight = c(1), family = poisson(), noise = 1)

Arguments

y

A vector of observation of length n.

x

An n-by-p design matrix.

K

Number of EM classes to be fit.

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.

noise

Standard deviation of the white noise to be applied when generating random initial states.

Value

A K-length list, each holding parameters.

Examples

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

init.fit(y = y, x = x, K = 2)

# }

Run the code above in your browser using DataLab