Description Usage Arguments Value Examples

Carry out several short EM fits to test for optimal starting locations.

1 2 3 4 |

`x` |
An |

`y` |
A vector of observation of length |

`b.init` |
The method to initialize EM parameters. Built in methods are "random" and "fit" for pure white noise, and white noise around GLM estimates. Alternatively, pass a list of length K, each element consisting of a vector of length |

`weight` |
A |

`K` |
Number of EM classes to be fit. |

`maxiter` |
Maximum number of re-weighting rounds to do in fitting the EM model. Primarily used to perform the 'small.em' warm-up routine. |

`tol.1` |
Escape tolerance of the Newton-Raphson step. |

`tol.2` |
Escape tolerance of the re-weighting step. |

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

`sample.size` |
Number of cases to randomly select from the input data. |

`repeats` |
Number of repetitions of the initialization to make. |

`debug` |
Returns step-size in NR and re-weighting steps as a message if TRUE. |

`family` |
GLM family to fit. |

`method` |
Control string. Set to 'numeric' or 'pracma'. |

`maxiter.NR` |
Maximum number of Newton-Raphson steps to take. |

A 'small.em' list containing the parameters, weights, log likelihood and BIC values.

1 2 3 4 5 6 7 8 9 10 | ```
x <- model.matrix(~ factor(wool) + factor(tension), warpbreaks)
y <- warpbreaks$breaks
warm_up <- small.em(x = x, y = y, K = 2, b.init = "random", sample.size = 50)
summary(warm_up)
params <- select_best(warm_up)
m <- em.glm(x = x, y = y, K = 2, b.init = params)
summary(m)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.