prepate_data {sectorgap}R Documentation

Input data

Description

Prepares the required input data, it performs the transformations to the raw data and computes the necessary weights for the constraints.

Usage

prepate_data(
  settings,
  tsl,
  tsl_n = NULL,
  tsl_p = NULL,
  ts_start = NULL,
  ts_end = NULL,
  extend_weights = FALSE
)

Arguments

settings

list with model setting, in the format returned by the function initialize_settings

tsl

time series list with all untransformed endogenous series

tsl_n

time series list with nominal level series for aggregate output agg and its subcomponents in group1, group2

tsl_p

time series list with price series for aggregate output agg and its subcomponents in group1, group2

ts_start

start date, e.g. c(2000, 2) or 2000.25

ts_end

end date, e.g. c(2000, 2) or 2000.25

extend_weights

logical indicating if missing weights at beginning/end of sample should be filled with the last/first available value

Details

Either tsl_n or tsl_p must be supplied.

Weights are forward/backward extended with the first/last value if the supplied time series do not cover the entire period.

Value

A list with five components:

tsm

multiple time series object with all (transformed) endogeneous variables

real

multiple time series object with real series of agg, group1, group2

nominal

multiple time series object with nominal series of agg, group1, group2

prices

multiple time series object with price series of agg, group1, group2

weights_growth

list of multiple time series objects with weights for the growth constraints, i.e., for series group1, group2, subgroup1 if applicable

weights_level

list of multiple time series objects with weights for the non linear level constraints, i.e., for series group1, group2, subgroup1 if applicable

Examples

data("data_ch")
settings <- initialize_settings()
data <- prepate_data(
  settings = settings,
  tsl = data_ch$tsl,
  tsl_n = data_ch$tsl_n
)

[Package sectorgap version 0.1.0 Index]