Description Usage Arguments Details Value Note Author(s) References See Also Examples
Computes the variance covariance matrix of the inverse unified second moment matrix.
1 |
X |
an n x p matrix of observed returns. |
vcov.func |
a function which takes an object of class |
fit.intercept |
a boolean controlling whether we add a column of ones to the data, or fit the raw uncentered second moment. |
Given p-vector x with mean mu and covariance, Sigma, let y be x with a one prepended. Then let Theta = E[yy'], the uncentered second moment matrix. The inverse of Theta contains the (negative) Markowitz portfolio and the precision matrix.
Given n contemporaneous observations of p-vectors, stacked as rows in the n x p matrix X, this function estimates the mean and the asymptotic variance-covariance matrix of Theta^-1.
One may use the default method for computing covariance,
via the vcov
function, or via a 'fancy' estimator,
like sandwich:vcovHAC
, sandwich:vcovHC
, etc.
a list containing the following components:
mu |
a q = p(p+3)/2 vector of the negative Markowitz portfolio, then the vech'd precision matrix of the sample data |
Ohat |
the q x q estimated variance covariance matrix. |
n |
the number of rows in |
p |
the number of assets. |
By flipping the sign of X, the inverse of Theta contains the positive Markowitz portfolio and the precision matrix on X. Performing this transform before passing the data to this function should be considered idiomatic.
This function will be deprecated in future releases of this package. Users should migrate at that time to a similar function in the MarkowitzR package.
Steven E. Pav shabbychef@gmail.com
Pav, S. E. "Asymptotic Distribution of the Markowitz Portfolio." 2013 https://arxiv.org/abs/1312.0557
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 | X <- matrix(rnorm(1000*3),ncol=3)
# putting in -X is idiomatic:
ism <- ism_vcov(-X)
iSigmas.n <- ism_vcov(-X,vcov.func="normal")
iSigmas.n <- ism_vcov(-X,fit.intercept=FALSE)
# compute the marginal Wald test statistics:
ism.mu <- ism$mu[1:ism$p]
ism.Sg <- ism$Ohat[1:ism$p,1:ism$p]
wald.stats <- ism.mu / sqrt(diag(ism.Sg))
# make it fat tailed:
X <- matrix(rt(1000*3,df=5),ncol=3)
ism <- ism_vcov(X)
wald.stats <- ism$mu[1:ism$p] / sqrt(diag(ism$Ohat[1:ism$p,1:ism$p]))
if (require(sandwich)) {
ism <- ism_vcov(X,vcov.func=vcovHC)
wald.stats <- ism$mu[1:ism$p] / sqrt(diag(ism$Ohat[1:ism$p,1:ism$p]))
}
# add some autocorrelation to X
Xf <- filter(X,c(0.2),"recursive")
colnames(Xf) <- colnames(X)
ism <- ism_vcov(Xf)
wald.stats <- ism$mu[1:ism$p] / sqrt(diag(ism$Ohat[1:ism$p,1:ism$p]))
if (require(sandwich)) {
ism <- ism_vcov(Xf,vcov.func=vcovHAC)
wald.stats <- ism$mu[1:ism$p] / sqrt(diag(ism$Ohat[1:ism$p,1:ism$p]))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.