sds.mcgf {mcgf}R Documentation

Extract, calculate, or assign standard deviations for an mcgf or mcgf_rs object.

Description

Extract, calculate, or assign standard deviations for an mcgf or mcgf_rs object.

Usage

## S3 method for class 'mcgf'
sds(x, ...)

## S3 method for class 'mcgf_rs'
sds(x, replace = FALSE, ...)

sds(x) <- value

Arguments

x

An mcgf or mcgf_rs object.

...

Additional parameters or attributes. Not in use.

replace

Logical; if TRUE, sds are recalculated.

value

A vector (or list of vectors) of standard deviations for all stations (under each regime and combined).

Details

For mcgf objects, sds() extracts or computes the empirical standard deviations. The output is a vector of sds.

For mcgf_rs objects, sds() extracts or computes the regime-switching empirical standard deviations. The output is a list of vectors of sds. Each element in the list corresponds to the sds for a regime.

sds<- assigns sds to x. Use add_ccfs() to add both ccfs and sds to x.

Value

sds() returns empirical (regime-switching) standard deviations.

Examples

data(sim1)
sim1_mcgf <- mcgf(sim1$data, dists = sim1$dists)
sds(sim1_mcgf)

data(sim2)
sim2_mcgf <- mcgf_rs(sim2$data, dists = sim2$dists, label = sim2$label)
sds(sim2_mcgf)
data(sim1)
sim1_mcgf <- mcgf(sim1$data, dists = sim1$dists)
sim1_sds <- sds(sim1_mcgf)
sds(sim1_mcgf) <- sim1_sds

data(sim2)
sim2_mcgf <- mcgf_rs(sim2$data, dists = sim2$dists, label = sim2$label)
sim2_sds <- sds(sim2_mcgf)
sds(sim2_mcgf) <- sim2_sds

[Package mcgf version 1.1.1 Index]