ccov.mcgf_rs {mcgf}R Documentation

Covariance/correlation for joint distribution of an mcgf_rsobject

Description

Covariance/correlation for joint distribution of an mcgf_rsobject

Usage

## S3 method for class 'mcgf_rs'
ccov(x, model = c("all", "base", "empirical"), cor = FALSE, ...)

Arguments

x

An mcgf object.

model

Which model to use. One of all, base, and empirical.

cor

Logical; if TRUE, correlation is returned

...

Additional arguments. Not in use.

Value

A list of joint covariance/correlation matrix.

Examples

data(sim2)
sim2_mcgf <- mcgf_rs(sim2$data, dists = sim2$dists, label = sim2$label)
sim2_mcgf <- add_acfs(sim2_mcgf, lag_max = 5)
sim2_mcgf <- add_ccfs(sim2_mcgf, lag_max = 5)

# Fit a regime-switching separable model
fit_sep <- fit_base(
    sim2_mcgf,
    lag_ls = 5,
    model_ls = "sep",
    par_init_ls = list(list(
        c = 0.000001,
        gamma = 0.5,
        a = 0.5,
        alpha = 0.5
    )),
    par_fixed_ls = list(c(nugget = 0))
)
sim2_mcgf <- add_base(sim2_mcgf, fit_base_ls = fit_sep)

ccov(sim2_mcgf, model = "base")

[Package mcgf version 1.1.1 Index]