Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

semidevEstimation

Estimation of the semideviation


Description

Function which computes the semideviation.

Usage

semidevEstimation(rets, control = list())

Arguments

rets

a (T x N) matrix of past returns.

control

control parameters (see *Details*).

Details

The argument control is a list that can supply any of the following components:

  • type method used to compute the semideviation vector, among 'naive' and 'ewma' where:

    'naive' is used to compute the simple semideviation.

    'ewma' is used to compute the exponential weighted moving average semideviation. The data must be sorted from the oldest to the latest. See RiskMetrics (1996).

    The semideviation for one stock is computed as follows. First we select the returns which are smaller than the average of the past returns; we get a new vector of dimension Kx1,K<=N. Then, the weight w_i for each observation at its corresponding time t is computed as w=lambda^t. We obtain a Kx1 vector. The vector of weights is then normalized. Finally, the semideviation is obtained as the weighted standard deviation.

    Default: type = 'naive'.

  • lambda decay parameter. Default: lambda = 0.94.

Value

A (N x 1) vector of semideviations.

Author(s)

David Ardia, Kris Boudt and Jean-Philippe Gagnon Fleury.

References

RiskMetrics (1996) RiskMetrics Technical Document. J. P. Morgan/Reuters.

Examples

# Load returns of assets or portfolios
data("Industry_10")
rets = Industry_10

# Naive semideviation estimation
semidevEstimation(rets)

# Naive estimation of the semideviation
semidevEstimation(rets, control = list(type = 'naive'))

# Ewma estimation of the semideviation. Default lambda = 0.94
semidevEstimation(rets, control = list(type = 'ewma'))

# Ewma estimation of the semideviation. lambda = 0.9
semidevEstimation(rets, control = list(type = 'ewma', lambda = 0.9))

RiskPortfolios

Computation of Risk-Based Portfolios

v2.1.5
GPL (>= 2)
Authors
David Ardia [aut, cre, cph] (<https://orcid.org/0000-0003-2823-782X>), Kris Boudt [aut], Jean-Philippe Gagnon-Fleury [aut]
Initial release
2021-04-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.