NMixMCMCinitr: Initial component allocations for the NMixMCMC function
Description
This is a help function for NMixMCMC
function. If
initr
is not given, it calculates reasonable initial values for
component allocations. If initr
argument is given then it is
checked for consistency and formatted on output. THIS FUNCTION IS NOT TO BE CALLED BY ORDINARY USERS.
Usage
NMixMCMCinitr(z, K, w, mu, Sigma, p, n, initr)
Arguments
z
a vector (if $p=1$) or a $n\times p$ matrix
with initial values of scaled observations
K
a number of mixture components
w
a vector with (initial) mixture weights
mu
a vector of (initial) mixture means (if $p=1$) or a
$K\times p$ matrix with (initial) mixture means in rows
(if $p>1$)
Sigma
a vector of (initial) mixture variances (if $p=1$) or
a $K\,p\times p$ matrix with (initial) mixture
covariance matrices put below each other
initr
a vector of initial component allocations to be checked
for consistency. If not given then reasonable initials are generated.
Value
- A vector with reasonable initial component allocations.