caliper_relevance: Caliper method for local weights

Description Usage Arguments Details Value

View source: R/caliper_relevance.R

Description

Calculates weights for which previous log scores to use based on the caliper method. DEPRECATED.

Usage

1
2
3
4
5
6
7
8
caliper_relevance(
  atomic_df,
  sotw,
  start_agg = 161,
  cw = 5,
  mvc = 1,
  matching_vars
)

Arguments

atomic_df

Data frames with agent predictions.

sotw

Data frame containing the state of the world at each time point, which can include decision maker variables not in any of the atomic models. The first column of this data frame should be t (as in time).

start_agg

From which value of t to start aggregating, ie producing aggregate predictions.

cw

The caliper width.

mvc

Minimum viable cluster size.

matching_vars

Data frame with matching variables, ie pooling variables we want to fully match. First column should be t (and correspond in time to the other t columns).

Details

The caliper method splits the estimate between a local and a global part. The local part is the sum of all log scores within the caliper width, while the global part is the global average. The balance between the global and local part depends on the minimum viable cluster size. If the number of observations within the caliper equals or exceeds the minimum viable cluster size, the global estimates gets zero weight. When there are no obsevations within the cluster, the global estimate gets all the weight. For all situations between these extremes, a linear combination depending on how large a percentage of the minimum viable cluster size is attained. (Se paper for maths.)

Further, if eq_weights is TRUE, the caliper method will use equal weights for each model when not enough observations (ie lower than the mvc) are found within the caliper.

Value

A data table that consists of several stacked data tables (each indexed by the column t). Each subtable has a value t2 for each previous observation, and to each of those a corresponding similarity.


ooelrich/oscbvar documentation built on Sept. 8, 2021, 3:31 p.m.