View source: R/disclapmix_robust.R
disclapmix_robust | R Documentation |
A wrapper around 'disclapmix()' that tries to avoid errors. Can sometimes avoid errors with SVD problems happening with ‘glm_method = ’internal_coef'‘ and 'glm_method = ’internal_dev''. This is done by taking a random subset of observations.
disclapmix_robust(
x,
clusters,
rnd_obs = min(5L * clusters, round(nrow(x)/2)),
rnd_tries = 10,
...
)
x |
Dataset. |
clusters |
The number of clusters/components to fit the model for. |
rnd_obs |
Number of random observations in subset if initial fit fails |
rnd_tries |
Number of tries with random subset if initial fit fails |
... |
Passed on to 'disclapmix()' |
data(danes)
db <- as.matrix(danes[rep(1:nrow(danes), danes$n), 1:(ncol(danes)-1)])
fit <- disclapmix_robust(db, 3L)
fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.