AssetsMeanCovariances        package:fAssets        R Documentation

_E_s_t_i_m_a_t_i_o_n _o_f _M_e_a_n _a_n_d _C_o_v_a_r_i_a_n_c_e_s _o_f _A_s_s_e_t _S_e_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     A collection and description of functions which allow to estimate
     the mean and/or covariance matrix of a  time series of assets by
     traditional and robust methods. 

     The functions are:

       'assetsStats'    Computes basic statistics of a set of assets,
       'assetsMeanCov'  Computes mean and covariance matrix.

_U_s_a_g_e:

     assetsStats(x)

     assetsMeanCov(x, method = c("cov", "mve", "mcd", "MCD", "OGK", "nnve", 
         "shrink", "bagged"), check = TRUE, force = TRUE, baggedR = 100, 
         sigmamu = scaleTau2, alpha = 1/2, ...)

_A_r_g_u_m_e_n_t_s:

   alpha: [assetsMeanCov] - 
           when 'methode="MCD"', a numeric parameter controlling the
          size  of the subsets over which the determinant is minimized,
          i.e.,  'alpha*n' observations are used for computing the
          determinant.  Allowed values are between 0.5 and 1 and the
          default is 0.5. For details we refer to the help pages of the
          R-package 'robustbase'. 

 baggedR: [assetsMeanCov] - 
           when 'methode="bagged"', an integer value, the number of 
          bootstrap replicates, by default 100. 

   check: a logical flag. Should the covariance matrix be tested to be
          positive definite? By default 'TRUE'. 

   force: [assetsMeanCov] - 
           a logical flag. Should the covariance matrix be forced to be
          positive definite? By default 'TRUE'. 

  method: [assetsMeanVar] - 
           a character string, whicht determines how to compute the
          covariance matix. If 'method="cov"' is selected then the
          standard  covariance will be computed by R's base function
          'cov', if  'method="shrink"' is selected then the covariance
          will be computed using the shrinkage approach as suggested in
          Schaefer and Strimmer [2005], if 'method="bagged"' is
          selected then the  covariance will be calculated from the
          bootstrap aggregated (bagged) version of the covariance
          estimator.


 sigmamu: [assetsMeanCov] - 
           when 'methode="OGK"', a function that computes univariate
          robust  location and scale estimates. By default it should
          return a single  numeric value containing the robust scale
          (standard deviation)  estimate. When 'mu.too' is true (the
          default), 'sigmamu()'  should return a numeric vector of
          length 2 containing robust location  and scale estimates. See
          'scaleTau2', 's_Qn', 's_Sn',  's_mad' or 's_IQR' for examples
          to be used as 'sigmamu'  argument.  For details we refer to
          the help pages of the R-package 'robustbase'. 

       x: any rectangular time series object which can be converted by
          the  function 'as.matrix()' into a matrix object, e.g. like
          an  object of class 'timeSeries', 'data.frame', or 'mts'.  

     ...: [assetsMeanCov] - 
           optional arguments to be passed to the underlying
          estimators.  For details we refer to the manual pages of the
          functions  'cov.rob' for arguments '"mve"' and 'mcd"' in  the
          R package 'MASS', to the functions 'covMcd' and 'covOGK' in
          the R package 'robustbase'. 

_D_e_t_a_i_l_s:

     *Assets Mean and Covariance:* 

         The function 'assetsMeanCov' computes the mean vector and
     covariance matrix of an assets set. For the covariance matrix one
     can select from three choicdes: The standard covariance
     computation through R's base function 'cov' and a shrinked and
     bagged version for the covariance. The latter two choices
     implement the covariance computation from the functions
     'cov.shrink()' and 'cov.bagged()' which are part of the
     contributed R package 'corpcov'.

_V_a_l_u_e:

     'assetsMeanCov' 
      returns a list with two entries named 'mu' and Sigma{Sigma}. The
     first denotes the vector of assets means, and the second the 
     covariance matrix. Note, that the output of this function can be
     used as data input for the portfolio functions to compute the
     efficient frontier.

_A_u_t_h_o_r(_s):

     Juliane Schaefer and Korbinian Strimmer for R's 'corpcov' package, 
      Diethelm Wuertz for the Rmetrics port.

_R_e_f_e_r_e_n_c_e_s:

     Breiman L. (1996);  _Bagging Predictors_, Machine Learning 24,
     123-140.

     Ledoit O., Wolf. M. (2003); _ImprovedEestimation of the Covariance
     Matrix of Stock Returns  with an Application to Portfolio
     Selection_, Journal of Empirical Finance 10, 503-621. 

     Schaefer J., Strimmer K. (2005);   _A Shrinkage Approach to
     Large-Scale Covariance Estimation and Implications for Functional
     Genomics_, Statist. Appl. Genet. Mol. Biol. 4, 32.

_S_e_e _A_l_s_o:

     'MultivariateDistribution'.

_E_x_a_m_p_l_e_s:

     ## berndtInvest -
        data(berndtInvest)
        # Select "CONTIL" "DATGEN" "TANDY" and "DEC" Stocks:
        select = c("CONTIL", "DATGEN", "TANDY", "DEC")
        # Convert into a timeSeries object:
        berndtAssets.tS = as.timeSeries(berndtInvest)[, select]
        head(berndtAssets.tS)
        
     ## Classical Covariance Estimation:
        assetsMeanCov(berndtAssets.tS, method = "cov")
        
     ## mcd Covariance Estimation:
        # assetsMeanCov(berndtAssets.tS, method = "mcd")
        
     ## mve Covariance Estimation:
        # assetsMeanCov(berndtAssets.tS, method = "mve")
        
     ## nnve Covariance Estimation:
        # assetsMeanCov(berndtAssets.tS, method = "nnve")
        
     ## shrinkage Covariance Estimation:
        assetsMeanCov(berndtAssets.tS, method = "shrink")
        
     ## bagged Covariance Estimation:
        assetsMeanCov(berndtAssets.tS, method = "bagged")

