Learn R Programming

matrixdist (version 1.1.9)

MoE,dph-method: MoE method for dph Class

Description

MoE method for dph Class

Usage

# S4 method for dph
MoE(
  x,
  formula,
  data,
  alpha_vecs = NULL,
  weight = numeric(0),
  stepsEM = 1000,
  every = 10,
  rand_init = TRUE,
  maxWts = 1000
)

Value

An object of class sph.

Arguments

x

An object of class dph.

formula

A regression formula.

data

A data frame.

alpha_vecs

Matrix of initial probabilities.

weight

Vector of weights.

stepsEM

Number of EM steps to be performed.

every

Number of iterations between likelihood display updates.

rand_init

Random initiation in the R-step.

maxWts

Maximal number of weights in the nnet function.

Examples

Run this code
x <- dph(structure = "general")
n <- 100
responses <- rpois(n, 3) + 1
covariate <- data.frame(age = sample(18:65, n, replace = TRUE) / 100, income = runif(n, 0, 0.99))
f <- responses ~ age + income # regression formula
MoE(x = x, formula = f, y = responses, data = covariate, stepsEM = 20)

Run the code above in your browser using DataLab