Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Unemployment rate, Inflation, and Federal Funds Rate Example

Unemployment rate, Inflation, and Federal Funds Rate Example

Consider the three time series downloaded from FRED: UNRATE (Unemployment Rate; monthly), PCEPI (PCE Price Index;monthly), FEDFUNDS (monthly). We shall fit a VAR model to these time series (after differencing the PCEPI dataset).

All these are monthly datasets; but the months for which data is available differs among the three datasets.

Unemployment rate
observation_date
1948-01-01    3.4
1948-02-01    3.8
1948-03-01    4.0
1948-04-01    3.9
1948-05-01    3.5
Name: UNRATE, dtype: float64
observation_date
2026-06-01    4.2
2026-07-01    4.1
2026-08-01    4.1
2026-09-01    4.2
2026-10-01    4.1
Name: UNRATE, dtype: float64

PCE price index
observation_date
1959-01-01    15.164
1959-02-01    15.179
1959-03-01    15.189
1959-04-01    15.219
1959-05-01    15.227
Name: PCEPI, dtype: float64
observation_date
2026-05-01    131.241
2026-06-01    131.106
2026-07-01    131.187
2026-08-01    131.611
2026-09-01    132.257
Name: PCEPI, dtype: float64

Federal funds rate
observation_date
1954-07-01    0.80
1954-08-01    1.22
1954-09-01    1.07
1954-10-01    0.85
1954-11-01    0.83
Name: FEDFUNDS, dtype: float64
observation_date
2026-06-01    3.63
2026-07-01    3.63
2026-08-01    3.63
2026-09-01    3.75
2026-10-01    3.88
Name: FEDFUNDS, dtype: float64

Below we plot the three series.

<Figure size 1100x700 with 3 Axes>

For the VAR, we shall work with y1=UNRATEy1 = \text{UNRATE}, y2=1200∗(log⁡PCEPIt−log⁡PCEPIt−1)y2 = 1200*(\log \text{PCEPI}_t - \log \text{PCEPI}_{t-1}) and y3=FEDFUNDSy3 = \text{FEDFUNDS}. We will keep the data from February 1959 to September 2025 (Unemployment rate seems to be missing for October 2025; so we will limit our data to September 2025). y2y_2 represents inflation rate; so it is a natural variable to study along with unemployment rate and the federal funds interest rate.

                   y1        y2    y3
observation_date                     
1959-02-01        5.9  1.186435  2.43
1959-03-01        5.6  0.790306  2.80
1959-04-01        5.2  2.367799  2.96
1959-05-01        5.1  0.630625  2.90
1959-06-01        5.0  3.462525  3.39
800 months

Below is the plot of y1, y2, y3.

<Figure size 1200x700 with 3 Axes>

We now fit the VAR(1) model to the data, using the VAR function from statsmodels.

Estimate of the intercept: [0.16227219 0.21917971 0.15176785]
Estimate of A1:
[[ 0.96798842 -0.01261336  0.01337334]
 [ 0.0523748   0.59286271  0.16276692]
 [-0.02385082  0.02900276  0.97857246]]

The fitted VAR(1) equations are

y1,t=0.16227219+0.96798842 y1,t−1−0.01261336 y2,t−1+0.01337334 y3,t−1+e1,t,y2,t=0.21917971+0.05237480 y1,t−1+0.59286271 y2,t−1+0.16276692 y3,t−1+e2,t,y3,t=0.15176785−0.02385082 y1,t−1+0.02900276 y2,t−1+0.97857246 y3,t−1+e3,t.\begin{aligned} y_{1,t} &= 0.16227219 + 0.96798842\,y_{1,t-1} - 0.01261336\,y_{2,t-1} + 0.01337334\,y_{3,t-1} + e_{1,t}, \\ y_{2,t} &= 0.21917971 + 0.05237480\,y_{1,t-1} + 0.59286271\,y_{2,t-1} + 0.16276692\,y_{3,t-1} + e_{2,t}, \\ y_{3,t} &= 0.15176785 - 0.02385082\,y_{1,t-1} + 0.02900276\,y_{2,t-1} + 0.97857246\,y_{3,t-1} + e_{3,t}. \end{aligned}

The third equation can be rewritten as follows (note 1−0.97857246=0.021427541-0.97857246=0.02142754) $$ \begin{aligned} y_{3,t} - y_{3,t-1} &= 0.15176785 - 0.02385082,y_{1,t-1} + 0.02900276,y_{2,t-1}

  • 0.02142754,y_{3,t-1} \ &= 0.02142754 \left( \frac{0.15176785 - 0.02385082,y_{1,t-1} + 0.02900276,y_{2,t-1}} {0.02142754}

  • y_{3,t-1} \right) \ &\approx 0.02142754 \left( 7.08284 - 1.11309,y_{1,t-1} + 1.35353,y_{2,t-1} - y_{3,t-1} \right). \end{aligned} $$

The model predicts that each month the federal funds rate closes about 2.14%2.14\% of the gap between last month’s rate and the target or reference rate 7.08284−1.11309 y1,t−1+1.35353 y2,t−17.08284 - 1.11309\,y_{1,t-1} + 1.35353\,y_{2,t-1}.

Here is more intuition behind the target rate equation:

target interest rate=7.083−1.113 y1,t−1+1.354 y2,t−1.\text{target interest rate} = 7.083 - 1.113\,y_{1,t-1} + 1.354\,y_{2,t-1}.

The two coefficients capture the main intuition behind the Fed’s interest rate decisions.

  • Higher inflation raises the target rate. Holding unemployment fixed, a one-percentage-point higher inflation reading raises the target by about 1.35 percentage points. Higher interest rates make borrowing more expensive, which can slow spending and ease upward pressure on prices.

  • Higher unemployment lowers the target rate. Holding inflation fixed, a one-percentage-point higher unemployment rate lowers the target by about 1.11 percentage points. Lower interest rates can encourage households to spend and businesses to invest, supporting demand and hiring.

The target tells us which way the model predicts the funds rate will move. If last month’s funds rate was below the target, the model predicts an increase. If it was above the target, the model predicts a decrease. The adjustment is gradual: the predicted change closes about 2.14% of the gap in one month.

We call this target model-implied because it is inferred from historical data. The Fed sets its official target range using a broader assessment of the economy.

As a simple example, suppose last month’s unemployment rate was 5% and annualized monthly PCE inflation was 2%. Then the model-implied target for the federal funds rate is 4.22%, using the more precise coefficient estimates calculated as 7.08284−1.11309(5)+1.35353(2)≈4.22%7.08284 - 1.11309(5) + 1.35353(2) \approx 4.22\%. If last month’s federal funds rate was below this reference rate, the VAR predicts an increase this month. If it was above this reference rate, the VAR predicts a decline.

The Inflation Equation

Let us now consider the second equation (for inflation)

y2(t)=0.21917971+0.05237480 y1(t−1)+0.59286271 y2(t−1)+0.16276692 y3(t−1)+e2(t).y_2(t) = 0.21917971 + 0.05237480\,y_1(t-1) + 0.59286271\,y_2(t-1) + 0.16276692\,y_3(t-1) + e_2(t).

The coefficient of y3(t−1)y_3(t-1) is positive, which seems to suggest that an increase in the federal interest rate leads to an increase in inflation as opposed to a decrease.

Below, let us fit a regression for y2(t)y_2(t) on y3(t−p)y_3(t-p) for a fixed pp, without the other terms y1(t−1),y2(t−1)y_1(t-1), y_2(t-1). Even here, we see positive coefficients (for all pp).

const    1.206813
y3       0.416884
dtype: float64

Below we plot the estimated coefficients for the regression of y2(t)y_2(t) on y3(t−p)y_3(t-p) for each fixed value of pp.

<Figure size 1000x400 with 1 Axes>

It is clear that the coefficient is positive for all values of p=1,…,20p = 1, \dots, 20.

Inflation after a federal funds rate shock (Impulse Response)

For the fitted VAR(1) model, we can check how a one-time, one-percentage-point shock to FEDFUNDS changes predicted inflation hh months later, compared with the forecast from the same starting values with no shock. This is called impulse response analysis.

The idea here is that it is technically possible for inflation to come down a few months after the interest rate increase, instead of immediately after. Impulse response analysis shows that this is not the case in this problem.

The impulse response analysis can be computed in two ways. One is to use the statsmodels function irf. The other is to take the fitted VAR(1) coefficient matrix AA, and then compute recursively AhA^h. After hh months, the responses of unemployment, inflation, and the federal funds rate (to the federal funds rate shock) are the three components of Ah(0,0,1)⊤A^h(0,0,1)^\top. Since inflation is the second variable, its response is the second component, (Ah)2,3(A^h)_{2,3}, measured in percentage points of annualized monthly PCE inflation.

The plot below shows this inflation response for h=0,…,24h=0,\ldots,24. The line is computed from the matrix powers, and the circles are computed by statsmodels. They agree up to numerical precision.

Largest absolute difference = 5.551115123125783e-17
Match within tolerance = True
<Figure size 900x400 with 1 Axes>

The impulse responses are all positive, which shows that, for the fitted VAR(1) model, the inflation is predicted to go up even after multiple months following an interest rate spike.

This pattern is sometimes called the price puzzle. The Fed raises interest rates to cool demand and bring inflation down over time. Yet in our fitted VAR(1), a one-percentage-point upward shock to the federal funds rate predicts higher subsequent inflation. Twelve months after the shock, the forecast for annualized monthly PCE inflation is about 0.36 percentage points above the no-shock forecast.

One possible explanation is that the Fed sees inflationary pressures building before they show up in the data used by the VAR. A rate hike can then signal that higher inflation is coming, even if the hike itself keeps inflation lower than it otherwise would have been.

This can be easily illustrated with a simple toy example.

Bike Example (Speed and Braking while Biking downhill)

We simulate a cyclist riding downhill for nn seconds, indexed by t=1,…,nt = 1, \ldots, n. For each second tt, we record three quantities.

  • VtV_t is the cyclist’s speed at the beginning of second tt.

  • BtB_t is the amount of speed removed by braking during second tt.

  • GtG_t is the amount of speed the cyclist would gain from gravity during second tt if they coasted. A steeper downhill slope gives a larger GtG_t.

Since the first second is labeled t=1t = 1, we write the starting speed as V1=10V_1 = 10. We simulate the ride according to

Gt∼i.i.d.Unif⁡(0.04,0.12),Bt=0.5Gt+ηt,Vt+1=Vt−Bt+Gt,\begin{aligned} G_t &\overset{\mathrm{i.i.d.}}{\sim} \operatorname{Unif}(0.04, 0.12), \\ B_t &= 0.5G_t + \eta_t, \\ V_{t+1} &= V_t - B_t + G_t, \end{aligned}

where the ηt\eta_t are independent draws from Unif⁡(−ϵ,ϵ)\operatorname{Unif}(-\epsilon, \epsilon), independent of the sequence (Gt)(G_t). We use ϵ=0.001\epsilon = 0.001.

The braking rule Bt=0.5Gt+ηtB_t = 0.5G_t + \eta_t describes how the cyclist responds to the slope of the hill. The cyclist brakes harder on steeper stretches, aiming to cancel about half the speed they would gain by coasting. On a gentle stretch where gravity would add 0.06 units of speed, braking removes about 0.03. On a steeper stretch where gravity would add 0.10, braking removes about 0.05. The term ηt\eta_t allows for small variations in how firmly the cyclist applies the brakes. In the second example, the amount removed can range from 0.049 to 0.051.

The speed equation Vt+1=Vt−Bt+GtV_{t+1} = V_t - B_t + G_t says that the cyclist starts the second at speed VtV_t, loses BtB_t from braking, and gains GtG_t from gravity.

The simulation gives nn observations (Vt,Bt,Gt)(V_t, B_t, G_t) for t=1,…,nt = 1, \ldots, n. In the last observation, VnV_n is the speed at the beginning of the final second. The last update gives the finishing speed Vn+1V_{n+1}.

Below we plot the three time series Vt,Bt,GtV_t, B_t, G_t.

<Figure size 1200x700 with 3 Axes>

Suppose we observe only speed and braking. Below we perform a regression of VtV_t on Vt−1V_{t-1} and Bt−1B_{t-1}.

V_t regression
  Intercept  -0.00053  (SE 0.00099)
  V[t-1]      1.00012  (SE 0.00008)
  B[t-1]      0.97961  (SE 0.00878)

The fitted regression equation is:

Vt=Vt−1+0.98Bt−1+errort\begin{align*} V_t = V_{t-1} + 0.98 B_{t-1} + \text{error}_t \end{align*}

A naive interpretation of the coefficient 0.98 on Bt−1B_{t-1} is that, for a given starting speed Vt−1V_{t-1}, braking harder causes the cyclist to go faster one second later. This is the opposite of what we expect braking to do. The surprising positive sign parallels the price puzzle in monetary policy, with braking playing the role of the interest rate and speed playing the role of the inflation rate.

The regression holds the starting speed Vt−1V_{t-1} fixed, but it leaves out the slope of the hill. Since the cyclist brakes harder on steeper stretches, observing more braking also tells us that gravity probably contributed a larger gain in speed during that second.

To see this algebraically, the braking rule Bt−1=0.5Gt−1+ηt−1B_{t-1} = 0.5G_{t-1} + \eta_{t-1} gives

Gt−1=2Bt−1−2ηt−1≈2Bt−1.G_{t-1} = 2B_{t-1} - 2\eta_{t-1} \approx 2B_{t-1}.

The change from Vt−1V_{t-1} to VtV_t occurs during second t−1t-1, so we use the braking and gravity terms from that second. Substituting into the speed equation gives

Vt=Vt−1−Bt−1+Gt−1=Vt−1+Bt−1−2ηt−1≈Vt−1+Bt−1.\begin{aligned} V_t &= V_{t-1} - B_{t-1} + G_{t-1} \\ &= V_{t-1} + B_{t-1} - 2\eta_{t-1} \\ &\approx V_{t-1} + B_{t-1}. \end{aligned}

This explains why the fitted coefficient on Bt−1B_{t-1} is close to +1. Across stretches of the hill, an additional 0.01 units of speed removed by braking typically goes along with about 0.02 units of additional speed gained from gravity. The cyclist therefore gains about 0.01 more speed on the steeper stretch, even after braking harder.

On a fixed slope, the comparison is different. With Vt−1V_{t-1} and Gt−1G_{t-1} held fixed, any additional braking reduces VtV_t by exactly the amount of speed removed. Including Gt−1G_{t-1} in the regression recovers this coefficient of -1 on braking.

Below we regress VtV_t on Vt−1,Bt−1,Gt−1V_{t-1}, B_{t-1}, G_{t-1}. In this case, the effect of braking on speed is correctly recovered.

V_t regression
  Intercept  -0.00000  (SE 0.00000)
  V[t-1]      1.00000  (SE 0.00000)
  B[t-1]     -1.00000  (SE 0.00000)
  G[t-1]      1.00000  (SE 0.00000)

Another scenario in which the braking effect would be correctly recovered is if braking does not follow the very specific rule Bt≈Gt/2B_t \approx G_t/2 and instead if it were random.

V_t regression
  Intercept   0.06334  (SE 0.00880)
  V[t-1]      1.00178  (SE 0.00158)
  B[t-1]     -0.66423  (SE 0.18756)

This gives Vt=0.063+Vt−1−0.66Bt−1V_t = 0.063 + V_{t-1} - 0.66 B_{t-1} so the sign corresponding to Bt−1B_{t-1} is correct. If the sample size is larger, we will get a more accurate estimate of the coefficient (closer to -1). Go back and increase nn to say n=1200n = 1200 and re-run the code.

To summarize this example, heavier braking predicts a larger speed gain because the cyclist brakes harder on steeper slopes, and we recover the negative braking coefficient when we account for the slope or randomize braking. Motivated by this example, one possible explanation for the price puzzle is that the Fed raises rates in anticipation of inflationary pressures the model misses, so inflation can rise after a rate hike even if it would have risen more without one.

Below we discuss another toy example which is also conceptually similar to the inflation-interest rate problem.

Thermostat Example

We simulate a thermostat that heats a room in a cold climate. Time is measured in hours, and all temperatures are in degrees Celsius. We record three quantities.

  1. TtT_t is the indoor temperature at the beginning of hour tt.

  2. WtW_t is the average outdoor temperature during hour tt.

  3. HtH_t is the heating power during hour tt, measured in units such that one unit of heat adds one degree to the indoor temperature over the hour.

We model the outdoor temperatures as independent draws,

Wt∼i.i.d.N(5,25).W_t \overset{\mathrm{i.i.d.}}{\sim} N(5,25).

The mean of 5∘C5^\circ\mathrm{C} represents a typical cold-weather hour. The standard deviation of 5∘C5^\circ\mathrm{C} gives us a mix of colder and milder hours, with about two-thirds of the outdoor temperatures falling between 0∘C0^\circ\mathrm{C} and 10∘C10^\circ\mathrm{C}. Under the independence assumption, our best prediction from past temperatures alone is 5∘C5^\circ\mathrm{C}.

The indoor temperature evolves according to

Tt=0.8Tt−1+0.2Wt−1+Ht−1+ϵt,ϵt∼i.i.d.N(0,σ2),T_t = 0.8T_{t-1} + 0.2W_{t-1} + H_{t-1} + \epsilon_t, \qquad \epsilon_t \overset{\mathrm{i.i.d.}}{\sim} N(0,\sigma^2),

where the disturbances are independent of the outdoor temperatures. Without heating or disturbances, the indoor temperature moves 20%20\% of the way toward the outdoor temperature each hour.

How the thermostat sets the heat

Suppose the room begins hour tt at the target temperature T⋆T^\star. If the heater is off, the indoor temperature one hour later will be 0.8T⋆+0.2Wt0.8T^\star + 0.2W_t, apart from the random disturbance. The heat needed to maintain the target is therefore

T⋆−(0.8T⋆+0.2Wt)=0.2(T⋆−Wt).T^\star - \bigl(0.8T^\star + 0.2W_t\bigr) = 0.2(T^\star - W_t).

Thus, for an hour with outdoor temperature WtW_t, the required heat is 0.2(T⋆−Wt)0.2(T^\star - W_t). On the other hand, for a typical hour, the thermostat can use the mean outdoor temperature of 5∘C5^\circ\mathrm{C} and supply 0.2(T⋆−5)0.2(T^\star - 5).

We assume the thermostat schedules the heat one hour in advance. When it sets HtH_t at the beginning of hour t−1t-1, it knows the indoor reading Tt−1T_{t-1} and has a weather forecast for hour tt. For simplicity, we assume the forecast equals the actual temperature WtW_t. The thermostat gives weight θ\theta to the heating requirement based on the forecast and weight 1−θ1-\theta to the requirement for a typical hour, where 0≤θ≤10 \leq \theta \leq 1.

The thermostat also corrects for the indoor temperature. For each degree that Tt−1T_{t-1} is below target, it adds 0.3 units of heat. For each degree above target, it reduces the heat by the same amount. Combining this correction with the expected heat loss gives

Ht=0.3(T⋆−Tt−1)+0.2θ(T⋆−Wt)+0.2(1−θ)(T⋆−5).H_t = 0.3(T^\star - T_{t-1}) + 0.2\theta(T^\star - W_t) + 0.2(1-\theta)(T^\star - 5).

Taking the target temperature to be T⋆=20T^\star = 20, we can write the rule as

Ht=3+0.3(20−Tt−1)−0.2θ(Wt−5)=9−0.3Tt−1−0.2θ(Wt−5).\begin{aligned} H_t &= 3 + 0.3(20 - T_{t-1}) - 0.2\theta(W_t - 5) \\ &= 9 - 0.3T_{t-1} - 0.2\theta(W_t - 5). \end{aligned}

The coefficient -0.3 describes the thermostat’s negative feedback. Holding the outdoor forecast WtW_t fixed, each 1∘1\circ C increase in the indoor reading at the beginning of hour t−1t-1 causes the thermostat to schedule 0.3 fewer units of heat for hour tt.

For example, if the indoor reading is at the target of 20∘C20^\circ\mathrm{C}, a typical hour calls for 3 units of heat. If the forecast is 0∘C0^\circ\mathrm{C}, the room is expected to lose one additional degree, and the thermostat sets Ht=3+θH_t = 3 + \theta. With θ=0\theta = 0 it supplies the usual 3 units, with θ=0.5\theta = 0.5 it supplies 3.5, and with θ=1\theta = 1 it supplies the full 4 units needed for the colder hour.

To summarize, we generate the data according to:

Wt∼i.i.dN(5,25)   and   ϵt∼i.i.dN(0,σ2)Tt=0.8Tt−1+0.2Wt−1+Ht−1+ϵtHt=3+0.3(20−Tt−1)−0.2θ(Wt−5)=9−0.3Tt−1−0.2θ(Wt−5).\begin{align*} & W_t \overset{\text{i.i.d}}{\sim} N(5, 25) ~~ \text{ and } ~~ \epsilon_t \overset{\text{i.i.d}}{\sim} N(0, \sigma^2) \\ & T_t = 0.8T_{t-1} + 0.2W_{t-1} + H_{t-1} + \epsilon_t \\ & H_t = 3 + 0.3(20 - T_{t-1}) - 0.2\theta(W_t - 5) = 9 - 0.3T_{t-1} - 0.2\theta(W_t - 5). \end{align*}

The code below simulates this data.

Here is a plot of the three time series.

<Figure size 1200x550 with 2 Axes>

Below we fit VAR(1) and VAR(2) models to the bivariate time series (Tt,Ht)(T_t, H_t). Note we are ignoring the data on weather forecasts WtW_t.

Estimate of the intercept: [12.82603334  8.92062885]
Estimate of A1 (first row: equation for the temperature, second row: equation for the heater):
[[ 0.47050629 -0.74630679]
 [-0.29945316  0.01518088]]
Standard errors of these estimates:
[[0.01400663 0.0194972 ]
 [0.01506719 0.0209735 ]]
The matrix A1 in the equations which generated the data:
[[ 0.8  1. ]
 [-0.3  0. ]]
Estimate of the intercept: [18.83294338  9.21750736]
Standard errors of the intercept: [0.29941673 0.48587833]
Estimate of A1:
[[ 0.81489937 -0.99247343]
 [-0.29382792  0.00755172]]
Standard errors of A1:
[[0.01484226 0.01381515]
 [0.02408527 0.02241853]]
Estimate of A2:
[[-0.61360304  0.04000279]
 [-0.01806619 -0.00826782]]
Standard errors of A2:
[[0.01239801 0.01702604]
 [0.02011886 0.027629  ]]

The fitted VAR(1) equation is

T^t=12.83+0.47Tt−1−0.75Ht−1,H^t=8.92−0.30Tt−1+0.02Ht−1.\begin{aligned} \widehat T_t &= 12.83 + 0.47T_{t-1} - 0.75H_{t-1}, \\ \widehat H_t &= 8.92 - 0.30T_{t-1} + 0.02H_{t-1}. \end{aligned}

The fitted heater equation is correctly predicting the thermostat’s response to indoor temperature. Recall that the actual heater equation was: Ht=9−0.3Tt−1−0.2(Wt−5)H_t = 9 - 0.3 T_{t-1} - 0.2(W_t - 5). The variable 0.2(Wt−5)∼i.i.dN(0,1)0.2 (W_t - 5) \overset{\text{i.i.d}}{\sim} N(0, 1) so it can be treated as noise, and the correct linear equation relating HtH_t to Tt−1T_{t-1} is 9−0.3Tt−19 - 0.3 T_{t-1} which is recovered by the second VAR(1) equation.

The temperature equation has a surprising coefficient of -0.75 on Ht−1H_{t-1}, which, interpreted naively, suggests that heating would be lowering temperature. The negative coefficient appears because, in the simulated data, the thermostat turns up the heat in anticipation of cold weather. A higher heater setting therefore also tells us that the house is likely to lose more heat to the outdoors during that hour.

The fitted VAR(2) equation is

T^t=18.83+0.815Tt−1−0.992Ht−1−0.614Tt−2+0.040Ht−2,H^t=9.22−0.294Tt−1+0.008Ht−1−0.018Tt−2−0.008Ht−2.\begin{aligned} \widehat T_t &= 18.83 + 0.815T_{t-1} - 0.992H_{t-1} - 0.614T_{t-2} + 0.040H_{t-2}, \\ \widehat H_t &= 9.22 - 0.294T_{t-1} + 0.008H_{t-1} - 0.018T_{t-2} - 0.008H_{t-2}. \end{aligned}

We can drop the coefficients which are small (also compare the coefficients with their standard errors; if the standard error of a coefficient is of the same order as the coefficient itself, then it can be ignored) to get

Tt^=18.83+0.815Tt−1−0.992Ht−1−0.614Tt−2Ht^=9.22−0.294Tt−1\begin{align*} & \widehat{T_t} = 18.83 + 0.815 T_{t-1} - 0.992 H_{t-1} - 0.614 T_{t-2} \\ & \widehat{H_t} = 9.22 - 0.294 T_{t-1} \end{align*}

The second equation is again correct in describing how the thermostat is reacting to temperature. The first equation again has the wrong coefficient for Ht−1H_{t-1}. To understand this specific form for the first equation, first note that

Ht−1=9−0.3Tt−2−0.2θ(Wt−1−5)  ⟹  0.2Wt−1=1+9−0.3Tt−2−Ht−1θ.\begin{align*} H_{t-1} = 9 - 0.3T_{t-2} - 0.2\theta(W_{t-1}-5) \implies 0.2W_{t-1} = 1 + \frac{9 - 0.3T_{t-2} - H_{t-1}}{\theta}. \end{align*}

Substituting into the temperature equation eliminates Wt−1W_{t-1} and gives the exact second-order equation

Tt=(1+9θ)+0.8Tt−1+(1−1θ)Ht−1−0.3θTt−2+ϵt.T_t = \left(1+\frac{9}{\theta}\right) + 0.8T_{t-1} + \left(1-\frac{1}{\theta}\right)H_{t-1} - \frac{0.3}{\theta}T_{t-2} + \epsilon_t.

For θ=0.5\theta=0.5, the two equations for the observed series become

Tt=19+0.8Tt−1−Ht−1−0.6Tt−2+ϵt,Ht=9−0.3Tt−1+ut,\begin{aligned} T_t &= 19 + 0.8T_{t-1} - H_{t-1} - 0.6T_{t-2} + \epsilon_t, \\ H_t &= 9 - 0.3T_{t-1} + u_t, \end{aligned}

where ut=−0.1(Wt−5)u_t=-0.1(W_t-5) is the mean-zero weather contribution to the heater setting. Both the VAR(2) fitted equations are close to these expressions. In particular, the VAR(2) recovers the thermostat coefficient of -0.3, the second temperature lag of -0.6, and the coefficient of -1 on heating.

The reason for the negative coefficient is as follows. For the same Tt−2T_{t-2}, a weather forecast WtW_t that is 1∘C1^\circ\mathrm{C} colder makes the thermostat supply 0.1 more units of heat. Starting from the same Tt−1T_{t-1}, the colder weather lowers the expected next temperature by 0.2∘C0.2^\circ\mathrm{C}, and the extra heating restores 0.1∘C0.1^\circ\mathrm{C}. The colder hour therefore ends 0.1∘C0.1^\circ\mathrm{C} cooler on average, even though the heater delivered more heat.

Once again, the connection to the price puzzle is the following. The Fed may raise interest rates when it anticipates inflationary pressures that the VAR omits, just as the thermostat raises the heat when it anticipates cold weather. A rate increase can then predict higher future inflation even if inflation would have risen more without it.

How can the effect of the heater be correctly measured?

There are two ways:

  1. Recording what the thermostat knows. We keep the thermostat, but we also record the outside temperature WtW_t (which the thermostat knew from its forecast), and fit the model to the three series TtT_t, HtH_t and WtW_t.

  2. An experiment. We switch off the thermostat, and set the power of the heater at random in every hour (with the same average and about the same spread as before). Then the power of the heater has nothing to do with the weather or with the temperature of the room.

We start with the first way. With the outside temperature included, the equations which generated the data are

Tt=0+0.8 Tt−1+1.0 Ht−1+0.2 Wt−1+ϵtHt=9−0.3 Tt−1+0.0 Ht−1+0.0 Wt−1−0.2 θ (Wt−5)Wt=5+0.0 Tt−1+0.0 Ht−1+0.0 Wt−1+(Wt−5).\begin{align*} T_t &= 0 + 0.8 \, T_{t-1} + 1.0 \, H_{t-1} + 0.2 \, W_{t-1} + \epsilon_t \\ H_t &= 9 - 0.3 \, T_{t-1} + 0.0 \, H_{t-1} + 0.0 \, W_{t-1} - 0.2 \, \theta \, (W_t - 5) \\ W_t &= 5 + 0.0 \, T_{t-1} + 0.0 \, H_{t-1} + 0.0 \, W_{t-1} + (W_t - 5). \end{align*}

(The third equation only says that the outside temperature cannot be predicted from the past.) This is a VAR(1) model for yt=(Tt,Ht,Wt)y_t = (T_t, H_t, W_t), with

A1=(0.81.00.2−0.30.00.00.00.00.0).A_1 = \begin{pmatrix} 0.8 & 1.0 & 0.2 \\ -0.3 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 \end{pmatrix}.

Now nothing is hidden. The last terms of the three equations (ϵt\epsilon_t, −0.2 θ (Wt−5)-0.2 \, \theta \, (W_t - 5) and Wt−5W_t - 5) are new at time tt, and they are unrelated to the past values Tt−1T_{t-1}, Ht−1H_{t-1} and Wt−1W_{t-1}.

Below we fit VAR(1) to the (Tt,Ht,Wt)(T_t, H_t, W_t) data.

Estimate of the intercept: [0.05 8.53 9.73]
Standard errors of the intercept: [0.32 0.52 5.23]
Estimate of A1 (the rows are the equations for the room temperature, the heater and the outside temperature):
[[ 0.792  1.032  0.202]
 [-0.29   0.07   0.006]
 [-0.105 -0.7   -0.062]]
Standard errors of these estimates:
[[0.011 0.038 0.004]
 [0.018 0.061 0.007]
 [0.183 0.609 0.065]]
The matrix A1 in the equations which generated the data:
[[ 0.8  1.   0.2]
 [-0.3  0.   0. ]
 [ 0.   0.   0. ]]

The VAR(1) on (Tt,Ht,Wt)(T_t,H_t,W_t) recovers all three one-hour-ahead equations up to sampling error. In the temperature equation, the fitted coefficients (0.792,1.032,0.202)(0.792,1.032,0.202) are close to the true values (0.8,1,0.2)(0.8,1,0.2). Once we account for Wt−1W_{t-1}, the heating coefficient changes from -0.75 to 1.032, recovering the expected warming effect. The heater equation gives a coefficient of -0.29 on Tt−1T_{t-1}, close to the thermostat’s -0.3, and its other lag coefficients are consistent with zero. Its response to the current weather WtW_t enters the heater equation’s error term. Finally, as expected for independent hourly outdoor temperatures, all three lag coefficients in the WtW_t equation are consistent with zero, and the estimated intercept of 9.73 is within one standard error (5.23) of the true mean of 5∘C5^\circ\mathrm{C}.

If the thermostat is turned off and heating is turned on randomly, then VAR applied to (Tt,Ht)(T_t, H_t) would correctly recover the effect of Ht−1H_{t-1} on TtT_t. To do this, we shall re-simulate the data with HtH_t applied randomly. The following function generates the data according to the previous model with a fixed θ\theta (that can be different from 0.5) or with heating turned on randomly. We then fit VAR(1) to the generated bivariate data (Tt,Ht)(T_t, H_t). We print out the estimates of A1(1,2)A_1(1, 2) (which is the effect of heating on temperature) as well as A1(2,1)A_1(2, 1) (effect of temperature Tt−1T_{t-1} on heating HtH_t). The main purpose of the heater is to control the temperature of the room. To understand this, we also compute the standard deviation of the temperature time series (if this is small, then the heater is working well).

                               heater -> temp. (truth 1.0)  \
thermostat, theta = 0                                 1.01   
thermostat, theta = 0.5                              -0.75   
thermostat, theta = 1                                 0.02   
no thermostat, random power                           1.01   
theta = 0.5, weather recorded                         1.03   

                               temp. -> heater (truth -0.3)  sd of temp.  
thermostat, theta = 0                                 -0.30         1.36  
thermostat, theta = 0.5                               -0.30         0.76  
thermostat, theta = 1                                 -0.34         0.41  
no thermostat, random power                            0.00         1.91  
theta = 0.5, weather recorded                         -0.29         0.76  

The bivariate VAR(1) correctly estimates the effect of heating on next-hour temperature both with randomized heating and with the thermostat on at θ=0\theta=0. In both cases, the coefficient on Ht−1H_{t-1} is 1.01, close to the true value of 1. When θ=0\theta=0, the thermostat responds only to past indoor temperature, so its heating decision is independent of the outdoor temperature during the hour it heats. When the thermostat uses the weather forecast, the fitted heating coefficient changes to -0.75 at θ=0.5\theta=0.5 and 0.02 at θ=1\theta=1. Meanwhile, the temperature feedback coefficient stays close to -0.3 whenever the thermostat is on and is 0.00 under random heating. As θ\theta increases from 0 to 0.5 to 1, the standard deviation of room temperature falls from 1.36 to 0.76 to 0.41∘C0.41^\circ\mathrm{C}, compared with 1.91∘C1.91^\circ\mathrm{C} under random heating. Including outdoor temperature in the VAR at θ=0.5\theta=0.5 restores the positive heating coefficient, giving an estimate of 1.03.

VAR(2) applied to the Unemployment-Inflation-Interest Rate data

VAR(2) actually fits better to the unemployment-inflation-interest rate data compared to VAR(1). This can be seen from the following code which selects pp using the BIC.

BIC selected p = 2

We fit the VAR(2) model to the same dataset as follows.

Estimate of the intercept: [0.17669122 0.18189565 0.08857192]
Estimate of A1:
[[ 0.98494715 -0.01711639 -0.08674496]
 [ 0.27976184  0.53755448  0.43267444]
 [-0.0515184   0.02463517  1.36058518]]
Estimate of A2:
[[-0.02105631  0.01044626  0.0982918 ]
 [-0.22504444  0.09740152 -0.29292927]
 [ 0.04222749 -0.00160862 -0.38296451]]

The impulse responses for inflation (in response to a unit interest rate shock) are plotted as follows (along with the corresponding impulse responses for the VAR(1) model).

<Figure size 900x400 with 1 Axes>

The conclusion for VAR(2) is similar to that of VAR(1). The impulse responses for inflation are positive for many months after the funds rate shock.