'Now, here, you see, it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that!' Through the Looking Glass, Lewis Carroll 10. A KALMAN FILTER ESTIMATED MODEL OF WOOL DEMAND; MULTIPLE DEPENDENT AND MULTIPLE EXPLANATORY VARIABLES The purpose of this part of the paper is to bring together all the problems and solutions described above. To: - apply the Kalman filter to the estimation of a model for a completely different commodity. - show how the Kalman filter can be used to draw together information from more than one source. - show how preliminary data and data of varying precision can be treated. - show how a non-constant W can improve forecasting performance. - compare the results with results from OLS. - show how prior information can be incorporated into the estimation process very easily. - discover how sensitive the estimation results are to different V's and W's. 10.1 THE MODEL The model to be estimated is that of Solomon 1980, p.47, modified by lagging the fibre prices, as recommended in Solomon, 1980, p.58. Log(NDC/POP) = A + C log(PCE/POP) + D log(PW) + E log(PS) equation 10.1.1. Where NDC is wool consumption in year t POP is population in year t PCE is consumer expenditure in real terms in year t PW is the price of wool in year t-1 PS is the price of synthetic fibre in year t-1. When this model was estimated using OLS there was strong multicollinearity among the three variables. The treatment in Solomon, 1980 was to put in a restriction on the value of C, by consulting other work on the relationship between total fibre consumption and income. This broke the multicollinearity, and made it possible to estimate a model. But this treatment does not take into account the fact that C is itself only an estimate, and so not known with complete precision. This will affect the calculation of the variances of the estimates of A, D and E. In addition, the estimate of C is not affected by the data to be analysed, and it may well be that there is some information to be extracted on the value of C. Maddala (1971) shows how this can be done and concludes that it is better to estimate equations simultaneously, than to estimate one equation then use the results as a constraint on the other equation. This can be done very easily using the Kalman filter. Log(TFC/POP) = F + C log(PCE/POP) - equation 10.1.2 Where TFC is total fibre consumption C equals the C of equation 10.1.1 We can estimate equation 10.1.1 simultaneously with 10.1.2 by using the Kalman filter with: YT = (log(NDC/POP), log(TFC/POP)) B = (A F C D E) XT = ( 1 0 log(PCE/POP) log(PW) log(PS) ) ( 0 1 log(PCE/POP) 0 0 ) H is the identity We could make the further assumption that D = -E, implying that the wool price elasticity is equal in magnitude but opposite in sign to the synthetic fibre price elasticity. This is, however an unnecessarily restrictive assumption. It was made in chapter 5 above, but then it was necessary to use a very simple model; now we can try a richer model. 10.2 THE DATA AND DATA PRECISION The data come from Solomon, 1980, and are defined and displayed there. They are repeated in appendix F of this paper for convenience. In this appendix, the data run from 1960 to 1978 (with 1959 fibre prices also given). The column headed CPI is the consumer price deflator used to deflate the PCE (consumer expenditure) data. In addition to the data on NDC, POP, PCE, PW, PS and TFC, we will need information on the precision of the NDC and TFC data, to set the V of the Kalman filter. We have several sources of information on this. NDC estimates made at different times for the same year (and by different researchers) differ. The mean percentage error has been calculated, for pre-1970 data, post-1970 data (which is considered to be more accurate) and for preliminary data. Another source of information is an estimate made by Mr. Piercy, a researcher who specialises in calculating wool consumption for various countries. In an internal Wool Secretariat communication dated 13.9.77 he gives estimates of the accuracy of this data, based on his detailed knowledge of the sources of the data and of how it is calculated. We do not need estimates of the precision of the explanatory variables, as the Kalman filter used here assumes that they are known precisely. In chapter 11.5, the possibility of relaxing this assumption is examined. Table 33 COEFFICIENT OF VARIATION OF INDEPENDENT ESTIMATES (%) Estimate by Pre-1970 Post-1970 Preliminary Piercy Belgium 32.3 5.8 7.7 / 4.0 France 5.9 2.8 3.8 / 2.5 Germany 1.9 4.8 6.0 / 1.5 Holland 3.7 6.2 9.9 / 5.0 Italy 3.5 5.9 8.4 / 5.0 Japan 3.0 2.4 4.3 / 2.0 UK 1.2 2.1 2.6 / 1.5 USA 4.4 4.9 5.6 / 1.5 The percentage accuracy for post-1970 and for preliminary data look plausible, but the pre-1970 accuracies look peculiar, especially for Belgium. The apparent better accuracy of pre-1970 data in fact reflects the lack of revision of data from this time; this is because such old data is considered fairly unimportant by the people who prepare data. The very large figure for Belgium reflects a single large change in the way the data is defined. As the pre-1970 data have not been revised recently the estimates of the accuracy of these data are not comparable with the post-1970 data, so we will have to use some other method to estimate the data accuracy before 1970. There are three pieces of information that we could use. These are: - an estimate for 1969 made in 1976; final data - an estimate for 1970 made in 1976; final data - estimates for 1969 and 1970 made in 1972 (i.e., just after the data became available). For Belgium, these are (in thousand tons): 1969 1970 Estimate made in 1976 25 20.3 Estimate made in 1972 16.8 16.3 If we use the estimates made in 1972 to splice the estimates made in 1976, we get a 1969 figure of 20.9. We can then use this figure and the 1976 estimate for 1969 to estimate the standard error as 9.8%. Similar calculations for the other countries give the following results: Table 34 Thousand tons 1972 Estimate 1976 Estimate Spliced Pre-1970 1969 1970 1969 1970 1969 error Belgium 16.8 16.3 25.0 20.3 20.9 13.9 France 45.7 49.3 62.9 54.2 50.2 6.3 Germany 131.4 132.0 135.5 149.9 149.2 8.4 Holland 25.3 23.9 26.8 27.0 28.6 8.2 Italy 64.4 59.3 72.8 67.7 73.5 8.8 Japan 146.9 154.9 159.9 168.7 160.0 5.8 UK 123.2 106.5 122.5 114.2 132.1 4.8 USA 199.6 152.9 209.1 169.5 221.3 6.9 The pre-1970 error was calculated using the formula: Variance = (SUMin (xi-xmean)2)/(n-1) Percentage standard error = 100*(variance)0.5/Data1969 The pre-1970, post-1970 and preliminary data errors derived above are tabulated below, as percentage standard error. Table 35 Revised percentage standard error Pre-1970 Post-1970 Preliminary Belgium 13.9 5.8 7.7 France 6.3 2.8 3.8 Germany 8.4 4.8 6.0 Holland 8.2 6.2 9.9 Italy 8.8 5.9 8.4 Japan 5.8 2.4 4.3 UK 4.8 2.1 2.6 USA 6.9 4.9 5.6 AVERAGE 7.9 4.4 6.0 The post-1970 data can be seen as being most accurate in all countries. In all countries except Holland, the pre-1970 data is less accurate than the preliminary data (the precision of the preliminary data was calculated on post-1970 data). 10.3 THE ESTIMATES OF SOLOMON, 1980 Solomon (1980) estimates the following values for the parameters C, D and E (income elasticity, wool price elasticity and synthetic price elasticity): standard errors are given in brackets. These are repeated below so that they can be compared with the results obtained later in this chapter. Parameters A and F are not given, as they only act as scaling factors. There are no standard errors given for C as the C's were not estimated but imposed as a constraint. Table 36 income wool price synthetic price S.E.E. elasticity elasticity elasticity C D E Belgium 0.77 -.29 (.10) .57 (.06) .101 France 0.71 -.28 (.08) .76 (.07) .086 Germany 0.97 -.32 (.08) .34 (.04) .071 Holland 0.78 -.21 (.10) .68 (.06) .094 Italy 1.03 -.51 (.06) .65 (.08) .103 Japan 0.87 -.36 (.12) .50 (.07) .126 UK 0.97 -.59 (.07) .66 (.12) .120 USA 1.08 -1.01 (.19) 1.02 (.13) .228 AVERAGE .90 -.45 .65 .116 The standard error of the estimates (SEE) is given as an indication of the forecasting accuracy of the model. It must be stressed, however, that this is very different from the dynamic sum of squared errors (DSSE) used elsewhere in this paper. The DSSE for this model were calculated for the OLS estimation, by running regressions over 15,16,17 and 18 observations, forecasting one period ahead, calculating the error, and cumulating the squared errors. Table 37 DSSE RMDSSE Belgium .0223 .0747 France .0170 .0652 Germany .0047 .0343 Holland .0915 .1512 Italy .1453 .1906 Japan .2181 .2335 UK .2767 .2630 USA .8114 .4504 AVERAGE .1984 .1829 It can be seen from the rest of this chapter that the average DSSE from an OLS-estimated model is worse than any of the Kalman filter-estimated models. The RMDSSE (root mean dynamic sum of squared errors, the square root of (DSSE/number of observations)) is 58% worse than the standard error of estimates, SEE (which is calculated as the root mean of the squared errors). This shows the difference between forecasting with and without benefit of hindsight. 10.4 THE MODEL WITH W = O The model is first estimated with W = O, as this is the nearest Kalman filtering equivalent to ordinary least squares. The model was estimated with three different sets of Vt, to demonstrate the effect of variable data precision and the effects of preliminary data. 10.4.1 V SET TO POST-1970 VALUES For the estimates below, V was set to the values given in the post-1970 column of the last table of section 10.2 above. Table 38 income wool price synthetic price DSSE elasticity elasticity elasticity C D E Belgium .733 (.06) -.285 (.06) .553 (.05) .0225 France .637 (.03) -.269 (.03) .721 (.03) .0147 Germany .815 (.05) -.319 (.05) .269 (.04) .0036 Holland .269 (.06) -.172 (.06) .389 (.05) .0894 Italy .656 (.05) -.379 (.04) .418 (.06) .0782 Japan .704 (.01) -.318 (.02) .367 (.02) .1775 UK .086 (.05) -.471 (.01) .436 (.03) .2057 USA .957 (.07) -.988 (.04) .989 (.03) .8281 AVERAGE .607 -.400 .518 .1775 The parameter estimates are all correctly signed and significant at the 95% level (except the UK income elasticity, C), and are all plausible in magnitude. In some countries (Belgium, France, Germany, USA) the parameters do not differ very much from the estimates of Solomon, 1980. In other countries (Holland, Italy, Japan, UK) there are some substantial differences. The average DSSE (across the 8 countries) is 0.1775. The DSSE was reduced in 6 of the 8 cases, and was increased only slightly in the other two (compared with table 37). Table 39 Percentage difference in parameters compared with Solomon, 1980 C D E Belgium -5 -2 -3 France -10 -4 -5 Germany -16 0 -21 Holland -66 -18 -43 Italy -46 -26 -36 Japan -19 -12 -27 UK -91 -20 -34 USA -11 -2 -3 There are particularly great differences in the income elasticity for Holland (0.27 compared with 0.78 in Solomon, 1980), and the income elasticity for the UK (0.09 compared with 0.97 in Solomon, 1980). The reason for this is that Solomon, 1980, assumes that the income elasticity is 0.78 and 0.97 for Holland and the UK respectively (based on previous work on total fibre consumption), whereas this paper is making the same assumption about income elasticity (that wool income elasticity equals the total fibre income elasticity) but is estimating that income elasticity simultaneously with estimating the other parameters rather than constraining the income elasticity to some fixed number. The income elasticities used for Holland and UK in Solomon (1980) are not in fact estimated on fibre consumption but on consumer expenditure on clothing. The reasons why these were used are discussed in Solomon (1980), and the income elasticities of fibre consumption are also given; they are 0.23 (Holland) and 0.39 (UK). The figure of 0.23 is quite close to the figure of 0.27 estimated by the Kalman filter, and the figure of 0.39 is much closer to the Kalman filter estimate of 0.09. The income elasticity result for the UK does, however, seem implausible when compared to other countries and when compared to estimates made elsewhere (see Hughes, 1976). Inspection of the data (see appendix F) reveals that over the examined time period, total fibre consumption in the UK did not show any strong upward time trend, while deflated income per head did. If the income elasticity was indeed significantly different from zero, there must have been other factors (such as the real price of clothing) which prevented fibre consumption from rising. 10.4.2 V SET TO VALUES FOR FINAL DATA For the estimates below, V was set to the values given in the pre-1970 and post-1970 columns of the last table of section 10.2 above (W still set to zero). Table 40 income wool price synthetic price DSSE elasticity elasticity elasticity C D E Belgium .734 (.10) -.241 (.06) .566 (.08) .0289 France .663 (.04) -.240 (.03) .720 (.05) .0216 Germany .836 (.07) -.308 (.05) .279 (.05) .0065 Holland .254 (.07) -.178 (.06) .365 (.06) .0866 Italy .626 (.06) -.356 (.04) .400 (.07) .0797 Japan .629 (.03) -.262 (.02) .267 (.03) .1771 UK .016 (.08) -.409 (.02) .254 (.04) .1870 USA .802 (.09) -.931 (.04) .957 (.04) .7297 AVERAGE .570 -.366 .476 .1646 The effect of telling the Kalman filter that the old data are less accurate is that they will have less influence on the parameter estimates. The parameter estimates are still all correctly signed and significant at the 95% confidence level (except the UK income elasticity). Most of the parameter estimates are very close to the estimates of 10.4.1, but there is a statistically significant difference (more than two standard deviations) in the following: Income elasticity in Japan and USA Wool price elasticity in Japan and UK Synthetic price elasticity in Japan and UK The average DSSE (averaged over the eight countries) is .1646; this is 7% better than the DSSE of 10.4.1. This supports the contention (which is made throughout this paper) that when data are of variable precision, it is best to recognise this fact and to allow for it. 10.4.3 V SET TO VALUES FOR FINAL AND PRELIMINARY DATA For the estimates below, V was set to the values given in the last table of 10.2 above for pre-1970 data, post-1970 data and preliminary data; W is still set to zero. Table 41 C D E DSSE Belgium .733 (.11) -.241 (.06) .578 (.08) .0289 France .661 (.04) -.240 (.03) .718 (.05) .0216 Germany .833 (.07) -.308 (.05) .275 (.05) .0065 Holland .252 (.07) -.180 (.06) .380 (.06) .0866 Italy .629 (.06) -.349 (.04) .404 (.07) .0797 Japan .629 (.03) -.247 (.02) .251 (.03) .1771 UK .009 (.08) -.407 (.02) .256 (.04) .1870 USA .809 (.09) -.918 (.04) .961 (.04) .7297 AVERAGE .569 -.361 .478 .1646 The parameter estimates are barely different from those of 10.4.2. (V set to values for final data). This is because we have changed the observation error attached to only one out of 19 observations. None of the parameter estimates have a statistically significant difference from the estimates of 10.4.2 and the DSSE have not changed at all. This is to be expected; none of the errors are different as the estimation process is identical until the last observation, and so all the forecasts are the same. When we re-estimate the model with non-zero W (this is done later in this chapter) this will have the effect of increasing the importance of more recent observations, compared to older ones, and so the greater precision of the preliminary data could be expected to have more effect on the final parameter estimates. But even with zero W's recognition of the greater imprecision of preliminary data has some effect. If we compare the constant, A, estimated in 10.4.2 with that of 10.4.3 we see:- Table 42 10.4.2 estimates 10.4.3 estimates Difference Belgium 1.892 (.24) 1.869 (.24) .023 France 1.881 (.19) 1.875 (.19) .006 Germany 5.076 (.32) 5.070 (.33) .006 Holland 1.802 (.34) 1.767 (.35) .035 Italy -.065 (.50) -.142 (.52) .077 Japan .809 (.23) .802 (.23) .007 UK .965 (.54) .919 (.56) .046 USA 5.064 (.50) 5.089 (.50) -.025 The difference between the estimates of the constant A, represents the log difference of wool consumption (as the model is log-log). For example, this difference is 2.3% in Belgium. So the recognition of the lower precision of the preliminary data will have a non-negligible effect on wool consumption forecasts. 10.5 THE MODEL WITH W =/ 0 10.5.1 W = 10-_7_, 10-_6_, 10-_5_, 10-_4_, 10-_2_ With W = 10-7 on its main diagonal and 0 elsewhere, there is very little difference in the parameter estimates or in the DSSE. The average DSSE across the eight countries is 0.1754 for V set to post-1970 values (compared with 0.1775 in 10.4.1 above, when W = 0) and 0.1629 for V set to values for final and preliminary data (compared to 0.1646 in 10.4.3 above, where W = 0). Clearly W = 10-7 is too small to have any appreciable effect. With W = 10-6 and V set to values for final and preliminary data, the average DSSE was 0.1519 (compared with 0.1646 when W = 0, a 7% improvement). With W = 10-5 and V set to values for final and preliminary data, the average DSSE was 0.1216 a 26% improvement over W = 0. With W = 10-5 and V set to post-1970 values, the average DSSE is 0.1240, a 30% improvement over the corresponding value when W = 0. Note, however, that the recognition of the variable precision of the data still results in an improvement in the forecasting ability of the model of 2%. With W = 10-4 and V set to values for final and preliminary data, the average DSSE was 0.0856, a 48% improvement over W = 0. With W = 10-4 and V set to post-1970 values, the average DSSE was 0.0839, a 53% improvement over the value when W = 0. The recognition of the variable precision of the data gives a 2% worsening in DSSE. With W = 10-2 there were a lot of wrongly signed parameters, which indicates that the Kalman filter is being allowed to "forget" old information too fast. 10.5.2 W = ALL 10-3 The average DSSE when V is set to values for final and preliminary data is 0.0646, an improvement of 61% on the DSSE for W = 0. When V is set to values for post-1970 data, tha average DSSE is .0624, an improvement of 65% over the corresponding figure when W = 0. The parameter estimates and standard errors (in brackets) are reported below for V set to values for final and preliminary data. Table 43 C D E DSSE Belgium .826 (.56) -.154 (.14) .473 (.30) .0244 France .629 (.75) -.219 (.13) .448 (.30) .0216 Germany .589 (.84) -.228 (.14) .258 (.29) .0056 Holland .181 (.82) -.127 (.15) .042 (.31) .0654 Italy .723 (.19) -.193 (.32) .219 (.56) .0400 Japan 1.006 (.19) -.049 (.34) .088 (.61) .0461 UK .012 (.93) -.206 (.08) .331 (.18) .0980 USA .523 (.97) -.488 (.11) .662 (.17) .2158 AVERAGE .561 -.208 .315 .0646 This can be compared with the table in 10.4.3 above, and several points can be made. The only difference between these results and the results of 10.4.3 is the change of W from 0 to 10-3. 10.5.2.1 SOME PARAMETERS HAVE DRIFTED Some of the parameters (for example, those for the USA) are very different, some are not (C and D for France). This indicates that some of the parameters have drifted substantially over the estimation period, and others have not. 10.5.2.2 THE STANDARD ERRORS ARE LARGER All of the standard errors are much larger (which is to be expected, as in this estimation the older data is being treated as much less relevant). But in six out of eight countries, the standard error attached to C is very much greater than the standard errors attached to D and E (which was not the case in 10.4.3). This argues that the most recent data carry very little information about C. This is probably partly because in the post-1973 period incomes have grown very little, and so there is very little information from this period about income elasticities; another reason is that the 1960 - 1972 period saw a substantial change in incomes, and so the income elasticities can be estimated from then, whereas fibre prices moved more or less in a straight line over this period, and so the data carry little information about price elasticities until the large price changes of 1972 and after. 10.5.2.3 THE INCOME ELASTICITIES ARE MORE STABLE THAN THE PRICE ELASTICITIES The average income elasticity (0.561) is very similar to the average of 10.4.3 (0.569), and the individual income elasticities are not very different from those of 10.4.3. The average price elasticities are much smaller (-.208 and .315 compared with -.361 and .478). This is not solely because of the large drop in the USA elasticities, as the corresponding averages excluding the USA are -.168 and .266 (for 10.5.2) compared with -.281 and .409 (for 10.4.3). So we can conclude that the price elasticities have changed substantially over the estimation period, to a far greater extent that the income elasticities. 10.5.2.4 THE FORECASTS ARE GOOD The average dynamic sum of squared errors is much smaller than the DSSE of 10.4.3; .0646 compared with .1646, an improvement of 61%. Much of this improvement comes from the USA, but all eight countries show some improvement. Looking at individual countries, we get: Table 44 DSSE from 10.5.2 DSSE from OLS Belgium .0244 .0223 France .0216 .0170 Germany .0056 .0047 Holland .0654 .0915 Italy .0400 .1453 Japan .0461 .2181 UK .0980 .2767 USA .2158 .8114 AVERAGE .0646 .1984 The Kalman filter gives, on average, much better forecasts than OLS; this comes from the improvement in those countries where OLS performed badly. 10.5.2.5 THE PARAMETERS ARE STILL GOOD The parameters are still all correctly signed (when W is set to 10-2, this is no longer the case), but now only 5 out of 24 are more than two standard deviations away from zero, compared with 23 out of 24 when W was zero. This is as expected, as when we assume that parameters can drift, we would expect to discover less about them than if we make the very strong assumption that they are constant. Thus, the low standard errors (high t-values) that we have come to expect of an econometric model can only be obtained by using the strong prior information that the parameters are constant. This assumption is, in most cases, very difficult to justify, and it is possible that the assumption is made because it is necessary to make it before any econometric estimation can be attempted, and that without the assumption of constant parameters, econometricians would be forced to admit to a rather greater ignorance of the world than they claim. Perhaps parameters are constantly drifting, and the assumption that they are not means that if a model is estimated over the last twenty years, then the parameters have been measured at a time (on average) 10 years ago. Using this parameter estimate to forecast forward 10 years would mean that it would be 20 years out of date by the end of the period. There are various papers that examine the stability of parameters (for example Berg, 1973 has several papers). But in a great deal of empirical work, constant parameters are simply assumed. The assumption of constant parameters is one that should be more carefully justified (many papers do not even try to justify it as an assumption, or even to show after the analysis that it is not contradicted by the information in the data). The larger standard errors produced by the Kalman filter with non-zero W do not mean that the Kalman filter produces less accurate answers, but that the Kalman filter is able to relax the assumption of constant parameters, and so produce more realistic standard errors that better reflect our state of ignorance about parameters that change from year to year.