cov.mix.wt {hhsmm} | R Documentation |
weighted covariance
Description
The weighted means and variances using the observation matrix and the estimated weight vectors
Usage
cov.mix.wt(
x,
wt1 = rep(1/nrow(x), nrow(x)),
wt2 = rep(1/nrow(x), nrow(x)),
cor = FALSE,
center = TRUE,
method = c("unbiased", "ML")
)
Arguments
x |
the observation matrix |
wt1 |
the state probabilities matrix (number of observations times number of states) |
wt2 |
the mixture components probabilities list (of length nstate) of matrices (number of observations times number of mixture components) |
cor |
logical. if TRUE the weighted correlation is also given |
center |
logical. if TRUE the weighted mean is also given |
method |
with two possible entries:
|
Value
list containing the following items:
-
center
the weighted mean ofx
-
cov
the weighted covariance ofx
-
n.obs
the number of observations inx
-
cor
the weighted correlation ofx
, if the parametercor
is TRUE -
wt1
the state weighswt1
-
wt2
the mixture component weightswt2
-
pmix
the estimated mixture proportions
Author(s)
Morteza Amini, morteza.amini@ut.ac.ir, Afarin Bayat, aftbayat@gmail.com
Examples
data(CMAPSS)
n = nrow(CMAPSS$train$x)
wt1 = runif(n)
wt2 = runif(n)
cov.mix.wt(CMAPSS$train$x, wt1, wt2)