This document details the way Statistics Canada calculates trend-cycle estimates. It is intended as a technical document to support users who wish to apply trend-cycle estimation to monthly series available on CANSIM. General formulas outlining the mathematical calculations are presented below, and the derivation and application of the moving average weights are provided. For more information on the use of trend-cycle estimates in analysis, please refer to "Trend-cycle estimates: Frequently asked questions" (Statistics Canada 2015).
The trend-cycle estimation method used at Statistics Canada applies moving averages and does not remove seasonal patterns. This procedure is intended for monthly series with at least 13 data points that do not exhibit seasonal patterns (either because no seasonality exists, or because it has been removed by seasonal adjustment).
1.0 The general formula
For each month t, the following formula is applied to estimate the trend-cycle, denoted as :
Formula 1
where is the value of the input series for month , available for . If the value of the input series for month is available, is an indicator equal to 1. Otherwise, it is equal to 0. Applying this formula near the beginning or end of a series leads to undefined terms (e.g. ), discussed in Section 1.1. The quantities shown as represent the moving average weights applied to month for the calculation of the trend-cycle for month t. This is referred to as the cascade linear filter, as derived by Dagum and Luati (2009) and presented in Table 1.
Table 1 Full-precision moving average weights for calculating the trend-cycle for month t
Months |
Weights |
---|
t-6 and t+6 |
-0.027 |
---|
t-5 and t+5 |
-0.007 |
---|
t-4 and t+4 |
0.031 |
---|
t-3 and t+3 |
0.067 |
---|
t-2 and t+2 |
0.136 |
---|
t-1 and t+1 |
0.188 |
---|
t |
0.224 |
---|
Applying formula (1) for each month yields the trend-cycle series.
1.1 Applying the general formula
The weights presented in Table 1 were developed by combining several filters that are each optimal for specific purposes. The combined results provide robust trend-cycle estimates with good statistical properties. For more information, see Dagum and Luati (2009).
By design, aggregating the weights in Table 1 for all months from (t-6) to (t+6) gives an exact total of 1. This is necessary so that the level of the trend-cycle series is the same on average as the level of the input series. Note that when we derive the trend-cycle estimates for the first six and the last six months of the input series, formula (1) includes terms that are not defined, such as Y0. However, these terms can be assumed to be 0 since they disappear when multiplied by the corresponding indicator coefficient, I0, which equals 0 by definition. In these cases, the denominator in formula (1) represents an adjustment to the moving average weights. Referred to as the cut-and-normalize approach, this ensures that the moving average weights used to estimate the trend-cycle for each month add up to 1. In the cut-and-normalize approach, the weights of the months for which data are unavailable are redistributed proportionally to the months for which data are available. For all other months, the denominator in formula (1) is equal to 1, and the formula is reduced to a simple symmetric moving average with the weights specified in Table 1.
1.2 Alternate expression
In formula (1), a cut-and-normalize approach is used to derive the moving average weights for the first and last six months of the input series. In effect, the cut-and-normalize approach to estimating the trend-cycle employs modified moving average weights to calculate the trend-cycle of the first six months of the series and the final six months. For example, when the trend-cycle estimate for the final month of a series is calculated, the values of the six subsequent months are not yet known. The cut-and-normalize approach proportionally rescales the weights for the months that are available so that their sum is 1. An equivalent expression to formula (1) is given in formula (2), which is based on the rescaled moving average weights, , given in formula (3).
Formula 2
Formula 3
2.0 Illustration
To illustrate how to compute and apply the moving average weights, we consider a monthly series, , that spans from January 2010 to July 2015—a total of 67 months. The rescaled moving average weights in the formulas below have been rounded to six decimal places. This rounding will sometimes lead to an overestimation or an underestimation at the beginning and end of the series. Because of rounding errors, the trend-cycle obtained using these rounded weights will not be precise within these sections. The full-precision weights must be used to reproduce published trend-cycle estimates exactly.
Three examples below illustrate trend-cycle estimates near the beginning, middle and end of the series. These demonstrate the application of the moving averages when not all months of the 13-term moving average are available (examples 1 and 3), as well as when they are (example 2).
Example 1
For the March 2010 trend-cycle estimate (t=3 of the series), the values are available only for j=1,...,9, which correspond to January 2010 to September 2010. Therefore, a nine-term moving average is used.
According to formula (3), the rescaled weight applied to January 2010 for this moving average is
.
Approximate values of the rescaled moving average weights, , calculated for the months included in the moving average to estimate the trend-cycle for month 3, are shown in Table 2.
Table 2 Rescaled moving average weights (approximate values) for March 2010
Reference month |
Weight |
Approximate value |
---|
j=1 (Jan. 2010) |
|
0.145299 |
---|
j=2 (Feb. 2010) |
|
0.200855 |
---|
j=3 (Mar. 2010) |
|
0.239316 |
---|
j=4 (Apr. 2010) |
|
0.200855 |
---|
j=5 (May 2010) |
|
0.145299 |
---|
j=6 (June 2010) |
|
0.071581 |
---|
j=7 (July 2010) |
|
0.033120 |
---|
j=8 (Aug. 2010) |
|
-0.007479 |
---|
j=9 (Sept. 2010) |
|
-0.028846 |
---|
Finally, applying formula (2) to the input series gives the following expression for , the trend-cycle estimate for March 2010:
Example 2
For the August 2012 trend-cycle estimate (t=32 of the series), the values of are available for each month from j=26,...,38, which correspond to February 2012 to February 2013. Therefore, a complete 13-term moving average is used. Because the denominator of formula (3) is exactly equal to 1 in this case, the rescaling has no effect and the weights used in the moving average are identical to the weights in Table 1.
The rescaled weight applied to August 2012 in this moving average is given by
The rescaled moving average weights, , calculated for the months included in the moving average used to calculate the trend-cycle estimate for month 32, are presented in Table 3.
Table 3 Rescaled moving average weights to calculate trend-cycle for August 2012
Reference month(s) |
Weight |
Value |
---|
j=26 (Feb. 2012) and j=38 (Feb. 2013) |
|
-0.027 |
---|
j=27 (Mar. 2012) and j=37 (Jan. 2013) |
|
-0.007 |
---|
j=28 (Apr. 2012) and j=36 (Dec. 2012) |
|
0.031 |
---|
j=29 (May 2012) and j=35 (Nov. 2012) |
|
0.067 |
---|
j=30 (June 2012) and j=34 (Oct. 2012) |
|
0.136 |
---|
j=31 (July 2012) and j=33 (Sept. 2012) |
|
0.188 |
---|
j=32 (Aug. 2012) |
|
0.224 |
---|
Applying formula (2) to the input series produces the following expression for the August 2012 trend-cycle estimate, :
Example 3
For the July 2015 trend-cycle estimate (t=67 of the series), the values of are known only for each month from j=61,...,67, which correspond to January 2015 to July 2015. Therefore, a seven-term moving average is used.
The rescaled weight applied to July 2015 in this moving average is
The rescaled moving average weights, , calculated for the other months included in the moving average used to calculate the trend-cycle estimate for month 67, are presented in Table 4.
Table 4 Rescaled moving average weights (approximate values) for July 2015
Reference month |
Weight |
Approximate value |
---|
j=61 (Jan. 2015) |
|
-0.044118 |
---|
j=62 (Feb. 2015) |
|
-0.011438 |
---|
j=63 (Mar. 2015) |
|
0.050654 |
---|
j=64 (Apr. 2015) |
|
0.109477 |
---|
j=65 (May 2015) |
|
0.222222 |
---|
j=66 (June 2015) |
|
0.307190 |
---|
j=67 (July 2015) |
|
0.366013 |
---|
Applying formula (2) to the input series gives the following expression for the July 2015 trend-cycle estimate, :
3.0 Exact weights
A summary of the rescaled moving average weights, , that are used in calculating the trend-cycle estimates over the entire series are given in Table 5.
Table 5 Rescaled weights for each month, derived under the cut-and-normalize approach
|
j=t-6 |
j=t-5 |
j=t-4 |
j=t-3 |
j=t-2 |
j=t-1 |
j=t |
j=t+1 |
j=t+2 |
j=t+3 |
j=t+4 |
j=t+5 |
j=t+6 |
---|
t=1 |
0 |
0 |
0 |
0 |
0 |
0 |
=(0.224) / (0.612) |
=(0.188) / (0.612) |
=(0.136) / (0.612) |
=(0.067) / (0.612) |
=(0.031) / (0.612) |
=(-0.007) / (0.612) |
=(-0.027) / (0.612) |
---|
t=2 |
0 |
0 |
0 |
0 |
0 |
=(0.188) / (0.8) |
=(0.224) / (0.8) |
=(0.188) / (0.8) |
=(0.136) / (0.8) |
=(0.067) / (0.8) |
=(0.031) / (0.8) |
=(-0.007) / (0.8) |
=(-0.027) / (0.8) |
---|
t=3 |
0 |
0 |
0 |
0 |
=(0.136) / (0.936) |
=(0.188) / (0.936) |
=(0.224) / (0.936) |
=(0.188) / (0.936) |
=(0.136) / (0.936) |
=(0.067) / (0.936) |
=(0.031) / (0.936) |
=(-0.007) / (0.936) |
=(-0.027) / (0.936) |
---|
t=4 |
0 |
0 |
0 |
=(0.067) / (1.003) |
=(0.136) / (1.003) |
=(0.188) / (1.003) |
=(0.224) / (1.003) |
=(0.188) / (1.003) |
=(0.136) / (1.003) |
=(0.067) / (1.003) |
=(0.031) / (1.003) |
=(-0.007) / (1.003) |
=(-0.027) / (1.003) |
---|
t=5 |
0 |
0 |
=(0.031) / (1.034) |
=(0.067) / (1.034) |
=(0.136) / (1.034) |
=(0.188) / (1.034) |
=(0.224) / (1.034) |
=(0.188) / (1.034) |
=(0.136) / (1.034) |
=(0.067) / (1.034) |
=(0.031) / (1.034) |
=(-0.007) / (1.034) |
=(-0.027) / (1.034) |
---|
t=6 |
0 |
=(-0.007) / (1.027) |
=(0.031) / (1.027) |
=(0.067) / (1.027) |
=(0.136) / (1.027) |
=(0.188) / (1.027) |
=(0.224) / (1.027) |
=(0.188) / (1.027) |
=(0.136) / (1.027) |
=(0.067) / (1.027) |
=(0.031) / (1.027) |
=(-0.007) / (1.027) |
=(-0.027) / (1.027) |
---|
t=7,…,T-6 |
-0.027 |
-0.007 |
0.031 |
0.067 |
0.136 |
0.188 |
0.224 |
0.188 |
0.136 |
0.067 |
0.031 |
-0.007 |
-0.027 |
---|
t=T-5 |
=(-0.027) / (1.027) |
=(-0.007) / (1.027) |
=(0.031) / (1.027) |
=(0.067) / (1.027) |
=(0.136) / (1.027) |
=(0.188) / (1.027) |
=(0.224) / (1.027) |
=(0.188) / (1.027) |
=(0.136) / (1.027) |
=(0.067) / (1.027) |
=(0.031) / (1.027) |
=(-0.007) / (1.027) |
0 |
---|
t=T-4 |
=(-0.027) / (1.034) |
=(-0.007) / (1.034) |
=(0.031) / (1.034) |
=(0.067) / (1.034) |
=(0.136) / (1.034) |
=(0.188) / (1.034) |
=(0.224) / (1.034) |
=(0.188) / (1.034) |
=(0.136) / (1.034) |
=(0.067) / (1.034) |
=(0.031) / (1.034) |
0 |
0 |
---|
t=T-3 |
=(-0.027) / (1.003) |
=(-0.007) / (1.003) |
=(0.031) / (1.003) |
=(0.067) / (1.003) |
=(0.136) / (1.003) |
=(0.188) / (1.003) |
=(0.224) / (1.003) |
=(0.188) / (1.003) |
=(0.136) / (1.003) |
=(0.067) / (1.003) |
0 |
0 |
0 |
---|
t=T-2 |
=(-0.027) / (0.936) |
=(-0.007) / (0.936) |
=(0.031) / (0.936) |
=(0.067) / (0.936) |
=(0.136) / (0.936) |
=(0.188) / (0.936) |
=(0.224) / (0.936) |
=(0.188) / (0.936) |
=(0.136) / (0.936) |
0 |
0 |
0 |
0 |
---|
t=T-1 |
=(-0.027) / (0.8) |
=(-0.007) / (0.8) |
=(0.031) / (0.8) |
=(0.067) / (0.8) |
=(0.136) / (0.8) |
=(0.188) / (0.8) |
=(0.224) / (0.8) |
=(0.188) / (0.8) |
0 |
0 |
0 |
0 |
0 |
---|
t=T |
=(-0.027) / (0.612) |
=(-0.007) / (0.612) |
=(0.031) / (0.612) |
=(0.067) / (0.612) |
=(0.136) / (0.612) |
=(0.188) / (0.612) |
=(0.224) / (0.612) |
0 |
0 |
0 |
0 |
0 |
0 |
---|
References
Dagum, E.B., and Luati, A. 2009. “A cascade linear filter to reduce revisions and false turning points for real time trend-cycle estimation.” Econometric Reviews 28 (1–3): 40–59.