Description Usage Arguments Details Value Author(s) References See Also Examples
These functions fit collection of models of one particular variant/class. Models to be fitted may differ in the requested number of Gaussian components or in the requested model structure.
1 2 3 4 5 6 7 8 9 10 11 12 | mModelList(X, knowns, B = NULL, P = NULL, class = NULL, kList = ncol(B),
init.params = NULL, stop.likelihood.change = 10^-5, stop.max.nsteps = 100,
trace = FALSE, mean = c("D", "E"), between = c("D", "E"), within = c("D",
"E"), cov = c("D", "0"), funct = belief, all.possible.permutations = FALSE, ...)
beliefList(..., funct=belief)
softList(..., funct=soft)
semisupervisedList(..., funct=semisupervised)
unsupervisedList(X, kList = 2, ...)
|
X |
a data.frame with the unlabeled observations. The rows correspond to the observations while the columns to variables/dimensions of the data. |
knowns |
a data.frame with the labeled observations. The rows correspond to the observations while the columns to variables/dimensions of the data. |
B |
a beliefs matrix which specifies the distribution of beliefs for the labeled observations. The number of rows in B should equal the number of rows in the data.frame |
P |
a matrix of plausibilities, i.e., weights of the prior probabilities for the labeled observations. If matrix |
class |
a vector of classes/labels for the labeled observations. The number of its unique values has to be less or equal |
kList |
a vector or a list with numbers of Gaussian components to fit. By default it is one number equal to the number of columns of |
init.params |
initial values for the estimates of the model parameters (means, variances and mixing proportions). The initial parameters are internally passed to the |
stop.likelihood.change, stop.max.nsteps, trace |
the parameters for the EM algorithm. Internally, these parameters are passed to the |
mean, between, within, cov |
four vectors which define the model structures for models to be fitted. For example, if |
funct |
a function which fits a variant of Gaussian mixture model, one of the: |
... |
arguments that are passed to function |
all.possible.permutations |
If equal |
Arguments kList
, as well as mean
, between
, within
, and cov
define the list of models to be fitted. All combinations of specified model sizes and model structures are considered. List of fitted models is returned as a result.
The argument funct
defines which variant of Gaussian mixture models should be used for model fitting. One can use the wrappers beliefList()
, softList()
, semisupervisedList()
, unsupervisedList()
which call the mModelList()
function and have a prespecified argument funct
.
An object of the class mModelList, with the following slots:
models |
a list of models, each of the class |
loglikelihoods |
a vector with log likelihoods of the models from list |
names |
a vector with names of the models from list |
params |
a vector with the number of parameters of models from list |
kList |
equals the input argument |
Przemyslaw Biecek
Przemyslaw Biecek, Ewa Szczurek, Martin Vingron, Jerzy Tiuryn (2012), The R Package bgmm: Mixture Modeling with Uncertain Knowledge, Journal of Statistical Software.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | simulated = simulateData(d=2, k=3, n=100, m=60, cov="0", within="E", n.labels=2)
models1=mModelList(X=simulated$X, knowns=simulated$knowns, B=simulated$B,
kList=3:4, mean=c("D","E"), between="D", within="D",
cov="0", funct=belief)
plot(models1)
plotGIC(models1, penalty="BIC")
## Do not run
## It could take more than one minute
# simulated = simulateData(d=2, k=3, n=300, m=60, cov="0", within="E", n.labels=2)
#
# models1=mModelList(X=simulated$X, knowns=simulated$knowns, B=simulated$B,
# kList=3, mean=c("D","E"), between=c("D","E"), within=c("D","E"),
# cov=c("D","0"), funct=belief)
# plot(models1)
# plotGIC(models1, penalty="BIC")
#
# models2 = beliefList(X=simulated$X, knowns=simulated$knowns, B=simulated$B,
# kList=2:7, mean="D", between="D", within="E", cov="0")
# plot(models2)
# plotGIC(models2, penalty="BIC")
#
# models3 = beliefList(X=simulated$X, knowns=simulated$knowns, B=simulated$B,
# kList=2:7, mean="D")
# plotGIC(models3, penalty="BIC")
|
Loading required package: mvtnorm
Loading required package: car
Loading required package: carData
Loading required package: lattice
Loading required package: combinat
Attaching package: 'combinat'
The following object is masked from 'package:utils':
combn
k=3 k=4
structure=DDD0 103.5511 116.6256
structure=EDD0 553.2475 560.6257
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.