File: assets-meancov.Rd

package info (click to toggle)
fassets 3011.83-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 428 kB
  • sloc: makefile: 1
file content (163 lines) | stat: -rw-r--r-- 5,173 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
\name{assets-meancov}


\alias{assetsMeanCov}

\alias{getCenterRob}
\alias{getCovRob}


\title{Estimation of Mean and Covariances of Asset Sets}


\description{
  
    Estimates the mean and/or covariance matrix of a 
    time series of assets by traditional and robust methods.
    
}
    

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


\arguments{
  
    \item{x}{
        any rectangular time series object which can be converted by the 
        function \code{as.matrix()} into a matrix object, e.g. like an 
        object of class \code{timeSeries}, \code{data.frame}, or \code{mts}. 
        }   
    \item{method}{
        a character string, whicht determines how to compute the covariance
        matix. If \code{method="cov"} is selected then the standard 
        covariance will be computed by R's base function \code{cov}, if 
        \code{method="shrink"} is selected then the covariance will be
        computed using the shrinkage approach as suggested in Schaefer and
        Strimmer [2005], if \code{method="bagged"} is selected then the 
        covariance will be calculated from the bootstrap aggregated (bagged)
        version of the covariance estimator.
        }  
    \item{check}{
        a logical flag. Should the covariance matrix be tested to be
        positive definite? By default \code{TRUE}.
        }
    \item{force}{
        a logical flag. Should the covariance matrix be forced to be
        positive definite? By default \code{TRUE}.
        }
    \item{baggedR}{
        when \code{methode="bagged"}, an integer value, the number of 
        bootstrap replicates, by default 100.
        }
    \item{sigmamu}{ 
        when \code{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 \code{mu.too} is true (the default), \code{sigmamu()} 
        should return a numeric vector of length 2 containing robust location 
        and scale estimates. See \code{scaleTau2}, \code{s_Qn}, \code{s_Sn}, 
        \code{s_mad} or \code{s_IQR} for examples to be used as \code{sigmamu} 
        argument. 
        For details we refer to the help pages of the R-package
        \code{robustbase}.
        }
    \item{object}{
        a list as returned by the function \code{assetsMeanCov}.
        } 
    \item{alpha}{ 
        when \code{methode="MCD"}, a numeric parameter controlling the size 
        of the subsets over which the determinant is minimized, i.e., 
        \code{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
        \code{robustbase}.
        }
    \item{\dots}{
        optional arguments to be passed to the underlying estimators. 
        For details we refer to the manual pages of the functions 
        \code{cov.rob} for arguments \code{"mve"} and \code{"mcd"} in 
        the R package \code{MASS}, to the functions
        \code{covMcd} and \code{covOGK} in the R package \code{robustbase}.
        }
        
}


\value{
  
  
    \code{assetsMeanCov}
    returns a list with for entries named \code{center} \code{cov},
    \code{mu} and \code{Sigma}. The list may have a character vector 
    attributed with additional control parameters.
    
    \code{getCenterRob}
    extracts the center from an object as returned by the function
    \code{assetsMeanCov}.
    
    \code{getCovRob}
    extracts the covariance from an object as returned by the function
    \code{assetsMeanCov}.
  
}


\references{
    
Breiman L. (1996); 
    \emph{Bagging Predictors},
    Machine Learning 24, 123--140.

Ledoit O., Wolf. M. (2003);
    \emph{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);  
    \emph{A Shrinkage Approach to
    Large-Scale Covariance Estimation and Implications for Functional Genomics},
    Statist. Appl. Genet. Mol. Biol. 4, 32.

Wuertz, D., Chalabi, Y., Chen W., Ellis A. (2009);
    \emph{Portfolio Optimization with R/Rmetrics}, 
    Rmetrics eBook, Rmetrics Association and Finance Online, Zurich.
    
}


\author{

    Juliane Schaefer and Korbinian Strimmer for R's \code{corpcov} package, \cr
    Diethelm Wuertz for the Rmetrics port.
    
}


\examples{
## LPP -
   LPP <- as.timeSeries(data(LPP2005REC))[, 1:6]
   colnames(LPP)
   
## Sample Covariance Estimation:
   assetsMeanCov(LPP)
   
## Shrinked Estimation:
   shrink <- assetsMeanCov(LPP, "shrink")
   shrink
   
## Extract Covariance Matrix:
   getCovRob(shrink)
}


\keyword{models}