init_matrixmixture | R Documentation |
Providing this will generate a list suitable for use as the init
argument in the matrixmixture
function. Either provide data
and it will select centers and variance matrices to initialize or
provide initial values and it will format them as expected for the function.
init_matrixmixture(
data,
prior = NULL,
K = length(prior),
centers = NULL,
U = NULL,
V = NULL,
centermethod = "kmeans",
varmethod = "identity",
model = "normal",
init = NULL,
...
)
data |
data, |
prior |
prior probability. One of |
K |
number of groups |
centers |
(optional) either a matrix or an array of
|
U |
(optional) either a matrix or an array of
|
V |
(optional) either a matrix or an array of matrices
for use as the |
centermethod |
what method to use to generate initial centers.
Currently support random start ( |
varmethod |
what method to use to choose initial variance matrices.
Currently only identity matrices are created.
By default, if |
model |
whether to use a normal distribution or a t-distribution, not relevant for more initialization methods. |
init |
(optional) a (possibly partially-formed) list
with some of the components
|
... |
Additional arguments to pass to |
a list suitable to use as the init
argument in
matrixmixture
:
centers
the group means,
a p \times q \times K
array.
U
the between-row covariance matrices, a
p \times p \times K
array
V
the between-column covariance matrix, a
q \times q \times K
array
matrixmixture()
set.seed(20180221)
A <- rmatrixt(30,mean=matrix(0,nrow=3,ncol=4), df = 10)
# 3x4 matrices with mean 0
B <- rmatrixt(30,mean=matrix(2,nrow=3,ncol=4), df = 10)
# 3x4 matrices with mean 2
C <- array(c(A,B), dim=c(3,4,60)) # combine into one array
prior <- c(.5,.5) # equal probability prior
init = init_matrixmixture(C, prior = prior)
# will find two centers using the "kmeans" method on the vectorized matrices
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.