Skip to contents

The series is differenced till its variance is decreasing.

Usage

differencing_fast(data, period, mad = TRUE, centile = 90, k = 1.2)

Arguments

data

Series being differenced.

period

Period considered in the automatic differencing.

mad

Use of MAD in the computation of the variance (true by default).

centile

Percentage of the data used for computing the variance (90 by default).

k

tolerance in the decrease of the variance. The algorithm stops if the new variance is higher than k*the old variance. k should be equal or slightly higher than 1 (1.2 by default)

Value

Stationary transformation

  • ddata: data after differencing

  • mean: mean correction

  • differences:

    • lag: \(ddata(t)=data(t)-data(t-lag)\)

    • order: order of the differencing

Examples

differencing_fast(log(ABS$X0.2.09.10.M), 12)
#> $ddata
#>                Jan           Feb           Mar           Apr           May
#> 1983                                                         -0.0741493458
#> 1984  0.0091461904  0.0026871821 -0.0658394637 -0.0588444482  0.1903421439
#> 1985  0.1435137649 -0.1314178361 -0.0063240191  0.1059458943 -0.0292513650
#> 1986 -0.0333814559 -0.0445838855 -0.0149824076 -0.0290912556  0.0595278241
#> 1987 -0.0681075811 -0.0026823014  0.0209466003  0.0344110474 -0.1773155307
#> 1988 -0.0377543953  0.0437768340  0.0512811469 -0.0626491781 -0.0230348959
#> 1989 -0.0717786136  0.0008396861  0.0569348226 -0.0841818002  0.0574988906
#> 1990  0.0717265265 -0.0112313059 -0.0493230032  0.0537395830 -0.0003425015
#> 1991  0.0270520826  0.0080417082 -0.0415832924  0.0160067409  0.0099583615
#> 1992  0.0406581429  0.0322288161 -0.1213256255  0.1303592885 -0.0463656445
#> 1993 -0.0017018876 -0.0644223794  0.1072988705 -0.0611802343  0.0202477556
#> 1994 -0.0572195378  0.0544940596  0.0528672988 -0.0963700315  0.0123061194
#> 1995 -0.0517314821  0.0179334264 -0.0394954540  0.0981848118 -0.0646425937
#> 1996  0.0802775388 -0.0249245444 -0.0759753338 -0.0129778564  0.0496685629
#> 1997  0.0199286686 -0.0225660995  0.0682342381 -0.1079751731  0.0856839767
#> 1998  0.0646292593 -0.1024789007 -0.0261357810  0.1749928286 -0.1583794488
#> 1999 -0.0235591251  0.0039555236  0.0625831006 -0.1106837400  0.0589652013
#> 2000 -0.0647522370  0.0961931604 -0.0793138731  0.0737707842 -0.0324899202
#> 2001 -0.0012547829 -0.0292292923  0.1002622655 -0.1065489686  0.0514192683
#> 2002  0.0146381333 -0.0236502706 -0.0067549148  0.0085334449  0.0241120051
#> 2003  0.0371628108  0.0007272659 -0.0221949953  0.0825284489 -0.0901558399
#> 2004  0.0373463236  0.0212573009 -0.0597486316  0.0089716368 -0.0094512485
#> 2005  0.0211010036 -0.0053365514  0.0926500960 -0.2411413695  0.0889627992
#> 2006 -0.0570987906  0.0435069769 -0.0773004589  0.2330077651 -0.1534070106
#> 2007  0.0306473741 -0.0509087197  0.0913944774 -0.1350214338  0.1088070874
#> 2008  0.0472731003 -0.0124730881 -0.0705559981  0.0546966115 -0.0294749107
#> 2009 -0.0120433008 -0.1137639588  0.1021185382  0.0517647540 -0.0105884347
#> 2010  0.0444352201  0.0386170635 -0.0560740659 -0.0773655422  0.0198245129
#> 2011 -0.0238233646  0.0442417742 -0.0481916928  0.1011095584 -0.0708468742
#> 2012 -0.0281956119  0.0488110071  0.0080418209 -0.0775315623  0.0903644945
#> 2013  0.0170500671 -0.0414884332  0.0511528953 -0.0731989164  0.0278197352
#> 2014  0.0477879015 -0.0823567193 -0.0327049237  0.1520792670 -0.0957534332
#> 2015  0.0023704579 -0.0243036397  0.0661233052 -0.0561303378  0.0123847057
#> 2016 -0.0231770837  0.0602845799 -0.0325574144 -0.0537494033  0.0085084502
#> 2017 -0.0396288431  0.0051433035 -0.0011521762  0.1057342365 -0.0463057039
#>                Jun           Jul           Aug           Sep           Oct
#> 1983  0.0252644272 -0.0212152419  0.0243329695 -0.0070311279  0.0323946955
#> 1984 -0.0788595498  0.0697591196 -0.0546572681 -0.0142756736  0.0572759536
#> 1985 -0.0423471627 -0.0119983663  0.0422043330 -0.0716858522  0.0608215295
#> 1986 -0.0857603002  0.1105559844 -0.0978974634  0.1640635812 -0.1178949945
#> 1987  0.2432639406 -0.1085188078 -0.0487539140 -0.0190797312  0.0477174885
#> 1988  0.0371537152 -0.1272752114  0.1320370232 -0.0056438436 -0.0446195259
#> 1989  0.0534295817 -0.0401175232  0.0609633537 -0.0594317136 -0.0168865075
#> 1990 -0.0072123648 -0.0637096726  0.0547485137 -0.0704294185  0.0677984337
#> 1991 -0.1238350362  0.2204073571 -0.0976443573 -0.0138416201  0.0870437032
#> 1992  0.0415884057 -0.1086245874 -0.0547099857  0.1630563535 -0.0505197121
#> 1993  0.0399913350 -0.0927781350  0.0284385641  0.0228977555 -0.0473575805
#> 1994  0.0267969129 -0.0136716509  0.0771801748 -0.0429850293  0.0035229463
#> 1995 -0.0273006633  0.1239742693 -0.0277431683 -0.1244958143  0.0195474643
#> 1996 -0.0356933792  0.0286578506 -0.0136220947 -0.0443496843  0.0414604498
#> 1997 -0.1229343237  0.1574233887 -0.1285412012  0.1804044746 -0.0738192392
#> 1998  0.0479030584  0.0478920569 -0.0310059897 -0.0394302456  0.0441279081
#> 1999  0.0102320969 -0.0399859733  0.0218238797  0.0313504736 -0.0431154982
#> 2000  0.2249118557 -0.4694562517  0.3197780590 -0.0642099743 -0.0256038705
#> 2001 -0.1940257005  0.3762294955 -0.2945341678  0.0065157606  0.0962976138
#> 2002  0.0508008268 -0.1321269137  0.1245869556 -0.0559756403  0.0222449962
#> 2003  0.0416994036  0.0144762958 -0.0616553250  0.0898762058 -0.0395610851
#> 2004  0.0773092188 -0.0119491741 -0.0418200745  0.0373546653 -0.0636580300
#> 2005  0.0620607267 -0.0615785358  0.0491064692 -0.0678334572 -0.0019539186
#> 2006 -0.0201668601  0.1077684266 -0.0670200989 -0.0702942730  0.0697432509
#> 2007 -0.0312949112 -0.0078040265  0.0247474118  0.0446823611 -0.0354700501
#> 2008 -0.1023714174  0.1410368299 -0.1153295039  0.0583864526 -0.0137682277
#> 2009  0.0012996442 -0.0755420496  0.0633902321 -0.0441032706  0.0429280338
#> 2010  0.0959604004 -0.0268231848 -0.0196671117  0.0287944593 -0.0619507961
#> 2011 -0.0396984411  0.0214464965  0.0078514345 -0.0318442727  0.0131867837
#> 2012  0.0601457384 -0.1674993840  0.1232494255 -0.0331081266  0.0103339983
#> 2013 -0.0397595739  0.0267957091  0.0071418076  0.0100110759  0.0204073018
#> 2014 -0.0294647495  0.1273568495 -0.1408758540  0.0618706618  0.0126784589
#> 2015  0.0012188311  0.0127171700  0.0342731201 -0.0283990437  0.0258432953
#> 2016  0.0603214441 -0.1231745350  0.0193158114  0.0242204862 -0.0402607846
#> 2017 -0.0265345390  0.0090238304  0.0227351143                            
#>                Nov           Dec
#> 1983  0.0144252111 -0.0036174067
#> 1984 -0.0455651524 -0.0158955805
#> 1985 -0.0230184021  0.0211452554
#> 1986 -0.0383259094  0.1359901092
#> 1987 -0.0047077068  0.0066282454
#> 1988  0.1293729138 -0.0853020995
#> 1989  0.0298167488 -0.0600398569
#> 1990 -0.0370819598 -0.0123229438
#> 1991 -0.0735120691  0.0094488560
#> 1992 -0.0248812212  0.0061451689
#> 1993  0.0188807954  0.0340207902
#> 1994 -0.0215272664  0.0298170775
#> 1995  0.0799188638 -0.0432178182
#> 1996 -0.0009139147 -0.0238252462
#> 1997 -0.0181400303 -0.0047565085
#> 1998 -0.0209691326  0.0266516478
#> 1999  0.0375991817 -0.0128623620
#> 2000 -0.0045193201  0.0300810794
#> 2001  0.0312471068 -0.0458185630
#> 2002  0.0381570553 -0.0759548743
#> 2003 -0.0609986243  0.0140516353
#> 2004 -0.0260144121  0.0255624198
#> 2005  0.0352584930  0.0115724930
#> 2006  0.0297027081 -0.0232354395
#> 2007 -0.0299390840  0.0117137802
#> 2008 -0.0152924854  0.0565315210
#> 2009 -0.0192780462 -0.0676170699
#> 2010  0.0282164144  0.0026762300
#> 2011  0.0149225034  0.0190522048
#> 2012 -0.0188822392  0.0005744047
#> 2013 -0.0166410386 -0.0077543741
#> 2014  0.0007327642  0.0002530341
#> 2015 -0.0325090979  0.0302388411
#> 2016  0.0179255424  0.0051302422
#> 2017                            
#> 
#> $mean
#> [1] FALSE
#> 
#> $differences
#>       [,1] [,2]
#> lag      1   12
#> order    1    1
#>