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   Noise.F
#> [Release[2]]-[Release[1]] 0.02680475 0.3484618   0.7132892 0.14707125 1.9119262
#> [Release[3]]-[Release[2]] 0.09398012 0.8458211   0.4687990 0.03987909 0.3589118
#> [Release[4]]-[Release[3]] 0.33361781 1.3344712   0.4283625 0.41159898 1.6463959
#> [Release[5]]-[Release[4]]        NaN       NaN         NaN        NaN       NaN
#>                           Noise.pvalue
#> [Release[2]]-[Release[1]]    0.1938089
#> [Release[3]]-[Release[2]]    0.7105771
#> [Release[4]]-[Release[3]]    0.3778724
#> [Release[5]]-[Release[4]]          NaN