Skip to contents

Theil's Inequality Coefficient U2

Usage

theil2(vintages.view, gap = 1, na.zero = FALSE)

Arguments

vintages.view

mts object. Vertical or diagonal view of the create_vintages() output

gap

Integer. Gap to consider between each vintages. Default is 1 which means that revisions are calculated and tested for each vintages consecutively..

na.zero

Boolean whether missing values should be considered as 0 or rather as data not (yet) available (the default).

Examples


## Simulated data
df_long <- simulate_long(
    n_period = 10L * 4L,
    n_revision = 5L,
    periodicity = 4L,
    start_period = as.Date("2010-01-01")
)

## Create vintage and test
vintages <- create_vintages(df_long, periodicity = 4)
theil2(vintages$diagonal_view)
#> [1] 0.3211074 0.2229574 0.3608409 0.2035616