param_formats: Book-keeping functions for working with expanded parameters

expand_paramsR Documentation

Book-keeping functions for working with expanded parameters

Description

Iterated block particle filters require shared parameters to be expanded into having a value at each unit. expand_params, contract_params and mean_by_unit provide tools for moving between representations. For a unit-specific expansion of a shared parameter, all the values for different units should be the same, and mean_by_unit ensures this by taking an average.

Usage

expand_params(params, expandedParNames, U)

contract_params(params, expandedParNames, U, average = FALSE)

mean_by_unit(params, expandedParNames, U)

Arguments

params

Input parameter vector

expandedParNames

character vector of parameters that are, or should be, expanded. These names should have no numerical suffix 1:U.

U

Number of units

average

Logical value for whether contract_params should average unequal values

Details

These functions assume that expanded parameters have names ending in "1" through "U", where U is the number of units. Contracted parameters, meaning any parameter that is not expanded, should have a name ending in "1". This numerical suffix convention is useful for writing model-building code that allows parameters to be either expanded or contracted.

See Also

Other utilities: arma_benchmark()


kidusasfaw/spatPomp documentation built on April 27, 2024, 2:20 p.m.