Skip to contents

Linear regression models to determine whether revisions are ‘news’ or ‘noise’. For 'noise': R (revisions) on P (preliminary estimate). For 'news': R on L (latter estimate).

Usage

signalnoise(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 = 4L)
signalnoise(vintages$diagonal_view)
#>                              News.R2    News.F News.pvalue    Noise.R2
#> [Release[2]]-[Release[1]] 0.02274828 0.2957277   0.7497232 0.143868320
#> [Release[3]]-[Release[2]] 0.08962078 0.8065870   0.4839181 0.004726473
#> [Release[4]]-[Release[3]] 0.17237145 0.6894858   0.5918961 0.277415989
#> [Release[5]]-[Release[4]]        NaN       NaN         NaN         NaN
#>                              Noise.F Noise.pvalue
#> [Release[2]]-[Release[1]] 1.87028816    0.1999080
#> [Release[3]]-[Release[2]] 0.04253826    0.9585996
#> [Release[4]]-[Release[3]] 1.10966395    0.4740091
#> [Release[5]]-[Release[4]]        NaN          NaN