Skip to contents

Multiplicative adjustment of a time series for leap year / length of periods

Usage

ts_adjust(s, method = c("LeapYear", "LengthOfPeriod"), reverse = FALSE)

Arguments

s

The original time series

method

LeapYear: correction for leap year LengthOfPeriod: correction for the length of periods

reverse

Adjustment or reverse operation

Value

The interpolated series

Examples

y <- ABS$X0.2.09.10.M
ts_adjust(y)
#>            Jan       Feb       Mar       Apr       May       Jun       Jul
#> 1982                                460.1000  502.6000  443.8000  459.1000
#> 1983  379.2000  381.3750  472.1000  503.4000  510.6000  462.4000  468.3000
#> 1984  414.7000  403.7802  484.7000  487.3000  597.9000  500.4000  543.4000
#> 1985  516.3000  456.5402  525.8000  587.7000  700.3000  561.8000  602.8000
#> 1986  570.5000  482.4696  547.4000  594.3000  751.6000  553.4000  663.2000
#> 1987  613.9000  517.7821  599.9000  674.1000  714.0000  670.5000  720.9000
#> 1988  631.0000  536.8474  678.1000  715.7000  740.8000  722.0000  683.5000
#> 1989  631.5000  556.9286  719.0000  697.6000  764.8000  786.3000  715.1000
#> 1990  678.2000  591.4339  726.8000  744.1000  815.5000  832.4000  710.3000
#> 1991  694.0000  610.0991  719.2000  748.2000  828.2000  746.9000  794.5000
#> 1992  740.0000  648.6784  701.5000  831.4000  878.6000  826.0000  788.2000
#> 1993  762.1000  648.7411  754.1000  840.7000  906.6000  887.1000  771.5000
#> 1994  745.7000  670.3321  821.5000  831.7000  908.0000  912.6000  782.9000
#> 1995  752.4000  688.5938  811.2000  906.0000  927.2000  906.8000  880.6000
#> 1996  833.1000  718.0371  812.0000  895.2000  962.8000  908.6000  908.0000
#> 1997  840.9000  733.8946  857.9000  849.0000  994.8000  830.2000  971.1000
#> 1998  917.3000  722.5946  822.9000  970.1000  970.2000  849.4000 1042.3000
#> 1999  942.0000  744.9929  903.2000  953.2000 1011.2000  894.4000 1054.5000
#> 2000  924.9000  777.5569  901.9000 1024.7000 1052.3000 1165.5000  859.3000
#> 2001  971.9000  821.8732 1017.5000 1039.2000 1123.5000 1024.9000 1100.8000
#> 2002 1027.9000  848.9125 1043.9000 1075.3000 1190.9000 1143.0000 1075.7000
#> 2003 1099.3000  908.5402 1092.7000 1222.4000 1237.1000 1237.9000 1182.0000
#> 2004 1182.9000  964.2017 1131.4000 1277.1000 1280.3000 1384.1000 1305.9000
#> 2005 1246.3000 1046.5616 1300.8000 1153.7000 1264.2000 1454.2000 1290.1000
#> 2006 1193.7000 1046.9652 1204.5000 1348.6000 1267.6000 1429.0000 1412.0000
#> 2007 1267.3000 1056.3482 1331.6000 1302.6000 1365.1000 1491.5000 1462.3000
#> 2008 1397.8000 1111.0043 1351.7000 1396.6000 1421.1000 1401.6000 1582.3000
#> 2009 1451.0000 1066.0339 1386.9000 1509.1000 1519.4000 1500.5000 1570.7000
#> 2010 1469.1000 1121.8277 1379.9000 1389.7000 1427.2000 1551.4000 1581.0000
#> 2011 1412.6000 1127.4777 1321.6000 1472.6000 1408.9000 1471.9000 1532.5000
#> 2012 1362.4000 1102.4319 1349.2000 1391.2000 1456.9000 1616.4000 1423.4000
#> 2013 1397.4000 1123.5429 1397.3000 1339.1000 1441.9000 1537.4000 1390.6000
#> 2014 1451.0000 1074.4080 1293.2000 1442.9000 1411.8000 1461.6000 1501.6000
#> 2015 1471.2000 1063.2089 1367.2000 1442.2000 1428.7000 1480.9000 1540.9000
#> 2016 1519.2000 1125.9086 1451.5000 1451.0000 1449.7000 1596.1000 1468.3000
#> 2017 1428.5000 1102.1536 1370.3000 1522.6000 1452.4000 1557.2000 1445.5000
#>            Aug       Sep       Oct       Nov       Dec
#> 1982  438.4000  465.1000  452.7000  522.9000  889.3000
#> 1983  458.2000  482.7000  485.3000  568.7000  963.7000
#> 1984  503.4000  522.8000  556.6000  623.2000 1039.4000
#> 1985  582.5000  563.1000  637.1000  697.1000 1187.5000
#> 1986  581.1000  661.9000  665.6000  700.9000 1367.9000
#> 1987  601.6000  672.3000  709.1000  743.2000 1460.1000
#> 1988  650.9000  723.3000  729.6000  870.3000 1570.0000
#> 1989  723.8000  757.9000  751.7000  923.8000 1569.4000
#> 1990  759.4000  741.1000  786.6000  931.5000 1563.1000
#> 1991  770.4000  741.5000  858.6000  944.7000 1600.3000
#> 1992  723.6000  819.8000  902.5000  968.6000 1650.9000
#> 1993  728.7000  844.7000  886.9000  970.0000 1710.5000
#> 1994  798.8000  887.0000  934.6000 1000.4000 1817.5000
#> 1995  873.9000  856.8000  920.6000 1067.4000 1857.2000
#> 1996  888.9000  833.7000  933.7000 1081.6000 1837.6000
#> 1997  836.0000  939.1000  976.9000 1111.3000 1879.1000
#> 1998  869.9000  939.4000 1021.3000 1137.7000 1975.7000
#> 1999  899.5000 1002.3000 1043.7000 1207.2000 2069.6000
#> 2000 1009.2000 1054.6000 1070.4000 1232.5000 2177.5000
#> 2001  963.0000 1012.9000 1132.0000 1344.8000 2269.5000
#> 2002 1065.9000 1060.1000 1211.4000 1495.1000 2338.6000
#> 2003 1101.2000 1198.2000 1316.1000 1528.2000 2424.2000
#> 2004 1166.8000 1317.9000 1358.3000 1536.7000 2500.8000
#> 2005 1210.7000 1277.8000 1314.4000 1540.4000 2536.0000
#> 2006 1239.2000 1219.1000 1344.6000 1623.3000 2611.1000
#> 2007 1315.5000 1353.3000 1440.6000 1687.9000 2747.0000
#> 2008 1268.4000 1383.3000 1452.4000 1675.9000 2886.1000
#> 2009 1341.5000 1399.9000 1534.3000 1736.6000 2795.1000
#> 2010 1324.0000 1422.0000 1464.9000 1705.5000 2752.4000
#> 2011 1293.5000 1345.7000 1404.7000 1660.0000 2730.5000
#> 2012 1359.0000 1367.8000 1442.6000 1672.9000 2753.3000
#> 2013 1337.2000 1359.4000 1463.3000 1668.9000 2725.5000
#> 2014 1254.2000 1356.4000 1478.7000 1687.7000 2756.9000
#> 2015 1331.9000 1400.1000 1566.3000 1730.5000 2913.6000
#> 2016 1293.9000 1393.5000 1497.4000 1684.3000 2850.4000
#> 2017 1303.1000                                        
# with reverse we can find the
all.equal(ts_adjust(ts_adjust(y), reverse = TRUE), y)
#> [1] TRUE