cov4.wt | R Documentation |
Estimates the weighted scatter matrix based on the 4th moments of the data.
cov4.wt(x, wt = rep(1/nrow(x), nrow(x)), location = TRUE,
method = "ML", na.action = na.fail)
x |
numeric data matrix or dataframe. |
wt |
numeric vector of non-negative weights. At least some weights must be larger than zero. |
location |
|
method |
Either |
na.action |
a function which indicates what should happen when the data contain 'NA's. Default is to fail. |
If location = TRUE
, then the scatter matrix is given for a n \times p
data matrix X by
\frac{1}{p+2} ave_{i}\{w_i[(x_{i}-\bar{x}_w)S_w^{-1}(x_{i}-\bar{x}_w)'](x_{i}-\bar{x}_w)'(x_{i}-\bar{x}_w)\},
where w_i
are the weights standardized such that \sum{w_i}=1
,
\bar{x}_w
is the weighted mean vector and S_w
the weighted covariance matrix.
For details about the weighted mean vector and weighted covariance matrix see cov.wt
.
A matrix containing the estimated weighted fourth moments scatter.
Klaus Nordhausen
cov4
, cov.wt
cov.matrix.1 <- matrix(c(3,2,1,2,4,-0.5,1,-0.5,2), ncol=3)
X.1 <- rmvnorm(100, c(0,0,0), cov.matrix.1)
cov.matrix.2 <- diag(1,3)
X.2 <- rmvnorm(50, c(1,1,1), cov.matrix.2)
X <- rbind(X.1, X.2)
cov4.wt(X, rep(c(0,1), c(100,50)))
cov4.wt(X, rep(c(1,0), c(100,50)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.