OpenSourceEcon / BootCamp2018

Repository of syllabi, lecture notes, Jupyter notebooks, code, and problem sets for OSM Lab Boot Camp 2018
81 stars 102 forks source link

Error in Numerical Integration Lab: Simpson's Rule? #29

Open rebekahanne opened 6 years ago

rebekahanne commented 6 years ago

I'm wondering if the scaling factor in equation 14.9 in the Numerical integration lab (the section on Simpson's rule) is incorrect? I think equation 14.9 should be multiplied by (b-a)/(3(2N+1)) rather than (b-a)/(3(N+1)).

rickecon commented 6 years ago

@rebekahanne . I will look into this issue this morning.

navneeraj commented 6 years ago

I too think so. As in the previous methods, the idea seems to be to do a weighted sum and divide the whole sum by the sum of weights to get the weighted average. The sum of weights is 6N+2 = 1+ 4N + 2N +1, for the 4 corresponding terms inside the sum. Hence the sum needs to be divided by 3(2N+1).

rickecon commented 6 years ago

@rebekahanne @navneeraj @zeshunzon. Thanks for your work on this. In looking at the correct specification again with @navneeraj and @rebekahanne, the denominator needs to be 6N in the specification in the lab. I am updating it now.