Description Usage Arguments Details Author(s) See Also Examples
calculates Standard Deviation for univariate and multivariate series, also calculates component contribution to standard deviation of a portfolio
1 2 3 4 |
R |
a vector, matrix, data frame, timeSeries or zoo object of asset returns |
... |
any other passthru parameters. This include two types of parameters.
The first type is parameters associated with the risk/performance measure, such as tail
probability for VaR and ES. The second type is the parameters associated with the metohd
used to compute the standard error. See |
clean |
method for data cleaning through |
portfolio_method |
one of "single","component" defining whether to do univariate/multivariate or component calc, see Details. |
weights |
portfolio weighting vector, default NULL, see Details |
mu |
If univariate, mu is the mean of the series. Otherwise mu is the vector of means of the return series , default NULL, , see Details |
sigma |
If univariate, sigma is the variance of the series. Otherwise sigma is the covariance matrix of the return series , default NULL, see Details |
use |
an optional character string giving a method for computing
covariances in the presence of missing values. This must be (an
abbreviation of) one of the strings |
method |
a character string indicating which correlation coefficient
(or covariance) is to be computed. One of |
se.method |
a character string indicating which method should be used to compute
the standard error of the estimated standard deviation. One of |
TODO add more details
This wrapper function provides fast matrix calculations for univariate, multivariate, and component contributions to Standard Deviation.
It is likely that the only one that requires much description is the component decomposition. This provides a weighted decomposition of the contribution each portfolio element makes to the univariate standard deviation of the whole portfolio.
Formally, this is the partial derivative of each univariate standard deviation with respect to the weights.
As with VaR
, this contribution is presented in two forms, both
a scalar form that adds up to the univariate standard deviation of the
portfolio, and a percentage contribution, which adds up to 100
as with any contribution calculation, contribution can be negative. This
indicates that the asset in question is a diversified to the overall
standard deviation of the portfolio, and increasing its weight in relation
to the rest of the portfolio would decrease the overall portfolio standard
deviation.
@author Xin Chen, chenx26@uw.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(edhec)
# first do normal StdDev calc
StdDev.SE(edhec)
# or the equivalent
StdDev.SE(edhec, portfolio_method="single")
# now with outliers squished
StdDev.SE(edhec, clean="boudt")
# add Component StdDev for the equal weighted portfolio
StdDev.SE(edhec, clean="boudt", portfolio_method="component")
# next use more than one method at the same time
(res=StdDev.SE(edhec, se.method = c("IFiid","IFcor","BOOTiid","BOOTcor")))
printSE(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.