• Nenhum resultado encontrado

Other Distributions

No documento Applying Generalized Linear Models (páginas 109-114)

5.2 Markov Processes

5.2.2 Other Distributions

Random Walks

In autoregressive models,ρ < 1 if the situation is not rapidly to become explosive. Otherwise, the series isnonstationary. A case of special interest occurs whenρ= 1. Let us write Equation (5.2) in still another way:

µt|t−1−ρyt−1 =

i

βixit

i

ρβixi,t−1

=

i

βi(xit−ρxi,t−1)

With ρ = 1, we are fitting successive differences, between the expected response and the previous one and between values of the explanatory vari-ables. This is called first differencing. It implies that differences between successive responses will be stationary and, hence, is often used in an at-tempt to eliminate nonstationarity. The model, for the original response, not the differences, is known as a random walk; it is a generalized linear model becauseρis now known. Obviously, any explanatory variables that are not changing over time will drop out of the model when first differences are taken.

0 2 4 6 8 10

Log count

1820 1844 1868 1892 1916 1940

Year

AR(2)

AR(2) with delay

FIGURE 5.2. Gamma AR(2) models for the lynx data of Table 5.3.

Example

We continue with our example of lynx trappings. Among possible distribu-tions, we see from Table 5.4 that the gamma distribution with a log link fits better than the log normal. Although these are count data, the Pois-son model fits extremely poorly and, in fact, would require a higher-order autoregression. On the other hand, the negative binomial, fitted by plotting a normed profile likelihood of values of the power parameter (Section 1.5.2), is competitive, indicating the presence of substantial overdispersion.

For the gamma distribution with a log link, the estimated delay model is log(µt) = 1.47 + 1.23xt−10.40xt−2

whenxt−21800 and

log(µt) = 4.98 + 1.46xt−11.11xt−2

when xt−2 > 1800. The models for the gamma distributions, with and without threshold, are plotted in Figure 5.2. We see that the extremely large and small values are not well followed by the models.

In many respects, this has been an academic model fitting exercise, as is often the case with this data set. There does not appear to be any theoretical reason why such count data would follow a gamma distribution. We shall never be able to disaggregate the events to know the timings of individual trappings, and this probably would not make much sense anyway because they occurred over a vast geographical area. Thus, we should perhaps look for more reasonable models in the direction of compound distributions other

than the negative binomial. However, we may have isolated one interesting biological aspect of the phenomenon, the impact of trapping pressure two

years before. 2

Autoregression

In Equation (5.2), we saw how the current mean could be made to depend on the previous (fitted value) residual. When the distribution used in the model is not normal, several types of residuals are available (Section B.2).

Thus, we can define an autoregression by µt|t−1=ρˆεt−1+

i

βixit (5.3)

where ˆεt−1 is an estimated residual from the previous time period. Be-cause this residual is a function of the regression coefficients,β, the model is nonlinear and requires extra iterations as compared to standard IWLS for generalized linear models. (The likelihood function is very complex.) However, estimation of this model can easily be implemented as an addi-tional loop in standard generalized linear modelling software. Here, we shall use the deviance residuals.

Example

Beveridge (1936) gives the average rates paid to agricultural labourers for threshing and winnowing one rased quarter each of wheat, barley, and oats in each decade from 1250 to 1459. These are payments for performing the manual labour of a given task, not daily wages. He obtained them from the rolls of eight Winchester Bishopric Manors (Downton, Ecchinswel, Overton, Meon, Witney, Wargrave, Wycombe, Farnham) in the south of England.

As well, he gives the average price of wheat for all of England, both as shown in Table 5.5. All values are in money of the time (pence or shillings), irrespective of changes in the currency: in fact, silver content was reduced five times (1300, 1344, 1346, 1351, and 1412) during this period.

Interestingly, at first sight, the Black Death of the middle of the fourteenth century seems to have had little effect. Beveridge (1936) states that, for the first 100 years of the series, the labourers’ wages seemed to follow the price of wheat, but this is difficult to see for the rates plotted in Figure 5.3. He suggests that, during this period, such payments may only have been a substitute for customary service or allowances in kind, so that they were closely related to the cost of living. In the second part of the series, a true market in labour had begun to be established.

We shall consider models with the normal, gamma, and inverse Gaussian distributions, each with the identity and log links. Because we shall be looking at lagged values of the two variables, we weight out the first value.

However, we should not expect strong relations with previous values because

TABLE 5.5. Rates (pence) for threshing and winnowing and wheat prices (shil-lings per quarter) on eight Winchester manors. (Beveridge, 1936)

Agricultural Wheat

Decade rate price

1250– 3.30 4.95

1260– 3.37 4.52

1270– 3.45 6.23

1280– 3.62 5.00

1290– 3.57 6.39

1300– 3.85 5.68

1310– 4.05 7.91

1320– 4.62 6.79

1330– 4.92 5.17

1340– 5.03 4.79

1350– 5.18 6.96

1360– 6.10 7.98

1370– 7.00 6.67

1380– 7.22 5.17

1390– 7.23 5.45

1400– 7.31 6.39

1410– 7.35 5.84

1420– 7.34 5.54

1430– 7.30 7.34

1440– 7.33 4.86

1450– 7.25 6.01

these are ten-year averages. The plot of yearly rates published by Beveridge shows more discontinuity, especially from 1362 to 1370 (but he does not provide a table of these individual values). He interprets the irregularities in this decade as an (unsuccessful) attempt by William of Wykeham to reduce wages to their former level.

For a model with rates depending only on current wheat prices, RESIDUAL+WHEAT

the normal distribution with an identity link, a classical autoregression model, fits best with an AIC of 249.7. Nevertheless, all of the models are fairly close, the worst being the gamma with log link that has 255.4. A normal model for dependence of rates on wheat prices, without the autore-gression on the residuals, has an AIC of 265.3, showing the dependence over time. However, the need for regression on the residuals, here and be-low, probably arises because we have an inadequate set of explanatory vari-ables. Adding dependence on wheat prices in the previous decade does not improve the model.

0 2 4 6 8 10

Pence

1250 1290 1330 1370 1410 1450

Decade

Observed rate Wheat price Gamma AR model Inverse Gaussian conditional AR model

FIGURE 5.3. Plot of the labouring rates and wheat prices for the data of Table 5.5.

If we add a variable for the change due to the Black Death, at about 1370, RESIDUAL+WHEAT+WHEAT1+BDEATH

the picture alters considerably. The gamma distribution with identity link now fits best (AIC 221.9 — a model with the break one decade earlier fits almost as well). In this model, the mean rate depends on present and lagged wheat prices, with a different intercept before and after this date.

However, the dependence of the rate on wheat prices does not change at the break. In other words, there is no need for an interaction between the break indicator and these variables. The mean rate jumped up by an estimated three pence at this date, perhaps as an aftereffect of the Black Death. The dependence on the current and lagged wheat prices is almost identical, with coefficients of 0.25. This model is shown in Figure 5.3. We see that it does not follow the agricultural rate series very closely, but is irregular, like the wheat price series. Of course, the only information allowing prediction of changes in rate, besides the overall change in mean arising from the break variable, comes from these prices.

If we take into account the rate in the previous decade, we obtain a considerably better fit. Here, the previous wheat price is also necessary, but the break variable is not, so that there are three explanatory variables in the model (the current wheat price and the previous rate and wheat price),

RESIDUAL+LAG1+WHEAT+WHEAT1

that is, the same number as in the previous model (lagged rate replacing the break variable). The inverse Gaussian distribution with identity link

fits best, with an AIC of 169.2. (The normal model now has 171.5 and the gamma 169.8.) As might be expected, current rates depend most strongly on previous rates, but about four times as much on previous wheat price as on the current one. This conditional model is also plotted in Figure 5.3.

It follows much more closely the agricultural rates, as would be expected.

In all of these models, we have not directly taken into account the time trend in the rate. We can do almost as well as the previous model with two simple regression lines on time, before and after the break due to the Black Death. In contrast to all of the previous models, here the autoregression on the residuals is not necessary:

YEARBDEATH

The best model is the normal distribution with a log link (AIC 174.3). The two regression models are

log(µt) = 1.02 + 0.06103t, t≤12 log(µt) = 1.92 + 0.00342t, t >12

This model can be only slightly improved by adding the logged rate, de-pendence on wheat prices not being necessary. 2 This example shows how distributional assumptions can be very depend-ent on the type of dependence incorporated in the regression model.

No documento Applying Generalized Linear Models (páginas 109-114)