initialize_settings {sectorgap}R Documentation

Model settings

Description

Initializes settings with a basic example.

Usage

initialize_settings(
  FUN_transform = function(x) 100 * log(x),
  FUN_transform_inv = function(x) exp(x/100),
  DFUN_transform_inv = function(x) 1/100 * exp(x/100)
)

Arguments

FUN_transform

transformation function, the default is function(x) 100 * log(x)

FUN_transform_inv

inverse transformation function, the default is function(x) exp(x / 100)

DFUN_transform_inv

derivative of inverse transformation function, the default is function(x) 1 exp(x / 100), only used if non-linear constraints are present

Value

A nested list with settings for the following groups:

agg

settings for the aggregate variable

group1

settings for group1, all variables in this group load on the aggregate variable, unless otherwise specified

group2

settings for group2, all variables in this group load on the aggregate variable, unless otherwise specified

subgroup1

settings for subgroup1, each variable in this group loads on the respective variable in group1

agggroup

settings for a group of variables that all load on the same variable

misc

settings for variables that require individual settings

Each group contains at least the following list items:

trend

4 is a local linear trend, 3 a local linear trend with AR(1) drift, 2 a local linear drift without shocks to trend growth, 0 implies no trend (e.g. if a variable shares a trend with another one)

cycle

2 is an AR(2) cycle, 1 an AR(1) cycle, and 0 a white noise cycle, each with normal innovations

transform

logical indicating if the transformation function should be applied to the variable or group of variables

variable

variable name(s)

variable_label

variable label(s)

label

label of group

The blocks group1, group2, subgroup1 additionally contain the following list items:

corr

4 implies that trends and drifts are correlated, 2 that only dirfts are correlated, 1 that only trends are correlated, and 0 or NA implies no correlation. Only applicable for group1, group2, subgroup1

load_name

name of the variable that all variables in the group load (for group1, group2) and which is used for the aggregation

load_lag

lags of the of the variable that all variables in the group load (for group1, group2)

constr_drift

logical indicating if constraints for the drifts should be enforced

constr_trends

logical indicating if constraints for the trends should be enforced

constr_trends_linear

logical indicating if constraints for the trends are linear or nonlinear, the default is FALSE in which case the constraint is enforced on the level series, else, it is enforced on the growth rates.

variable_neg

variable names that are negative and thus need to be subtracted when constructing weights

The block subgroup1 additionally contain the following list item:

match_group1

a character vector of the same length as variable indicating the matching variables in group1, in the same order as variable, NA indicates no match


[Package sectorgap version 0.1.0 Index]