Skip to contents

Perform temporal interpolation of low frequency to high frequency time series by regression models. Models included are Chow-Lin, Fernandez, Litterman and some variants of those algorithms.

Usage

temporal_interpolation(
  series,
  constant = TRUE,
  trend = FALSE,
  indicators = NULL,
  model = c("Ar1", "Rw", "RwAr1"),
  freq = 4L,
  obsposition = -1L,
  rho = 0,
  rho.fixed = FALSE,
  rho.truncated = 0,
  zeroinitialization = FALSE,
  diffuse.algorithm = c("SqrtDiffuse", "Diffuse", "Augmented"),
  diffuse.regressors = FALSE,
  nbcsts = 0L,
  nfcsts = 0L
)

Arguments

series

The low frequency time series that will be interpolated. It must be a ts object.

constant

Constant term (T/F). Only used with "Ar1" model when zeroinitialization = F.

trend

Linear trend (T/F, F by default)

indicators

High-frequency indicator(s) used in the interpolation. It must be a (list of) ts object(s).

model

Model of the error term (at the higher-frequency level). "Ar1" = Chow-Lin, "Rw" = Fernandez, "RwAr1" = Litterman.

freq

Integer. Annual frequency of the interpolated series. Ignored when an indicator is provided.

obsposition

Integer. Position of the observations of the low frequency series in the interpolated series. (e.g. 1st month of the year, 2d month of the year, etc.). It must be a positive integer or -1 (the default). The default value is equivalent to setting the value of the parameter equal to the frequency of the series, meaning that the last value of the interpolated series is consistent with the low frequency series.

rho

(Initial) value of the parameter. Only used with Ar1/RwAr1 models.

rho.fixed

Fixed rho (T/F, F by default)

rho.truncated

Range for rho evaluation (in [rho.truncated, 1[)

zeroinitialization

The initial values of an auto-regressive model are fixed to 0 (T/F, F by default)

diffuse.algorithm

Algorithm used for diffuse initialization. "SqrtDiffuse" by default.

diffuse.regressors

Indicates if the coefficients of the regression model are diffuse (T) or fixed unknown (F, default)

nbcsts

Number of backcast periods. Ignored when an indicator is provided.

nfcsts

Number of forecast periods. Ignored when an indicator is provided.

Value

An object of class "JD3Interpolation"

See also

temporal_disaggregation,

temporal_interpolation_raw for interpolation of atypical frequency series,

temporal_disaggregation_raw for temporal disaggregation of atypical frequency series

Examples

# chow-lin/fernandez when the last value of the interpolated series is
# consistent with the low frequency series.
Y <- rjd3toolkit::aggregate(rjd3toolkit::Retail$RetailSalesTotal, 1)
x <- rjd3toolkit::Retail$FoodAndBeverageStores
ti1 <- temporal_interpolation(Y, indicators = x)
ti1$estimation$interp
#>          Jan     Feb     Mar     Apr     May     Jun     Jul     Aug     Sep
#> 1992 1519082 1406273 1529720 1590668 1751348 1650396 1832242 1728299 1582578
#> 1993 1568837 1357071 1615158 1656159 1775062 1715333 1901390 1699930 1633663
#> 1994 1592441 1399957 1778387 1698822 1810855 1846648 1929870 1854848 1771184
#> 1995 1679651 1467664 1826591 1763316 1917015 1903939 1955357 1928540 1806534
#> 1996 1758662 1652391 1906266 1805979 2052984 1949595 2056973 2102075 1809304
#> 1997 1910920 1617817 2050879 1850083 2171112 1956243 2160695 2140527 1904936
#> 1998 1957351 1644523 1946270 2003339 2201253 2046446 2271509 2158590 2007218
#> 1999 2036140 1801104 2170669 2129335 2345201 2205686 2449366 2242365 2202472
#> 2000 2036140 1961452 2289794 2274169 2418449 2398613 2472637 2425319 2309851
#> 2001 2238265 2054535 2473413 2348414 2650161 2567162 2589878 2648499 2441942
#> 2002 2419779 2145625 2618358 2298881 2715431 2528044 2644288 2661354 2346309
#> 2003 2519401 2183191 2531479 2504108 2787238 2557853 2791228 2745905 2493249
#> 2004 2668224 2358277 2627001 2655370 2884090 2720972 2949803 2739145 2700249
#> 2005 2733493 2427092 2907472 2769841 2996345 2939497 3077350 2981385 2889852
#> 2006 2801644 2592870 2994793 2946146 3212100 3123005 3216421 3202902 3020059
#> 2007 3065825 2793111 3260858 3069593 3452677 3356380 3381645 3406024 3195145
#> 2008 3315822 3129986 3460545 3274488 3750878 3473732 3704225 3685165 3352169
#> 2009 3465088 2966536 3314824 3393724 3706109 3461210 3675524 3558283 3376991
#> 2010 3463758 3151706 3582330 3466086 3754535 3551302 3764840 3617568 3519276
#>          Oct     Nov     Dec
#> 1992 1721428 1608287 1815716
#> 1993 1700484 1654275 1942248
#> 1994 1769522 1777389 2110021
#> 1995 1768192 1844321 2222504
#> 1996 1953805 2010542 2366665
#> 1997 2060076 2034146 2474003
#> 1998 2160141 2064287 2587105
#> 1999 2251341 2216546 2808556
#> 2000 2288686 2395289 2988756
#> 2001 2504330 2590543 3067725
#> 2002 2502224 2619909 3134322
#> 2003 2652156 2645175 3268154
#> 2004 2786352 2782584 3480430
#> 2005 2938389 2971079 3696691
#> 2006 3080896 3187721 3880136
#> 2007 3288229 3430957 4005798
#> 2008 3543212 3536342 3952933
#> 2009 3561275 3505757 3638471
#> 2010 3656132 3684279 3889465

ti2 <- temporal_interpolation(Y, indicators = x, model = "Rw")
ti2$estimation$interp
#>          Jan     Feb     Mar     Apr     May     Jun     Jul     Aug     Sep
#> 1992 1478427 1403913 1485454 1525712 1631847 1565165 1685280 1616622 1520369
#> 1993 1517158 1383146 1559486 1592435 1676840 1643253 1772016 1644811 1606905
#> 1994 1603758 1483101 1739551 1693480 1773966 1804093 1865548 1822479 1773700
#> 1995 1739927 1607135 1851450 1816888 1925643 1924239 1965435 1954954 1881597
#> 1996 1884285 1826701 2007005 1953374 2129139 2073458 2156997 2199399 2018625
#> 1997 2126065 1934946 2223483 2093336 2307871 2168429 2305961 2295125 2141995
#> 1998 2183134 1975563 2173938 2210696 2340486 2237293 2385016 2309491 2208567
#> 1999 2226085 2072064 2317403 2291329 2435144 2344219 2506406 2370904 2345782
#> 2000 2254276 2219617 2451173 2455527 2565504 2567077 2630647 2614067 2552472
#> 2001 2549150 2427729 2704349 2621722 2820974 2766088 2781031 2819690 2683191
#> 2002 2680522 2511590 2836001 2637131 2924432 2812813 2901752 2925180 2729238
#> 2003 2884042 2665968 2900028 2885952 3076973 2929460 3087615 3061682 2898798
#> 2004 3027900 2824683 3003697 3023949 3176539 3070308 3222971 3085338 3061160
#> 2005 3093121 2896196 3218964 3133517 3288593 3256505 3353024 3295099 3240101
#> 2006 3204660 3073195 3345114 3319418 3501525 3449112 3517253 3514759 3400422
#> 2007 3449826 3269554 3578380 3451908 3704812 3641069 3657622 3673590 3534161
#> 2008 3611610 3487004 3703493 3578740 3891556 3706636 3857029 3842583 3620772
#> 2009 3654358 3289614 3484236 3500918 3671824 3474626 3580754 3467878 3312695
#> 2010 3274515 3079203 3374453 3308479 3509818 3386385 3538243 3451774 3397658
#>          Oct     Nov     Dec
#> 1992 1612084 1537350 1815716
#> 1993 1656908 1632251 1942248
#> 1994 1779087 1790769 2110021
#> 1995 1863504 1921022 2222504
#> 1996 2126685 2176772 2366665
#> 1997 2246955 2232312 2474003
#> 1998 2308639 2244386 2587105
#> 1999 2379291 2357536 2808556
#> 2000 2553166 2638256 2988756
#> 2001 2724338 2781223 3067725
#> 2002 2844381 2934271 3134322
#> 2003 3007765 3007158 3268154
#> 2004 3119547 3118571 3480430
#> 2005 3277623 3304679 3696691
#> 2006 3447043 3524041 3880136
#> 2007 3595511 3689652 4005798
#> 2008 3745107 3738713 3952933
#> 2009 3398987 3326881 3638471
#> 2010 3498864 3528265 3889465

# same without indicator
ti3 <- temporal_interpolation(Y, model = "Rw", freq = 12, nfcsts = 6)
ti3$estimation$interp
#>          Jan     Feb     Mar     Apr     May     Jun     Jul     Aug     Sep
#> 1992                                                                        
#> 1993 1826260 1836805 1847349 1857893 1868438 1878982 1889526 1900071 1910615
#> 1994 1956229 1970210 1984191 1998172 2012153 2026135 2040116 2054097 2068078
#> 1995 2119395 2128768 2138142 2147515 2156889 2166262 2175636 2185010 2194383
#> 1996 2234517 2246531 2258544 2270558 2282571 2294584 2306598 2318611 2330625
#> 1997 2375610 2384555 2393500 2402444 2411389 2420334 2429279 2438224 2447168
#> 1998 2483428 2492853 2502279 2511704 2521129 2530554 2539979 2549404 2558830
#> 1999 2605559 2624014 2642468 2660922 2679376 2697831 2716285 2734739 2753193
#> 2000 2823573 2838589 2853606 2868623 2883639 2898656 2913673 2928689 2943706
#> 2001 2995337 3001918 3008498 3015079 3021660 3028240 3034821 3041402 3047983
#> 2002 3073275 3078825 3084374 3089924 3095474 3101024 3106573 3112123 3117673
#> 2003 3145475 3156627 3167780 3178933 3190085 3201238 3212391 3223543 3234696
#> 2004 3285844 3303533 3321223 3338913 3356602 3374292 3391982 3409671 3427361
#> 2005 3498452 3516474 3534495 3552517 3570539 3588561 3606582 3624604 3642626
#> 2006 3711978 3727265 3742552 3757839 3773126 3788414 3803701 3818988 3834275
#> 2007 3890608 3901080 3911552 3922023 3932495 3942967 3953439 3963911 3974382
#> 2008 4001393 3996987 3992582 3988176 3983771 3979366 3974960 3970555 3966149
#> 2009 3926728 3900523 3874318 3848112 3821907 3795702 3769497 3743292 3717086
#> 2010 3659387 3680303 3701220 3722136 3743052 3763968 3784884 3805800 3826717
#> 2011 3889465 3889465 3889465 3889465 3889465 3889465                        
#>          Oct     Nov     Dec
#> 1992                 1815716
#> 1993 1921159 1931704 1942248
#> 1994 2082059 2096040 2110021
#> 1995 2203757 2213130 2222504
#> 1996 2342638 2354652 2366665
#> 1997 2456113 2465058 2474003
#> 1998 2568255 2577680 2587105
#> 1999 2771648 2790102 2808556
#> 2000 2958723 2973739 2988756
#> 2001 3054564 3061144 3067725
#> 2002 3123222 3128772 3134322
#> 2003 3245849 3257001 3268154
#> 2004 3445051 3462740 3480430
#> 2005 3660648 3678669 3696691
#> 2006 3849562 3864849 3880136
#> 2007 3984854 3995326 4005798
#> 2008 3961744 3957338 3952933
#> 2009 3690881 3664676 3638471
#> 2010 3847633 3868549 3889465
#> 2011                        

# consistent with the low frequency series.
ti4 <- temporal_interpolation(Y, indicators = x, obsposition = 1)
ti4$estimation$interp
#>          Jan     Feb     Mar     Apr     May     Jun     Jul     Aug     Sep
#> 1992 1815716 2018872 2148753 2212877 2381932 2275719 2467043 2357682 2204366
#> 1993 1942248 1967106 2238643 2281782 2406882 2344041 2539795 2327835 2258114
#> 1994 2110021 2012226 2410380 2326669 2444541 2482199 2569758 2490827 2402802
#> 1995 2222504 2083462 2461097 2394524 2556234 2542476 2596574 2568359 2439994
#> 1996 2366665 2277818 2544925 2439411 2699290 2590511 2703487 2750939 2442909
#> 1997 2474003 2241442 2697074 2485814 2823574 2597507 2812615 2791395 2543526
#> 1998 2587105 2269540 2587014 2647057 2855287 2692411 2929205 2810400 2651138
#> 1999 2808556 2434281 2823108 2779620 3006737 2859950 3116331 2898541 2856569
#> 2000 2988756 2602986 2948442 2932003 3083803 3062933 3140815 3091031 2969545
#> 2001 3067725 2700922 3141631 3010118 3327592 3240266 3264167 3325843 3108520
#> 2002 3134322 2796759 3294131 2958002 3396263 3199110 3321413 3339367 3007903
#> 2003 3268154 2836283 3202724 3173926 3471813 3230473 3476011 3428325 3162501
#> 2004 3480430 3020494 3303225 3333072 3573713 3402093 3642850 3421213 3380290
#> 2005 3696691 3092897 3598313 3453509 3691818 3632008 3777045 3676079 3579775
#> 2006 3880136 3267315 3690186 3639003 3918818 3825080 3923365 3909142 3716768
#> 2007 4005798 3477993 3970118 3768884 4171935 4070618 4097201 4122851 3900980
#> 2008 3952933 3832425 4180213 3984458 4485678 4194087 4436594 4416540 4066188
#> 2009 3638471 3660456 4026897 4109909 4438576 4180912 4406397 4283045 4092304
#> 2010 3889465 3855277 4308345 4186042 4489525 4275700 4500368 4345420 4242005
#>          Oct     Nov     Dec
#> 1992 2350453 2231415 2674806
#> 1993 2328418 2279800 2764230
#> 1994 2401053 2409331 2907519
#> 1995 2399654 2479751 2948442
#> 1996 2594942 2654636 2937016
#> 1997 2706751 2679469 3060485
#> 1998 2812032 2711182 3258571
#> 1999 2907985 2871376 3587820
#> 2000 2947276 3059435 3594349
#> 2001 3174160 3264866 3721315
#> 2002 3171944 3295763 3595049
#> 2003 3329690 3322345 3731692
#> 2004 3470881 3466917 4040888
#> 2005 3630842 3665236 4280946
#> 2006 3780776 3893169 4450118
#> 2007 3998916 4149083 4652868
#> 2008 4267189 4259960 4604133
#> 2009 4286193 4227781 4780533
#> 2010 4385994 4415607 4973723