assetsFit              package:fAssets              R Documentation

_F_i_t_t_i_n_g _o_f _M_u_l_t_i_v_a_r_i_a_t_e _A_s_s_e_t _S_e_t_s

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

     Fits the parameters to a multivariate normal,  skew normal, or
     (skew) Student-t distribution.

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

        
     assetsFit(x, method = c("st", "snorm", "norm"), title = NULL, 
         description = NULL, fixed.df = NA, ...)

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

       x: a numeric matrix of returns or any other rectangular object
          like a data.frame or a multivariate time series object which
          can be  transformed by the function 'as.matrix' to an object
          of  class 'matrix'. 

  method: a character string, which type of distribution should be
          fitted? 'method="st"' denotes a multivariate skew-Student-t
          distribution, 'method="snorm"' a multivariate skew-Normal
          distribution, and 'method="norm"' a multivariate Normel
          distribution.   By default a multivariate normal distribution
          will be fitted to the empirical market data. 

   title: a character string, assigning a title to an  '"fASSETS"'
          object. 

description: a character string, assigning a brief description to an 
          '"fASSETS"' object. 

fixed.df: either 'NA', the default, or a numeric value assigning the
          number of degrees of freedom to the model. In the case that 
          'fixed.df=NA' the value of 'df' will be included in the
          optimization process, otherwise not. 

     ...: optional arguments to be passed. 

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

     The function 'assetsFit' for the parameter estimation uses code 
     based on functions from the contributed packages '"mtvnorm"' and 
     '"sn"' for fitting data to a multivariate Normal, skew-Normal,  or
     skew-Student-t distribution.

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

     'assetsFit()'  
      returns a S4 object class of class '"fASSETS"', with the 
     following slots:

   @call: the matched function call. 

   @data: the input data in form of a data.frame. 

@description: allows for a brief project description. 

    @fit: the results as a list returned from the underlying fitting
          function.  

 @method: the selected method to fit the distribution, one  of
          '"norm"', '"snorm"', '"st"'. 

  @model: the model parameters describing the fitted parameters in 
          form of a list, 'model=list(mu, Omega, alpha, df'. 

  @title: a title string. 

 @fit$dp: a list containing the direct parameters beta, Omega, alpha. 
          Here, beta is a matrix of regression coefficients with 
          'dim(beta)=c(nrow(X), ncol(y))', 'Omega' is a  covariance
          matrix of order 'dim', 'alpha' is  a vector of shape
          parameters of length 'dim'.   

 @fit$se: a list containing the components beta, alpha, info. Here, 
          beta and alpha are the standard errors for the corresponding 
          point estimates; info is the observed information matrix  for
          the working parameter, as explained below. 

fit@optim: the list returned by the optimizer 'optim'; see the 
          documentation of this function for explanation of its 
          components.   


     Note that the '@fit$model' slot can be used as input to the 
     function 'assetsSim' for simulating a similar portfolio of  assets
     compared with the original portfolio data, usually market assets.

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

     Adelchi Azzalini for R's 'sn' package, 
      Torsten Hothorn for R's 'mtvnorm' package, 
      Diethelm Wuertz for the Rmetrics port.

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

     Azzalini A. (1985); _A Class of Distributions Which Includes the
     Normal Ones_, Scandinavian Journal of Statistics 12, 171-178. 

     Azzalini A. (1986); _Further Results on a Class of Distributions
     Which Includes  the Normal Ones_, Statistica 46, 199-208. 

     Azzalini A., Dalla Valle A. (1996); _The Multivariate Skew-normal
     Distribution_, Biometrika 83, 715-726. 

     Azzalini A., Capitanio A. (1999); _Statistical Applications of the
     Multivariate Skew-normal  Distribution_, Journal Roy. Statist.
     Soc. B61, 579-602. 

     Azzalini A., Capitanio A. (2003); _Distributions Generated by
     Perturbation of Symmetry with  Emphasis on a Multivariate Skew-t
     Distribution_, Journal Roy. Statist. Soc. B65, 367-389. 

     Genz A., Bretz F. (1999); _Numerical Computation of Multivariate
     t-Probabilities with Application to Power Calculation of Multiple
     Contrasts_,  Journal of Statistical Computation and Simulation 63,
     361-378.

     Genz A. (1992); _Numerical Computation of Multivariate Normal
     Probabilities_, Journal of Computational and Graphical Statistics
     1, 141-149.

     Genz A. (1993);  _Comparison of Methods for the Computation of
     Multivariate Normal Probabilities_, Computing Science and
     Statistics 25, 400-405.

     Hothorn T., Bretz F., Genz A. (2001); _On Multivariate t and Gauss
     Probabilities in R_, R News 1/2, 27-29.

     Wuertz, D., Chalabi, Y., Chen W., Ellis A. (2009); _Portfolio
     Optimization with R/Rmetrics_,  Rmetrics eBook, Rmetrics
     Association and Finance Online, Zurich.

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

     ## LPP -
        # Percentual Returns:
        LPP = 100 * as.timeSeries(data(LPP2005REC))[, 1:6]
        colnames(LPP)
        
     ## assetsFit -
        # Fit a Skew-Student-t Distribution:
        fit = assetsFit(LPP)
        print(fit)
        # Show Model Slot:
        print(fit@model)
        
     ## assetsSim -
        # Simulate set with same statistical properties:
        set.seed(1953)
        lppSim = assetsSim(n = nrow(LPP), dim = ncol(LPP), model = fit@model)
        colnames(lppSim) <- colnames(LPP)
        rownames(lppSim) <- rownames(LPP)
        head(lppSim) 

