MoE-mdph-method: MoE method for mdph Class

MoE,mdph-methodR Documentation

MoE method for mdph Class

Description

MoE method for mdph Class

Usage

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

Arguments

x

An object of class mdph.

formula

A regression formula.

y

A matrix of observations.

data

A data frame of covariates.

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.

Value

An object of class sph.

Examples

x <- mdph(structure = c("general", "general"))
n <- 100
responses <- cbind(rpois(n, 3) + 1, rbinom(n, 5, 0.5))
covariates <- data.frame(age = sample(18:65, n, replace = TRUE) / 100, income = runif(n, 0, 0.99))
f <- responses ~ age + income
MoE(x = x, formula = f, y = responses, data = covariates, stepsEM = 20)

matrixdist documentation built on Aug. 8, 2023, 5:06 p.m.