Learn R Programming

HDShOP (version 0.1.5)

MeanEstim: Mean vector estimator

Description

A user-friendly function for estimation of the mean vector. Essentially, it is a function dispatcher for estimation of the mean vector that chooses a method accordingly to the type argument.

Usage

MeanEstim(x, type, ...)

Value

a numeric vector--- a value of the specified estimator of the mean vector.

Arguments

x

a p by n matrix or a data frame of asset returns. Rows represent different assets, columns -- observations.

type

a character. The estimation method to be used.

...

arguments to pass to estimators

Details

The available estimation methods for the mean are:

FunctionPaperType
.rowMeanstrad
mean_bsJorion 1986bs
mean_jsJorion 1986js
mean_bop19Bodnar et al 2019BOP19

References

Jorion1986HDShOP

BOP2019HDShOP

Examples

Run this code
n<-3e2 # number of realizations
p<-.5*n # number of assets

x <- matrix(data = rnorm(n*p), nrow = p, ncol = n)

Mean_trad <- MeanEstim(x, type="trad")

mu_0 <- rep(1/p, p)
Mean_BOP <- MeanEstim(x, type="BOP19", mu_0=mu_0)

Run the code above in your browser using DataLab