muSigmaGarch {CLA}R Documentation

Compute (mu, Sigma) for a Set of Assets via GARCH fit

Description

Compute (mu, Sigma) for a set of assets via a GARCH fit to each individual asset, using package fGarch's garchFit().

Usage

muSigmaGarch(x, formula = ~garch(1, 1), cond.dist = "std", trace = FALSE,
             ...)

Arguments

x

numeric matrix or data frame (T \times d) of log returns of d assets, observed on a common set of T time points.

formula

optional formula for garchFit.

cond.dist

the conditional distribution to be used for the garch process.

trace

logical indicating if some progress of garchFit() should printed to the console.

...

optional arguments to cor, i.e., use or method.

Value

a list with components

mu

numeric vector of length n of mean returns (= E[R_i]).

covar

covariance matrix (n \times n) of the returns.

See Also

muS.sp500 which has been produced via muSigmaGarch. CLA which needs (mu, covar) as crucial input.

Examples

if(requireNamespace("FRAPO")) {
  data(NASDAQ, package = "FRAPO")
  ## 12 randomly picked stocks from NASDAQ data
  iS <- if(FALSE) {  ## created (w/ warning, in new R)  by
    RNGversion("3.5.0"); set.seed(17); iS <- sample(ncol(NASDAQ), 12)
  } else c(341L, 2126L, 1028L, 1704L, 895L, 1181L, 454L, 410L, 1707L, 425L, 950L, 5L)
  X. <- NASDAQ[, iS]
  muSig <- muSigmaGarch(X.)
  stopifnot(identical(names(muSig$mu), names(NASDAQ)[iS]),
            identical(dim(muSig$covar), c(12L,12L)),
     all.equal(unname(muSig$mu),
               c(  7.97, -4.05, -14,     21.5, -5.36, -15.3,
                 -15.9,  11.8,   -1.64, -14,    3.13, 121) / 10000,
               tol = 0.0015))
}

[Package CLA version 0.96-3 Index]