cov.wt                 package:base                 R Documentation

_W_e_i_g_h_t_e_d _C_o_v_a_r_i_a_n_c_e _M_a_t_r_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Returns a list containing estimates of the weighted covariance
     matrix and the mean of the data, and optionally of the (weighted)
     correlation matrix.

_U_s_a_g_e:

     cov.wt(x, wt = rep(1/nrow(x), nrow(x)), cor = FALSE, center = TRUE)

_A_r_g_u_m_e_n_t_s:

       x: a matrix or data frame.  As usual, rows are observations and
          columns are variables.

      wt: a non-negative and non-zero vector of weights for each
          observation.  Its length must equal the number of rows of
          `x'.

     cor: A logical indicating whether the estimated correlation
          weighted matrix will be returned as well.

  center: Either a logical or a numeric vector specifying the centers
          to be used when computing covariances.  If `TRUE', the
          (weighted) mean of each variable is used, if `FALSE', zero is
          used.  If `center' is numeric, its length must equal the
          number of columns of `x'.

_D_e_t_a_i_l_s:

     The covariance matrix is divided by one minus the sum of squares
     of the weights, so if the weights are the default (1/n) the
     conventional unbiased estimate of the covariance matrix with
     divisor (n - 1) is obtained.  This differs from the behaviour in
     S-PLUS.

_V_a_l_u_e:

     A list containing the following named components: 

     cov: the estimated (weighted) covariance matrix

  center: an estimate for the center (mean) of the data.

   n.obs: the number of observations (rows) in `x'.

      wt: the weights used in the estimation.  Only returned if given
          as an argument.

     cor: the estimated correlation matrix.  Only returned if `cor' is
          `TRUE'.

_S_e_e _A_l_s_o:

     `cov' and `var'.

