OpenSourceEcon / BootCamp2019

Repository of syllabi, lecture notes, Jupyter notebooks, code, and problem sets for OSE Lab Boot Camp 2019
88 stars 97 forks source link

Gauss-Seidel #45

Closed Xincheng-Qiu closed 5 years ago

Xincheng-Qiu commented 5 years ago

I think there is a typo in equation (16.3) for the Gauss-Seidel method in IterativeSolvers.pdf. The x-values of the second term in the brackets should be from the (k+1)-th iteration. image The current expression is actually the Jacobi method and so is equation (16.4) too.

rickecon commented 5 years ago

@Xincheng-Qiu . Equation (16.3) in the lab is written in exactly the same way as in Judd (1998, p. 72) equation (3.6.3). The only difference is in how the indices over which the terms are summed are expressed (but they are the same). Below is the specification in Judd (1998, p. 72) equation (3.6.3).

GS

I think the equation above is the correct specification of the Gauss-Seidel algorithm. Or at least, your issue with the k superscript on the second term in the brackets is not the problem.

Judd (1998, p. 71) specifies the Gauss-Jacobi algorithm in equation (3.6.2).

GJ

The reference for Judd (1998) is the following.

Kenneth L. Judd, Numerical Methods in Economics, MIT Press, 1998.

Xincheng-Qiu commented 5 years ago

@rickecon I think Judd (1998, p. 72) equation (3.6.3) is the same as my specification above. Equation (16.3) in the lab (see below), however, specifies the (k+1)-th iteration term (mistakenly) as the k-th iteration term. image

Xincheng-Qiu commented 5 years ago

@rickecon Ah I guess I didn't express it clearly in my first post. The equation in my first post is the correct one, not the wrong expression in the lab file.