Errata

Errata for Miranda and Fackler
Applied Computational Economics and Finance

Last Updated: Wednesday, March 07, 2012

As of 9/29/03 errata will be dated as they are entered. Non-dated entries were made before this date.

Chapter 2

p. 13 (9/29/03)

Replace
Backward and forward substitution yield the theoretical results x1=1-M-1 and x2M-1+1+M-1(1-M-1).
with
Backward and forward substitution here yield the results x2=(1+2M-1)/(1+M-1) and x1=2-x2.

Chapter 4

p. 60 (12/18/06)

Second paragraph of Section 4.1 change f(x1)<f(x2) to f(x2)<f(x1)

Chapter 5

p. 93 (1/26/08)

Replace
pj represents the jth prime number
with
pj represents the square root of the jth prime number

p. 110 (9/23/05)

The value of f should be 0.025 not 0.06 to generate Figure 5.4.

Chapter 6

p. 133(12/18/06)

In the matrix on the top of the page, the (6,5)th element should be 2 instead of 1

p. 137-8(2/17/05)

In order to form spline approximants over the interval
{(x1,x2)| -1 < x1 < 2, 4 < x2 < 9}
the code segment on the bottom of page 137 should read
fspace = fundefn(‘spli’,[10 15],[-1 4],[2 9])
and the offset code segment on the top of page 138 should read
fspace = fundefn(‘spli’,[10 15],[-1 4],[2 9], 1)

p. 140(3/7/12)

Script and text give alpha=2 but the plot is for alpha=1. The plot can be obtained by running demapp06.

p. 144(2/17/05)

Script should plot residual function, but plots effective supply instead.  To correct, replace
splot = funeval(c,fspace,pplot);
plot(splot,pplot);
with
rplot = resid(c,pplot,fspace,alpha,eta);
plot(pplot,rplot)

p. 148(5/20/09)

The last line of the first code fragment should read
r = [r(:); x0(2)-s0; x1(2)];

p. 151

Exercise 6.5 makes more sense if rho is 0.06 rather than 0.6 (an agent with a rate of time preference of 0.6 will borrow heavily in youth and have to work like a dog for the rest of his life to pay off his debts).

Chapter 7

p. 159

(1,0) and (a+1,s+1) are reversed in definition of g(a,s,x). Similarly p(0,0)-c and p(a,s+1)-k are reversed in definition of f(a,s,x).

p. 184 (6/17/04)

The second line should read
S=(0:emax)’;
One should also add the line
m=length(e);

p. 197(2/17/05)

In the first three instances of V(:,:) the second argument should be 0 not 1. In the fourth instance it should be 1 not 0.

Chapter 8

p. 196 (12/18/08)

First two equations change K2 to K0

p. 209 (9/29/03)

Second equation, change subscript on f from i to p.

Chapter 9

p. 241 (10/24/03)

The first line of text should end with “the model parameters price, kbar, gamma and abar.”

The second line of the first full paragraph should read:
“Here, the output price, long-run mean replacement cost, replacement cost mean reversion rate, maximum asset age, replacement cost shock standard deviation, and discount factor are specified, respectively:”

p. 244 (4/8/04)

In paragraph 2 the profit shock is incorrectly called a replacement cost shock.

p. 247

Change definition of shock distribution to

     [e,w] = qnwlogn(nshocks,-sigma^2/2,sigma^2);

p. 248 (11/21/2005)

Change computation of the LQ approximation to

     estar = 1;
pstar = (sstar-xstar).^(-alpha);
[vlq,xlq] = lqapprox(model,snodes,sstar,xstar,pstar);

In the second full paragraph, the words upward and downward are reversed.

p. 251

Change computation of the LQ approximation to

     pstar = kappa – xstar^(-gamma);
[vlq,xlq] = lqapprox(model,snodes,sstar,xstar,pstar);

p. 257

Change definition of shock distribution to

     [e,w] = qnwlogn(nshocks,-sigma^2/2,sigma^2);

p. 258

Change computation of the LQ approximation to

     estar = 1;
pstar = a(1);
[vlq,xlq] = lqapprox(model,snodes,sstar,xstar,pstar);

p. 260 (12/15/08)

The diagonal elements of Sigma should be 0.04 rather than 0.4 (to make them consistent with the code on p. 261)

p. 261-262 (12/18/06)

We’ve listed seven things to do and enumerated them 1, 2, 3, 4, 4, 5 and 6 (nobody’s perfect).

p. 262

Change computation of the LQ approximation to

     pstar = [0 0];
[vlq,xlq,plq,ss,xx,pp] = lqapprox(model,snodes,sstar,xstar,pstar);

p. 265

Change definition of shock distribution to

     [e,w] = qnwlogn(nshocks,-sigma^2/2,sigma^2);

p. 265 (10/25/05)

Change definition of upper bound for S to

     smax = [e(nshocks)  xstar+3.0];

p. 266

Change computation of the LQ approximation to

     estar = 1;
pstar = [xstar^(1-beta) alpha*(xstar-1)];
[vlq,xlq] = lqapprox(model,snodes,sstar,xstar,pstar);

p. 269

Change computation of the LQ approximation to

     pstar = [pbar xstar(1)/(1-delta*rho)];
[vlq,xlq,plq,ss,xx,pp] = lqapprox(model,snodes,sstar,xstar,pstar);

p. 272 (7/27/05)

Change
model.T=T;
to
model.horizon=T;

p. 281

In case ‘f1’ after line fxx=zeros(n,m,m) insert

     fxx(:,1,1) = zeros(n,1)-gamma(2);

In case ‘f2’ after line fxx=zeros(n,m,m) insert

     fxx(:,2,2) = zeros(n,1)-gamma(2);

p. 284

Change last 4 lines with the following 6 lines

     gx(:,1,:) = [(1-psi)*g1x psi*g2x];
gxx(:,1,1,1) = (1-psi)*g1xx;
gxx(:,1,2,2) = psi*g2xx;
g(:,2) = (1-psi)*g2 + psi*g1;
gx(:,2,:) = [psi*g1x (1-psi)*g2x];
gxx(:,2,1,1) = psi*g1xx;

p. 288

In case ‘f1’ replace fx and fxx lines with

     fx = [px.*q1-p-kappa px.*q1];
fxx = zeros(n,m,m);
fxx(:,1,1) = pxx.*q1 – 2*px;
fxx(:,1,2) = pxx.*q1 – px;
fxx(:,2,1) = pxx.*q1 – px;
fxx(:,2,2) = pxx.*q1;

In case ‘f2’ replace fx and fxx lines with

     fx = [px.*q2 px.*q2-p-kappa];
fxx = zeros(n,m,m);
fxx(:,1,1) = pxx.*q2;
fxx(:,1,2) = pxx.*q2-px;
fxx(:,2,1) = pxx.*q2-px;
fxx(:,2,2) = pxx.*q2-2*px;

Chapter 10

p. 317 (4/13/09)

In the second and third equations the (r-δ) terms should be (r-δ-ν/2).

p. 322 (10/24/03)

Last line change V(S) to V(S,t).

p. 346 (12/18.06)

Fourth line from bottom change “change” to “charge”

p. 356

Fifth line of Section 10.5.3 change R+(S0,S0) to R+(S0,S1)

Chapter 11

p. 379

The syntax of finsolve changed to eliminate A and a outputs

Also first line of the last code fragment should be:

     out = func(flag,s,additional parameters)

(no t in argument list)

p. 381

Add following line at the top of the first code fragment:

     a = b;

Alternatively change last line on p. 380 to:

     if hasdiv, a = Phii*delta; end

p. 382 (4/13/09)

The lines
case ‘sigma’
out = sigma;

should be
case ‘sigma’
out = sigma*S;

p. 429 (10/6/2005)

In equation in last full paragraph change +½σ2 to –½σ2

Appendix A

p. 459

On line 9 change y to x. Also in the definition of a norm ||x||=0 if and only if x=0.

p. 464 (1/1/05)

The definition of the inf norm is incorrect. It should be maxi ∑j|Aij|

p. 471(1/24/06)

The two equations at the bottom of the page both should have a 2 following the integral signs.

Appendix B

p. 477

Last paragraph change 2×1 to 1×2

p. 482 (4/3/05;1/24/06)

9 lines from bottom change to X
3 lines from botton change “<” to “>”
This code fragment is, in fact, rather stupid. A more interesting fragment (and probably what was intended) is:
P=.25;
X=0;
DX=5;
while DX>1E-7;
DX=DX/2;
if cdfn(X)>P, X=X-DX; else X=X+DX; end
disp(X)
end
This computes the 25th pecentile of a standard normal distribution (cdfn is available in the CompEcon Toolbox).