NUMERICAL DYNAMIC PROGRAMMING

Size: px
Start display at page:

Download "NUMERICAL DYNAMIC PROGRAMMING"

Transcription

1 NUMERICAL DYNAMIC PROGRAMMING Kenneth L. Judd Hoover Institution and NBER July 29,

2 Dynamic Programming Foundation of dynamic economic modelling Individual decisionmaking Social planners problems, Pareto efficiency Dynamic games Computational considerations Applies a wide range of numerical methods: Optimization, approximation, integration Can exploit any architecture, including high-power and high-throughput computing Outline Review of Dynamic Programming Necessary Numerical Techniques Approximation Integration Numerical Dynamic Programming

3 Discrete-Time Dynamic Programming Objective: E ( TX t=1 X is set of states and D is the set of controls π(x t,u t,t)+w (x T +1 ) ), (12.1.1) π(x, u, t) payoffs inperiodt, forx X at the beginning of period t, andcontrolu D is applied in period t. D(x, t) D: controls which are feasible in state x at time t. F (A; x, u, t) :probability that x t+1 A X conditional on time t control and state Value function definition ( TX V (x, t) sup E U(x,t) s=t π(x s,u s,s)+w (x T +1 ) x t = x ). (12.1.2) Bellman equation V (x, t) = sup u D(x,t) π(x, u, t)+e {V (x t+1,t+1) x t = x, u t = u} (12.1.3) Existence: boundedness of π is sufficient

4 Autonomous, Infinite-Horizon Problem: Objective: max u t ( ) X E β t π(x t,u t ) t=1 (12.1.1) Value function definition: if U(x) is set of all feasible strategies starting at x. ( ) X V (x) sup E β t π(x t,u t ) U(x) x0 = x, (12.1.8) Bellman equation for V (x) t=0 V (x) = sup u D(x) π(x, u)+βe V (x + ) x, u ª (TV)(x), (12.1.9) Optimal policy function, U(x), ifitexists, isdefined by U(x) arg max π(x, u)+βe V (x + ) x, u ª u D(x) Standard existence theorem: If X is compact, β<1, and π is bounded above and below, then TV = sup u D(x) π(x, u)+βe V (x + ) x, u ª ( ) is monotone in V, and a contraction mapping with modulus β in the space of bounded functions, and has a unique fixed point.

5 Deterministic Growth Example Problem: Euler equation: V (k 0 )=max ct P t=0 βt u(c t ), k t+1 = F (k t ) c t k 0 given u 0 (c t )=βu 0 (c t+1 )F 0 (k t+1 ) ( ) Bellman equation V (k) =max u(c)+βv (F (k) c). ( ) c Solution to ( ) is a policy function C(k) and a value function V (k) satisfying 0=u 0 (C(k))F 0 (k) V 0 (k) ( ) V (k)=u(c(k)) + βv (F (k) C(k)) ( ) ( ) defines the value of an arbitrary policy function C(k), not just for the optimal C(k). The pair ( ) and ( ) expresses the value function given a policy, and a first-order condition for optimality.

6 Stochastic Growth Accumulation Problem: ( X ) V (k, θ) =max c t, t E t=0 β t u(c t ) k t+1 = F (k t,θ t ) c t θ t+1 = g(θ t,ε t ) ε t : i.i.d. random variable k 0 = k, θ 0 = θ. State variables: k: productive capital stock, endogenous θ: productivity state, exogenous The dynamic programming formulation is V (k, θ) =max c u(c)+βe{v (F (k, θ) c, θ + ) θ} ( ) θ + = g(θ, ε) The control law c = C(k, θ) satisfies the first-order conditions 0=u c (C(k, θ)) βe{u c (C(k +,θ + ))F k (k +,θ + ) θ}, ( ) where k + F (k, L(k, θ),θ) C(k, θ),

7 Discrete State Space Problems State space X = {x i,i=1,,n} Controls D = {u i i =1,..., m} qij t (u) =Pr(x t+1 = x j x t = x i,u t = u) Q t (u) = qij t (u) : Markov transition matrix at t if u i,j t = u. Value Function Iteration: Discrete-State Problems State space X = {x i,i=1,,n} and controls D = {u i i =1,..., m} Terminal value: V T +1 i = W (x i ),i=1,,n. Bellman equation: time t value function is V t i =max u [π(x i,u,t)+β nx j=1 q t ij(u) V t+1 j ], i=1,,n Bellman equation can be directly implemented - called value function iteration. Only choice for finite T.

8 Infinite-horizon problems Bellman equation is now a simultaneous set of equations for V i values: nx V i =max π(x i,u)+β q ij (u) V j,i=1,,n u Value function iteration is V k+1 i U k+1 i =max u =argmax u π(x i,u)+β j=1 nx j=1 π(x i,u)+β q ij (u) V k j nx j=1 Can use value function iteration with arbitrary V 0 i Error is given by contraction mapping property: V k V 1 1 β q ij (u) V k j,i=1,,n,i=1,,n and iterate k. V k+1 V k Stopping rule: continue until V k V <εwhere ε is desired accuracy.

9 Policy Iteration (a.k.a. Howard improvement) Value function iteration is a slow process Linear convergence at rate β Convergence is particularly slow if β is close to 1. Policy iteration is faster Current guess: V k i,i=1,,n. Iteration: compute optimal policy today if V k is value tomorrow: nx Ui k+1 =argmax π(x i,u)+β q ij (u) Vj k,i=1,,n, u Compute the value function if the policy U k+1 is used forever, which is solution to the linear system Vi k+1 = π nx x i,ui k+1 + β q ij (Ui k+1 ) Vj k+1,i=1,,n, j=1 Policy iteration depends on only monotonicity If initial guess is above or below solution then policy iteration is between truth and value function iterate Works well even for β close to 1. j=1

10 Linear Programming Approach If D is finite, we can reformulate dynamic programming as a linear programming problem. (12.3.4) is equivalent to the linear program P min n Vi i=1 V i s.t. V i π(x i,u)+β P n j=1 q ij(u)v j, i, u D, Computational considerations ( ) ( ) may be a large problem Trick and Zin (1997) pursued an acceleration approach with success. Recent work by Daniela Pucci de Farias and Ben van Roy has revived interest. Continuous states: Discretization Method: Replace continuous X with a finite X = {x i,i=1,,n} X Proceed withafinite-state method. Problems: Sometimes need to alter space of controls to assure landing on an x in X. A fine discretization often necessary to get accurate approximations

11 Continuous Methods for Continuous-State Problems Basic Bellman equation: V (x) = max u D(x) π(u, x)+βe{v (x+ ) x, u)} (TV)(x). (12.7.1) Discretization essentially approximates V with a step function Approximation theory provides better methods to approximate continuous functions. General Task Choose a finite-dimensional parameterization V (x). = ˆV (x; a), a R m (12.7.2) and a finite number of states X = {x 1,x 2,,x n }, (12.7.3) Find coefficients a R m such that ˆV (x; a) approximately satisfies the Bellman equation.

12 General Parametric Approach: Approximating T For each x j, (TV)(x j ) is defined by v j =(TV)(x j )= max u D(x j ) π(u, x j)+β Z ˆV (x + ; a)df (x + x j,u) (12.7.5) In practice, we compute the approximation ˆT v j =(ˆTV)(x j ). =(TV)(x j ) Integration step: for ω j and x j for some numerical quadrature formula Z E{V (x + ; a) x j,u)}= ˆV (x + ; a)df (x + x j,u) Z = ˆV (g(x j,u,ε); a)df (ε). = X ω ˆV (g(x j,u,ε ); a) Maximization step: for x i X, evaluate Fitting step: v i =(T ˆV )(x i ) Data: (v i,x i ),i=1,,n Objective: find an a R m such that ˆV (x; a) best fits the data Methods: determined by ˆV (x; a)

13 Approximation Methods General Objective: Given data about f(x) construct simpler g(x) approximating f(x). Questions: What data should be produced and used? What family of simpler functions should be used? What notion of approximation do we use? Comparisons with statistical regression Both approximate an unknown function and use a finite amount of data Statistical data is noisy but we assume data errors are small Nature produces data for statistical analysis but we produce the data in function approximation

14 Interpolation Methods Interpolation: find g (x) from an n-d family of functions to exactly fit n data items Lagrange polynomial interpolation Data: (x i,y i ),i=1,.., n. Objective: Find a polynomial of degree n 1, p n (x), which agrees with the data, i.e., y i = f(x i ),i=1,.., n Result: If the x i are distinct, there is a unique interpolating polynomial Does p n (x) converge to f (x) as we use more points? Consider f(x) = 1 1+x 2,x i uniform on [ 5, 5] Figure 1:

15 Hermite polynomial interpolation Data: (x i,y i,y 0 i),i=1,.., n. Objective: Find a polynomial of degree 2n 1, p(x), which agrees with the data, i.e., y i =p(x i ),i=1,.., n yi 0 =p 0 (x i ),i=1,.., n Result: If the x i are distinct, there is a unique interpolating polynomial Least squares approximation Data: A function, f(x). Objective: Find a function g(x) from a class G that best approximates f(x), i.e., g =argmax g G kf gk2

16 Orthogonal polynomials General orthogonal polynomials Space: polynomials over domain D weighting function: w(x) > 0 Inner product: hf,gi = R D f(x)g(x)w(x)dx Definition: {φ i } is a family of orthogonal polynomials w.r.t w (x) iff φi,φ j =0,i6= j We like to compute orthogonal polynomials using recurrence formulas φ 0 (x)=1 φ 1 (x)=x φ k+1 (x)=(a k+1 x + b k ) φ k (x)+c k+1 φ k 1 (x)

17 Chebyshev polynomials [a, b] =[ 1, 1] and w(x) = 1 x 2 1/2 T n (x) =cos(n cos 1 x) T 0 (x) =1 T 1 (x) =x T n+1 (x) =2xT n (x) T n 1 (x), General Orthogonal Polynomials Few problems have the specific intervals and weights used in definitions One must adapt interval through linear COV: If compact interval [a, b] is mapped to [ 1, 1] by y = 1+2 x a b a then φ i 1+2 x a b a are orthogonal over x [a, b] with respect to w 1+2 x a b a iff φi (y) are orthogonal over y [ 1, 1] w.r.t. w (y)

18 Regression Data: (x i,y i ),i=1,.., n. Objective: Find a function f(x; β) with β R m., m n, with y i = f(xi ),i=1,.., n. Least Squares regression: Chebyshev Regression Chebyshev Regression Data: X min (yi f (x i ; β)) 2 β R m (x i,y i ),i=1,.., n > m, x i are the n zeroes of T n (x) adapted to [a, b] Chebyshev Interpolation Data: (x i,y i ),i=1,.., n = m, x i are the n zeroes of T n (x)adapted to [a, b]

19 Algorithm 6.4: Chebyshev Approximation Algorithm in R 1 Objective: Given f(x) defined on [a, b], find its Chebyshev polynomial approximation p(x) Step 1: Compute the m n +1Chebyshev interpolation nodes on [ 1, 1]: µ 2k 1 z k = cos 2m π,k=1,,m. Step 2: Adjust nodes to [a, b] interval: µ b a x k =(z k +1) + a, k =1,..., m. 2 Step 3: Evaluate f at approximation nodes: w k = f(x k ),k=1,,m. Step 4: Compute Chebyshev coefficients, a i,i=0,,n: P m k=1 a i = w kt i (z k ) P m k=1 T i(z k ) 2 to arrive at approximation of f(x, y) on [a, b]: nx µ p(x) = a i T i 2 x a b a 1 i=0

20 Minmax Approximation Data: (x i,y i ),i=1,.., n. Objective: L fit Problem: Difficult to compute min max β R m i ky i f (x i ; β)k Chebyshevminmaxproperty Theorem 1 Suppose f :[ 1, 1] R is C k for some k 1, andleti n be the degree n polynomial interpolation of f based at the zeroes of T n (x). Then µ 2 k f I n k log(n +1)+1 π (n k)! ³ µ π k b a k k f (k) k n! 2 2 Chebyshev interpolation: converges in L essentially achieves minmax approximation easy to compute does not approximate f 0

21 Splines Definition 2 Afunctions(x) on [a, b] is a spline of order n iff 1. s is C n 2 on [a, b], and 2. there is a grid of points (called nodes) a = x 0 <x 1 < <x m = b such that s(x) is a polynomial of degree n 1 on each subinterval [x i,x i+1 ], i =0,...,m 1. Note: an order 2 spline is the piecewise linear interpolant. Cubic Splines Lagrange data set: {(x i,y i ) i =0,,n}. Nodes: The x i are the nodes of the spline Functional form: s(x) =a i + b i x + c i x 2 + d i x 3 on [x i 1,x i ] Unknowns: 4n unknown coefficients, a i,b i,c i,d i,i=1, n.

22 Conditions: 2n interpolation and continuity conditions: y i =a i + b i x i + c i x 2 i + d i x 3 i, i =1,.,n y i =a i+1 + b i+1 x i + c i+1 x 2 i + d i+1 x 3 i, i =0,.,n 1 2n 2 conditions from C 2 at the interior: for i =1, n 1, b i +2c i x i +3d i x 2 i =b i+1 +2c i+1 x i +3d i+1 x 2 i 2c i +6d i x i =2c i+1 +6d i+1 x i Equations (1 4) are 4n 2 linear equations in 4n unknown parameters, a, b, c, and d. construct 2 side conditions: natural spline: s 0 (x 0 )=0=s 0 (x n ); it minimizes total curvature, R x n x 0 s 00 (x) 2 dx, among solutions to (1-4). Hermite spline: s 0 (x 0 )=y0 0 and s 0 (x n )=yn 0 (assumes extra data) Secant Hermite spline: s 0 (x 0 )=(s(x 1 ) s(x 0 ))/(x 1 x 0 ) and s 0 (x n )=(s(x n ) s(x n 1 ))/(x n x n 1 ). not-a-knot: choosej = i 1,i 2, such that i 1 +1<i 2, and set d j = d j+1. Solve system by special (sparse) methods; see spline fit packages

23 Shape-preservation Concave (monotone) data may lead to nonconcave (nonmonotone) approximations. Example Schumaker Procedure: 1. Take level (and maybe slope) data at nodes x i 2. Add intermediate nodes z + i [x i,x i+1 ] 3. Run quadratic spline with nodes at the x and z nodes which intepolate data and preserves shape. 4. Schumaker formulas tell one how to choose the z and spline coefficients (see book and correction at book s website) Many other procedures exist for one-dimensional problems, but few procedures exist for twodimensional problems

24 Spline summary: Evaluation is cheap Splines are locally low-order polynomial. Can choose intervals so that finding which [x i,x i+1 ] contains a specific x is easy. Finding enclosing interval for general x i sequence requires at most dlog 2 ne comparisons Good fits even for functions with discontinuous or large higher-order derivatives. E.g., quality of cubic splines depends only on f (4) (x), not f (5) (x). Can use splines to preserve shape conditions

25 Multidimensional approximation methods Lagrange Interpolation Data: D {(x i,z i )} N i=1 Rn+m,wherex i R n and z i R m Objective: find f : R n R m such that z i = f(x i ). Need to choose nodes carefully. Task: Find combinations of interpolation nodes and spanning functions to produce a nonsingular (well-conditioned) interpolation matrix.

26 Tensor products General Approach: If A and B are sets of functions over x R n, y R m, their tensor product is A B = {ϕ(x)ψ(y) ϕ A, ψ B}. Given a basis for functions of x i, Φ i = {ϕ i k (x i)} k=0, the n-fold tensor product basis for functions of (x 1,x 2,...,x n ) is ( ny ) Φ = ϕ i k i (x i ) k i =0, 1,,i=1,...,n Orthogonal polynomials and Least-square approximation Suppose Φ i are orthogonal with respect to w i (x i ) over [a i,b i ] Least squares approximation of f(x 1,,x n ) in Φ is X hϕ, fi hϕ, ϕi ϕ, i=1 where the product weighting function defines h, i over D = Q i [a i,b i ] in ϕ Φ W (x 1,x 2,,x n )= hf(x),g(x)i = Z D ny i=1 w i (x i ) f(x)g(x)w (x)dx.

27 Algorithm 6.4: Chebyshev Approximation Algorithm in R 2 Objective: Given f(x, y) defined on [a, b] [c, d], find its Chebyshev polynomial approximation p(x, y) Step 1: Compute the m n +1Chebyshev interpolation nodes on [ 1, 1]: µ 2k 1 z k = cos 2m π,k=1,,m. Step 2: Adjust nodes to [a, b] and [c, d] intervals: µ b a x k =(z k +1) + a, k =1,..., m. 2 µ d c y k =(z k +1) + c, k =1,..., m. 2 Step 3: Evaluate f at approximation nodes: w k, = f(x k,y ),k=1,,m., =1,,m. Step 4: Compute Chebyshev coefficients, a ij,i,j =0,,n: P m P m k=1 =1 a ij = w k, T i (z k )T j (z ) ( P m k=1 T i(z k ) 2 )( P m =1 T j(z ) 2 ) to arrive at approximation of f(x, y) on [a, b] [c, d]: nx nx µ p(x, y) = a ij T i 2 x a µ b a 1 T j 2 y c d c 1 i=0 j=0

28 Multidimensional Splines B-splines: Multidimensional versions of splines can be constructed through tensor products; here B-splines would be useful. Summary Tensor products directly extend one-dimensional methods to n dimensions Curse of dimensionality often makes tensor products impractical Complete polynomials Taylor s theorem for R n produces the approximation f(x). =f(x 0 )+ P n i= P n i 1 =1 P n i 2 =1 f x i (x 0 )(x i x 0 i ) 2 f x i1 x ik (x 0 )(x i1 x 0 i 1 )(x ik x 0 i k )+... For k =1, Taylor s theorem for n dimensions used the linear functions P1 n {1,x 1,x 2,,x n } For k =2, Taylor s theorem uses P2 n P1 n {x 2 1,,x 2 n,x 1 x 2,x 1 x 3,,x n 1 x n }. In general, the kth degree expansion uses the complete set of polynomials of total degree k in n variables. nx Pk n {x i 1 1 x i n n i k, 0 i 1,,i n } =1

29 Complete orthogonal basis includes only terms with total degree k or less. Sizes of alternative bases degree k Pk n Tensor Prod. 2 1+n + n(n +1)/2 3 n 3 1+n + n(n+1) 2 + n 2 + n(n 1)(n 2) 6 4 n Complete polynomial bases contains fewer elements than tensor products. Asymptotically, complete polynomial bases are as good as tensor products. For smooth n-dimensional functions, complete polynomials are more efficient approximations Construction Compute tensor product approximation, as in Algorithm 6.4 Drop terms not in complete polynomial basis (or, just compute coefficients for polynomials in complete basis). Complete polynomial version is faster to compute since it involves fewer terms

30 Integration Most integrals cannot be evaluated analytically Integrals frequently arise in economics Expected utility and discounted utility and profits over a long horizon Bayesian posterior Solution methods for dynamic economic models Gaussian Formulas All integration formulas choose quadrature nodes x i [a, b] and quadrature weights ω i : Z b f(x) dx =. nx ω i f(x i ) (7.2.1) a Newton-Cotes (trapezoid, Simpson, etc.) use arbitrary x i Gaussian quadrature uses good choices of x i nodes and ω i weights. Exact quadrature formulas: Let F k bethespaceofdegreek polynomials A quadrature formula is exact of degree k if it correctly integrates each function in F k Gaussian quadrature formulas use n points and are exact of degree 2n 1 i=1

31 Theorem 3 Suppose that {ϕ k (x)} k=0 is an orthonormal family of polynomials with respect to w(x) on [a, b]. Then there are x i nodes and weights ω i such that a<x 1 <x 2 < <x n <b,and 1. if f C (2n) [a, b], then for some ξ [a, b], Z b a w(x) f(x) dx = nx i=1 ω i f(x i )+ f (2n) (ξ) q 2 n(2n)! ; 2. and P n i=1 ω if(x i ) is the unique formula on n nodes that exactly integrates R b a f(x) w(x) dx for all polynomials in F 2n 1.

32 Gauss-Chebyshev Quadrature Domain: [ 1, 1] Weight: (1 x 2 ) 1/2 Formula: Z 1 f(x)(1 x 2 ) 1/2 dx = π 1 n for some ξ [ 1, 1], with quadrature nodes µ 2i 1 x i = cos 2n Arbitrary Domains Want to approximate R b a nx f(x i )+ i=1 π f (2n) (ξ) 2 2n 1 (2n)! (7.2.4) π, i =1,..., n. (7.2.5) f(x) dx for different range, and/or no weight function Linear change of variables x = 1+2(y a)(b a) Multiply the integrand by (1 x 2 ) ± 1/2 (1 x 2 ) 1/2. Z b f(y) dy = b a Z 1 µ (x +1)(b a) f 2 2 a 1 1 x 2 1/2 + a dx (1 x 2 1/2 ) Gauss-Chebyshev quadrature uses the x i Gauss-Chebyshev nodes over [ 1, 1] Z b f(y) dy =. π(b a) nx µ (xi +1)(b a) 1 f + a x 2 i 2n 2 a i=1 1/2

33 Gauss-Hermite Quadrature Domain is [, ] and weight is e x2 Formula: for some ξ (, ). Z f(x)e x2 dx = nx i=1 ω i f(x i )+ n! π f (2n) (ξ) 2 n (2n)! N x i ω i (1) (1) N x i ω i (1) ( 3) (1) ( 1) Normal Random Variables Y is distributed N(µ, σ 2 ). Expectation is integration. Use Gauss-Hermite quadrature: Linear COV x =(y µ)/ 2 σ implies E{f(Y )}= Z. =π 1 2 f(y)e (y µ)2 /(2σ 2) dy = nx ω i f( 2 σx i + µ) i=1 Z f( 2 σx+ µ)e x2 2 σdx where the ω i and x i are the Gauss-Hermite quadrature weights and nodes over [, ].

34 Multidimensional Integration Most economic problems have several dimensions Multiple assets Multiple error terms Multidimensional integrals are much more difficult Simple methods suffer from curse of dimensionality There are methods which avoid curse of dimensionality

35 Product Rules Build product rules from one-dimension rules Let x i,ω i, i =1,,m, be one-dimensional quadrature points and weights in dimension from a Newton-Cotes rule or the Gauss-Legendre rule. The product rule Z [ 1,1] d f(x)dx. = mx mx i 1 =1 i d =1 ω 1 i 1 ω 2 i 2 ω d i d f(x 1 i 1,x 2 i 2,,x d i d ) Gaussian structure prevails Suppose w (x) is weighting function in dimension Define the d-dimensional weighting function. dy W (x) W (x 1,,x d )= w (x ) Product Gaussian rules are based on product orthogonal polynomials. Curse of dimensionality: m d functional evaluations is m d for a d-dimensional problem with m points in each direction. Problem worse for Newton-Cotes rules which are less accurate in R 1. =1

36 General Parametric Approach: Approximating T For each x j, (TV)(x j ) is defined by v j =(TV)(x j )= max u D(x j ) π(u, x j)+β Z ˆV (x + ; a)df (x + x j,u) (12.7.5) In practice, we compute the approximation ˆT v j =(ˆTV)(x j ). =(TV)(x j ) Integration step: for ω j and x j for some numerical quadrature formula Z E{V (x + ; a) x j,u)}= ˆV (x + ; a)df (x + x j,u) Z = ˆV (g(x j,u,ε); a)df (ε). = X ω ˆV (g(x j,u,ε ); a) Maximization step: for x i X, evaluate v i =(T ˆV )(x i ) Hot starts Concave stopping rules Fitting step: Data: (v i,x i ),i=1,,n Objective: find an a R m such that ˆV (x; a) best fits the data Methods: determined by ˆV (x; a)

37 Approximating T with Hermite Data Conventional methods just generate data on V (x j ): Z v j = max π(u, x j)+β ˆV (x + ; a)df (x + x j,u) (12.7.5) u D(x j ) Envelope theorem: If solution u is interior, Z vj 0 = π x (u, x j )+β ˆV (x + ; a)df x (x + x j,u) If solution u is on boundary Z vj 0 = µ + π x (u, x j )+β ˆV (x + ; a)df x (x + x j,u) where µ is a Kuhn-Tucker multiplier Since computing vj 0 is cheap, we should include it in data: Data: (v i,vi 0,x i), i=1,,n Objective: find an a R m such that ˆV (x; a) best fits Hermite data Methods: determined by ˆV (x; a)

38 General Parametric Approach: Value Function Iteration Comparison with discretization guess a ˆV (x; a) (v i,x i ),i=1,,n new a This procedure examines only a finite number of points, but does not assume that future points lie in same finite set. Our choices for the x i are guided by systematic numerical considerations. Synergies Smooth interpolation schemes allow us to use Newton s method in the maximization step. They also make it easier to evaluate the integral in (12.7.5). Finite-horizon problems Value function iteration is only possible procedure since V (x, t) depends on time t. Begin with terminal value function, V (x, T ) Compute approximations for each V (x, t), t = T 1,T 2, etc.

39 Algorithm 12.5: Parametric Dynamic Programming with Value Function Iteration Objective: Solve the Bellman equation, (12.7.1). Step 0: Choose functional form for ˆV (x; a), and choose the approximation grid, X = {x 1,..., x n }. Make initial guess ˆV (x; a 0 ), and choose stopping criterion >0. Step 1: Maximization step: Compute v j =(T ˆV ( ; a i ))(x j ) for all x j X. Step 2: Fitting step: Using the appropriate approximation method, compute the a i+1 R m such that ˆV (x; a i+1 ) approximates the (v i,x i ) data. Step 3: If k ˆV (x; a i ) ˆV (x; a i+1 ) k<, STOP; else go to step 1.

40 Convergence T is a contraction mapping ˆT may be neither monotonic nor a contraction Shape problems An instructive example Figure 2: Shape problems may become worse with value function iteration Shape-preserving approximation will avoid these instabilities

41 Summary: Discretization methods Easy to implement Numerically stable Amenable to many accelerations Poor approximation to continuous problems Continuous approximation methods Can exploit smoothness in problems Possible numerical instabilities Acceleration is less possible

Numerical Methods in Economics

Numerical Methods in Economics Numerical Methods in Economics MIT Press, 1998 Chapter 12 Notes Numerical Dynamic Programming Kenneth L. Judd Hoover Institution November 15, 2002 1 Discrete-Time Dynamic Programming Objective: X: set

More information

Numerical Dynamic Programming

Numerical Dynamic Programming Numerical Dynamic Programming Kenneth L. Judd Hoover Institution Prepared for ICE05 July 20, 2005 - lectures 1 Discrete-Time Dynamic Programming Objective: X: set of states E ( TX D: the set of controls

More information

Dynamic Programming with Hermite Interpolation

Dynamic Programming with Hermite Interpolation Dynamic Programming with Hermite Interpolation Yongyang Cai Hoover Institution, 424 Galvez Mall, Stanford University, Stanford, CA, 94305 Kenneth L. Judd Hoover Institution, 424 Galvez Mall, Stanford University,

More information

Interpolation. 1. Judd, K. Numerical Methods in Economics, Cambridge: MIT Press. Chapter

Interpolation. 1. Judd, K. Numerical Methods in Economics, Cambridge: MIT Press. Chapter Key References: Interpolation 1. Judd, K. Numerical Methods in Economics, Cambridge: MIT Press. Chapter 6. 2. Press, W. et. al. Numerical Recipes in C, Cambridge: Cambridge University Press. Chapter 3

More information

PROJECTION METHODS FOR DYNAMIC MODELS

PROJECTION METHODS FOR DYNAMIC MODELS PROJECTION METHODS FOR DYNAMIC MODELS Kenneth L. Judd Hoover Institution and NBER June 28, 2006 Functional Problems Many problems involve solving for some unknown function Dynamic programming Consumption

More information

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam Jim Lambers MAT 460/560 Fall Semester 2009-10 Practice Final Exam 1. Let f(x) = sin 2x + cos 2x. (a) Write down the 2nd Taylor polynomial P 2 (x) of f(x) centered around x 0 = 0. (b) Write down the corresponding

More information

Interpolation. Chapter Interpolation. 7.2 Existence, Uniqueness and conditioning

Interpolation. Chapter Interpolation. 7.2 Existence, Uniqueness and conditioning 76 Chapter 7 Interpolation 7.1 Interpolation Definition 7.1.1. Interpolation of a given function f defined on an interval [a,b] by a polynomial p: Given a set of specified points {(t i,y i } n with {t

More information

Dynamic Programming. Macro 3: Lecture 2. Mark Huggett 2. 2 Georgetown. September, 2016

Dynamic Programming. Macro 3: Lecture 2. Mark Huggett 2. 2 Georgetown. September, 2016 Macro 3: Lecture 2 Mark Huggett 2 2 Georgetown September, 2016 Three Maps: Review of Lecture 1 X = R 1 + and X grid = {x 1,..., x n } X where x i+1 > x i 1. T (v)(x) = max u(f (x) y) + βv(y) s.t. y Γ 1

More information

Projection Methods. Felix Kubler 1. October 10, DBF, University of Zurich and Swiss Finance Institute

Projection Methods. Felix Kubler 1. October 10, DBF, University of Zurich and Swiss Finance Institute Projection Methods Felix Kubler 1 1 DBF, University of Zurich and Swiss Finance Institute October 10, 2017 Felix Kubler Comp.Econ. Gerzensee, Ch5 October 10, 2017 1 / 55 Motivation In many dynamic economic

More information

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn Review Taylor Series and Error Analysis Roots of Equations Linear Algebraic Equations Optimization Numerical Differentiation and Integration Ordinary Differential Equations Partial Differential Equations

More information

Lecture 1: Dynamic Programming

Lecture 1: Dynamic Programming Lecture 1: Dynamic Programming Fatih Guvenen November 2, 2016 Fatih Guvenen Lecture 1: Dynamic Programming November 2, 2016 1 / 32 Goal Solve V (k, z) =max c,k 0 u(c)+ E(V (k 0, z 0 ) z) c + k 0 =(1 +

More information

DYNAMIC LECTURE 5: DISCRETE TIME INTERTEMPORAL OPTIMIZATION

DYNAMIC LECTURE 5: DISCRETE TIME INTERTEMPORAL OPTIMIZATION DYNAMIC LECTURE 5: DISCRETE TIME INTERTEMPORAL OPTIMIZATION UNIVERSITY OF MARYLAND: ECON 600. Alternative Methods of Discrete Time Intertemporal Optimization We will start by solving a discrete time intertemporal

More information

Lecture 4: Dynamic Programming

Lecture 4: Dynamic Programming Lecture 4: Dynamic Programming Fatih Guvenen January 10, 2016 Fatih Guvenen Lecture 4: Dynamic Programming January 10, 2016 1 / 30 Goal Solve V (k, z) =max c,k 0 u(c)+ E(V (k 0, z 0 ) z) c + k 0 =(1 +

More information

LECTURE 16 GAUSS QUADRATURE In general for Newton-Cotes (equispaced interpolation points/ data points/ integration points/ nodes).

LECTURE 16 GAUSS QUADRATURE In general for Newton-Cotes (equispaced interpolation points/ data points/ integration points/ nodes). CE 025 - Lecture 6 LECTURE 6 GAUSS QUADRATURE In general for ewton-cotes (equispaced interpolation points/ data points/ integration points/ nodes). x E x S fx dx hw' o f o + w' f + + w' f + E 84 f 0 f

More information

12.0 Properties of orthogonal polynomials

12.0 Properties of orthogonal polynomials 12.0 Properties of orthogonal polynomials In this section we study orthogonal polynomials to use them for the construction of quadrature formulas investigate projections on polynomial spaces and their

More information

Lecture 10 Polynomial interpolation

Lecture 10 Polynomial interpolation Lecture 10 Polynomial interpolation Weinan E 1,2 and Tiejun Li 2 1 Department of Mathematics, Princeton University, weinan@princeton.edu 2 School of Mathematical Sciences, Peking University, tieli@pku.edu.cn

More information

Fixed point iteration and root finding

Fixed point iteration and root finding Fixed point iteration and root finding The sign function is defined as x > 0 sign(x) = 0 x = 0 x < 0. It can be evaluated via an iteration which is useful for some problems. One such iteration is given

More information

A Quick Introduction to Numerical Methods

A Quick Introduction to Numerical Methods Chapter 5 A Quick Introduction to Numerical Methods One of the main advantages of the recursive approach is that we can use the computer to solve numerically interesting models. There is a wide variety

More information

Basic Deterministic Dynamic Programming

Basic Deterministic Dynamic Programming Basic Deterministic Dynamic Programming Timothy Kam School of Economics & CAMA Australian National University ECON8022, This version March 17, 2008 Motivation What do we do? Outline Deterministic IHDP

More information

Method of Finite Elements I

Method of Finite Elements I Method of Finite Elements I PhD Candidate - Charilaos Mylonas HIL H33.1 and Boundary Conditions, 26 March, 2018 Institute of Structural Engineering Method of Finite Elements I 1 Outline 1 2 Penalty method

More information

Numerical Analysis Preliminary Exam 10.00am 1.00pm, January 19, 2018

Numerical Analysis Preliminary Exam 10.00am 1.00pm, January 19, 2018 Numerical Analysis Preliminary Exam 0.00am.00pm, January 9, 208 Instructions. You have three hours to complete this exam. Submit solutions to four (and no more) of the following six problems. Please start

More information

Chapter 4: Interpolation and Approximation. October 28, 2005

Chapter 4: Interpolation and Approximation. October 28, 2005 Chapter 4: Interpolation and Approximation October 28, 2005 Outline 1 2.4 Linear Interpolation 2 4.1 Lagrange Interpolation 3 4.2 Newton Interpolation and Divided Differences 4 4.3 Interpolation Error

More information

ADVANCED MACROECONOMIC TECHNIQUES NOTE 3a

ADVANCED MACROECONOMIC TECHNIQUES NOTE 3a 316-406 ADVANCED MACROECONOMIC TECHNIQUES NOTE 3a Chris Edmond hcpedmond@unimelb.edu.aui Dynamic programming and the growth model Dynamic programming and closely related recursive methods provide an important

More information

Numerical integration and differentiation. Unit IV. Numerical Integration and Differentiation. Plan of attack. Numerical integration.

Numerical integration and differentiation. Unit IV. Numerical Integration and Differentiation. Plan of attack. Numerical integration. Unit IV Numerical Integration and Differentiation Numerical integration and differentiation quadrature classical formulas for equally spaced nodes improper integrals Gaussian quadrature and orthogonal

More information

MA2501 Numerical Methods Spring 2015

MA2501 Numerical Methods Spring 2015 Norwegian University of Science and Technology Department of Mathematics MA5 Numerical Methods Spring 5 Solutions to exercise set 9 Find approximate values of the following integrals using the adaptive

More information

Preliminary Examination in Numerical Analysis

Preliminary Examination in Numerical Analysis Department of Applied Mathematics Preliminary Examination in Numerical Analysis August 7, 06, 0 am pm. Submit solutions to four (and no more) of the following six problems. Show all your work, and justify

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 7 Interpolation Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign Copyright c 2002. Reproduction permitted

More information

High-dimensional Problems in Finance and Economics. Thomas M. Mertens

High-dimensional Problems in Finance and Economics. Thomas M. Mertens High-dimensional Problems in Finance and Economics Thomas M. Mertens NYU Stern Risk Economics Lab April 17, 2012 1 / 78 Motivation Many problems in finance and economics are high dimensional. Dynamic Optimization:

More information

Integration, differentiation, and root finding. Phys 420/580 Lecture 7

Integration, differentiation, and root finding. Phys 420/580 Lecture 7 Integration, differentiation, and root finding Phys 420/580 Lecture 7 Numerical integration Compute an approximation to the definite integral I = b Find area under the curve in the interval Trapezoid Rule:

More information

Discrete State Space Methods for Dynamic Economies

Discrete State Space Methods for Dynamic Economies Discrete State Space Methods for Dynamic Economies A Brief Introduction Craig Burnside Duke University September 2006 Craig Burnside (Duke University) Discrete State Space Methods September 2006 1 / 42

More information

Scientific Computing

Scientific Computing 2301678 Scientific Computing Chapter 2 Interpolation and Approximation Paisan Nakmahachalasint Paisan.N@chula.ac.th Chapter 2 Interpolation and Approximation p. 1/66 Contents 1. Polynomial interpolation

More information

Dynamic Programming Theorems

Dynamic Programming Theorems Dynamic Programming Theorems Prof. Lutz Hendricks Econ720 September 11, 2017 1 / 39 Dynamic Programming Theorems Useful theorems to characterize the solution to a DP problem. There is no reason to remember

More information

Projection Methods. Michal Kejak CERGE CERGE-EI ( ) 1 / 29

Projection Methods. Michal Kejak CERGE CERGE-EI ( ) 1 / 29 Projection Methods Michal Kejak CERGE CERGE-EI ( ) 1 / 29 Introduction numerical methods for dynamic economies nite-di erence methods initial value problems (Euler method) two-point boundary value problems

More information

Outline. 1 Interpolation. 2 Polynomial Interpolation. 3 Piecewise Polynomial Interpolation

Outline. 1 Interpolation. 2 Polynomial Interpolation. 3 Piecewise Polynomial Interpolation Outline Interpolation 1 Interpolation 2 3 Michael T. Heath Scientific Computing 2 / 56 Interpolation Motivation Choosing Interpolant Existence and Uniqueness Basic interpolation problem: for given data

More information

ECON 582: Dynamic Programming (Chapter 6, Acemoglu) Instructor: Dmytro Hryshko

ECON 582: Dynamic Programming (Chapter 6, Acemoglu) Instructor: Dmytro Hryshko ECON 582: Dynamic Programming (Chapter 6, Acemoglu) Instructor: Dmytro Hryshko Indirect Utility Recall: static consumer theory; J goods, p j is the price of good j (j = 1; : : : ; J), c j is consumption

More information

University of Warwick, EC9A0 Maths for Economists Lecture Notes 10: Dynamic Programming

University of Warwick, EC9A0 Maths for Economists Lecture Notes 10: Dynamic Programming University of Warwick, EC9A0 Maths for Economists 1 of 63 University of Warwick, EC9A0 Maths for Economists Lecture Notes 10: Dynamic Programming Peter J. Hammond Autumn 2013, revised 2014 University of

More information

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation Lecture slides based on the textbook Scientific Computing: An Introductory Survey by Michael T. Heath, copyright c 2018 by the Society for Industrial and Applied Mathematics. http://www.siam.org/books/cl80

More information

Chapter 3. Dynamic Programming

Chapter 3. Dynamic Programming Chapter 3. Dynamic Programming This chapter introduces basic ideas and methods of dynamic programming. 1 It sets out the basic elements of a recursive optimization problem, describes the functional equation

More information

University of Houston, Department of Mathematics Numerical Analysis, Fall 2005

University of Houston, Department of Mathematics Numerical Analysis, Fall 2005 4 Interpolation 4.1 Polynomial interpolation Problem: LetP n (I), n ln, I := [a,b] lr, be the linear space of polynomials of degree n on I, P n (I) := { p n : I lr p n (x) = n i=0 a i x i, a i lr, 0 i

More information

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by 1. QUESTION (a) Given a nth degree Taylor polynomial P n (x) of a function f(x), expanded about x = x 0, write down the Lagrange formula for the truncation error, carefully defining all its elements. How

More information

Slides II - Dynamic Programming

Slides II - Dynamic Programming Slides II - Dynamic Programming Julio Garín University of Georgia Macroeconomic Theory II (Ph.D.) Spring 2017 Macroeconomic Theory II Slides II - Dynamic Programming Spring 2017 1 / 32 Outline 1. Lagrangian

More information

COURSE Numerical integration of functions (continuation) 3.3. The Romberg s iterative generation method

COURSE Numerical integration of functions (continuation) 3.3. The Romberg s iterative generation method COURSE 7 3. Numerical integration of functions (continuation) 3.3. The Romberg s iterative generation method The presence of derivatives in the remainder difficulties in applicability to practical problems

More information

Cubic Splines. Antony Jameson. Department of Aeronautics and Astronautics, Stanford University, Stanford, California, 94305

Cubic Splines. Antony Jameson. Department of Aeronautics and Astronautics, Stanford University, Stanford, California, 94305 Cubic Splines Antony Jameson Department of Aeronautics and Astronautics, Stanford University, Stanford, California, 94305 1 References on splines 1. J. H. Ahlberg, E. N. Nilson, J. H. Walsh. Theory of

More information

November 20, Interpolation, Extrapolation & Polynomial Approximation

November 20, Interpolation, Extrapolation & Polynomial Approximation Interpolation, Extrapolation & Polynomial Approximation November 20, 2016 Introduction In many cases we know the values of a function f (x) at a set of points x 1, x 2,..., x N, but we don t have the analytic

More information

Numerical Analysis Preliminary Exam 10 am to 1 pm, August 20, 2018

Numerical Analysis Preliminary Exam 10 am to 1 pm, August 20, 2018 Numerical Analysis Preliminary Exam 1 am to 1 pm, August 2, 218 Instructions. You have three hours to complete this exam. Submit solutions to four (and no more) of the following six problems. Please start

More information

Q 0 x if x 0 x x 1. S 1 x if x 1 x x 2. i 0,1,...,n 1, and L x L n 1 x if x n 1 x x n

Q 0 x if x 0 x x 1. S 1 x if x 1 x x 2. i 0,1,...,n 1, and L x L n 1 x if x n 1 x x n . - Piecewise Linear-Quadratic Interpolation Piecewise-polynomial Approximation: Problem: Givenn pairs of data points x i, y i, i,,...,n, find a piecewise-polynomial Sx S x if x x x Sx S x if x x x 2 :

More information

(0, 0), (1, ), (2, ), (3, ), (4, ), (5, ), (6, ).

(0, 0), (1, ), (2, ), (3, ), (4, ), (5, ), (6, ). 1 Interpolation: The method of constructing new data points within the range of a finite set of known data points That is if (x i, y i ), i = 1, N are known, with y i the dependent variable and x i [x

More information

Examination paper for TMA4215 Numerical Mathematics

Examination paper for TMA4215 Numerical Mathematics Department of Mathematical Sciences Examination paper for TMA425 Numerical Mathematics Academic contact during examination: Trond Kvamsdal Phone: 93058702 Examination date: 6th of December 207 Examination

More information

1. Nonlinear Equations. This lecture note excerpted parts from Michael Heath and Max Gunzburger. f(x) = 0

1. Nonlinear Equations. This lecture note excerpted parts from Michael Heath and Max Gunzburger. f(x) = 0 Numerical Analysis 1 1. Nonlinear Equations This lecture note excerpted parts from Michael Heath and Max Gunzburger. Given function f, we seek value x for which where f : D R n R n is nonlinear. f(x) =

More information

Stat 451 Lecture Notes Numerical Integration

Stat 451 Lecture Notes Numerical Integration Stat 451 Lecture Notes 03 12 Numerical Integration Ryan Martin UIC www.math.uic.edu/~rgmartin 1 Based on Chapter 5 in Givens & Hoeting, and Chapters 4 & 18 of Lange 2 Updated: February 11, 2016 1 / 29

More information

Section 6.6 Gaussian Quadrature

Section 6.6 Gaussian Quadrature Section 6.6 Gaussian Quadrature Key Terms: Method of undetermined coefficients Nonlinear systems Gaussian quadrature Error Legendre polynomials Inner product Adapted from http://pathfinder.scar.utoronto.ca/~dyer/csca57/book_p/node44.html

More information

Interpolation and extrapolation

Interpolation and extrapolation Interpolation and extrapolation Alexander Khanov PHYS6260: Experimental Methods is HEP Oklahoma State University October 30, 207 Interpolation/extrapolation vs fitting Formulation of the problem: there

More information

Function Approximation

Function Approximation 1 Function Approximation This is page i Printer: Opaque this 1.1 Introduction In this chapter we discuss approximating functional forms. Both in econometric and in numerical problems, the need for an approximating

More information

Department of Applied Mathematics and Theoretical Physics. AMA 204 Numerical analysis. Exam Winter 2004

Department of Applied Mathematics and Theoretical Physics. AMA 204 Numerical analysis. Exam Winter 2004 Department of Applied Mathematics and Theoretical Physics AMA 204 Numerical analysis Exam Winter 2004 The best six answers will be credited All questions carry equal marks Answer all parts of each question

More information

3.1 Interpolation and the Lagrange Polynomial

3.1 Interpolation and the Lagrange Polynomial MATH 4073 Chapter 3 Interpolation and Polynomial Approximation Fall 2003 1 Consider a sample x x 0 x 1 x n y y 0 y 1 y n. Can we get a function out of discrete data above that gives a reasonable estimate

More information

Contents. An example 5. Mathematical Preliminaries 13. Dynamic programming under certainty 29. Numerical methods 41. Some applications 57

Contents. An example 5. Mathematical Preliminaries 13. Dynamic programming under certainty 29. Numerical methods 41. Some applications 57 T H O M A S D E M U Y N C K DY N A M I C O P T I M I Z AT I O N Contents An example 5 Mathematical Preliminaries 13 Dynamic programming under certainty 29 Numerical methods 41 Some applications 57 Stochastic

More information

Lecture Note 3: Polynomial Interpolation. Xiaoqun Zhang Shanghai Jiao Tong University

Lecture Note 3: Polynomial Interpolation. Xiaoqun Zhang Shanghai Jiao Tong University Lecture Note 3: Polynomial Interpolation Xiaoqun Zhang Shanghai Jiao Tong University Last updated: October 24, 2013 1.1 Introduction We first look at some examples. Lookup table for f(x) = 2 π x 0 e x2

More information

ADVANCED MACRO TECHNIQUES Midterm Solutions

ADVANCED MACRO TECHNIQUES Midterm Solutions 36-406 ADVANCED MACRO TECHNIQUES Midterm Solutions Chris Edmond hcpedmond@unimelb.edu.aui This exam lasts 90 minutes and has three questions, each of equal marks. Within each question there are a number

More information

Approximation theory

Approximation theory Approximation theory Xiaojing Ye, Math & Stat, Georgia State University Spring 2019 Numerical Analysis II Xiaojing Ye, Math & Stat, Georgia State University 1 1 1.3 6 8.8 2 3.5 7 10.1 Least 3squares 4.2

More information

Lecture Notes 10: Dynamic Programming

Lecture Notes 10: Dynamic Programming University of Warwick, EC9A0 Maths for Economists Peter J. Hammond 1 of 81 Lecture Notes 10: Dynamic Programming Peter J. Hammond 2018 September 28th University of Warwick, EC9A0 Maths for Economists Peter

More information

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University Lecture Note 3: Interpolation and Polynomial Approximation Xiaoqun Zhang Shanghai Jiao Tong University Last updated: October 10, 2015 2 Contents 1.1 Introduction................................ 3 1.1.1

More information

A simple macro dynamic model with endogenous saving rate: the representative agent model

A simple macro dynamic model with endogenous saving rate: the representative agent model A simple macro dynamic model with endogenous saving rate: the representative agent model Virginia Sánchez-Marcos Macroeconomics, MIE-UNICAN Macroeconomics (MIE-UNICAN) A simple macro dynamic model with

More information

COURSE Iterative methods for solving linear systems

COURSE Iterative methods for solving linear systems COURSE 0 4.3. Iterative methods for solving linear systems Because of round-off errors, direct methods become less efficient than iterative methods for large systems (>00 000 variables). An iterative scheme

More information

INTERPOLATION. and y i = cos x i, i = 0, 1, 2 This gives us the three points. Now find a quadratic polynomial. p(x) = a 0 + a 1 x + a 2 x 2.

INTERPOLATION. and y i = cos x i, i = 0, 1, 2 This gives us the three points. Now find a quadratic polynomial. p(x) = a 0 + a 1 x + a 2 x 2. INTERPOLATION Interpolation is a process of finding a formula (often a polynomial) whose graph will pass through a given set of points (x, y). As an example, consider defining and x 0 = 0, x 1 = π/4, x

More information

In numerical analysis quadrature refers to the computation of definite integrals.

In numerical analysis quadrature refers to the computation of definite integrals. Numerical Quadrature In numerical analysis quadrature refers to the computation of definite integrals. f(x) a x i x i+1 x i+2 b x A traditional way to perform numerical integration is to take a piece of

More information

n 1 f n 1 c 1 n+1 = c 1 n $ c 1 n 1. After taking logs, this becomes

n 1 f n 1 c 1 n+1 = c 1 n $ c 1 n 1. After taking logs, this becomes Root finding: 1 a The points {x n+1, }, {x n, f n }, {x n 1, f n 1 } should be co-linear Say they lie on the line x + y = This gives the relations x n+1 + = x n +f n = x n 1 +f n 1 = Eliminating α and

More information

Numerical integration - I. M. Peressi - UniTS - Laurea Magistrale in Physics Laboratory of Computational Physics - Unit V

Numerical integration - I. M. Peressi - UniTS - Laurea Magistrale in Physics Laboratory of Computational Physics - Unit V Numerical integration - I M. Peressi - UniTS - Laurea Magistrale in Physics Laboratory of Computational Physics - Unit V deterministic methods in 1D equispaced points (trapezoidal, Simpson...), others...

More information

Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. What for x = 1.2?

Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. What for x = 1.2? Applied Numerical Analysis Interpolation Lecturer: Emad Fatemizadeh Interpolation Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. 0 1 4 1-3 3 9 What for x = 1.? Interpolation

More information

Mathematics for Engineers. Numerical mathematics

Mathematics for Engineers. Numerical mathematics Mathematics for Engineers Numerical mathematics Integers Determine the largest representable integer with the intmax command. intmax ans = int32 2147483647 2147483647+1 ans = 2.1475e+09 Remark The set

More information

Outline Today s Lecture

Outline Today s Lecture Outline Today s Lecture finish Euler Equations and Transversality Condition Principle of Optimality: Bellman s Equation Study of Bellman equation with bounded F contraction mapping and theorem of the maximum

More information

CS 257: Numerical Methods

CS 257: Numerical Methods CS 57: Numerical Methods Final Exam Study Guide Version 1.00 Created by Charles Feng http://www.fenguin.net CS 57: Numerical Methods Final Exam Study Guide 1 Contents 1 Introductory Matter 3 1.1 Calculus

More information

Optimal Control. McGill COMP 765 Oct 3 rd, 2017

Optimal Control. McGill COMP 765 Oct 3 rd, 2017 Optimal Control McGill COMP 765 Oct 3 rd, 2017 Classical Control Quiz Question 1: Can a PID controller be used to balance an inverted pendulum: A) That starts upright? B) That must be swung-up (perhaps

More information

Differentiation and Integration

Differentiation and Integration Differentiation and Integration (Lectures on Numerical Analysis for Economists II) Jesús Fernández-Villaverde 1 and Pablo Guerrón 2 February 12, 2018 1 University of Pennsylvania 2 Boston College Motivation

More information

Introduction to Uncertainty Quantification in Computational Science Handout #3

Introduction to Uncertainty Quantification in Computational Science Handout #3 Introduction to Uncertainty Quantification in Computational Science Handout #3 Gianluca Iaccarino Department of Mechanical Engineering Stanford University June 29 - July 1, 2009 Scuola di Dottorato di

More information

Numerical Integration (Quadrature) Another application for our interpolation tools!

Numerical Integration (Quadrature) Another application for our interpolation tools! Numerical Integration (Quadrature) Another application for our interpolation tools! Integration: Area under a curve Curve = data or function Integrating data Finite number of data points spacing specified

More information

Outline. 1 Numerical Integration. 2 Numerical Differentiation. 3 Richardson Extrapolation

Outline. 1 Numerical Integration. 2 Numerical Differentiation. 3 Richardson Extrapolation Outline Numerical Integration Numerical Differentiation Numerical Integration Numerical Differentiation 3 Michael T. Heath Scientific Computing / 6 Main Ideas Quadrature based on polynomial interpolation:

More information

Value Function Iteration

Value Function Iteration Value Function Iteration (Lectures on Solution Methods for Economists II) Jesús Fernández-Villaverde 1 and Pablo Guerrón 2 February 26, 2018 1 University of Pennsylvania 2 Boston College Theoretical Background

More information

Numerical techniques to solve equations

Numerical techniques to solve equations Programming for Applications in Geomatics, Physical Geography and Ecosystem Science (NGEN13) Numerical techniques to solve equations vaughan.phillips@nateko.lu.se Vaughan Phillips Associate Professor,

More information

Projection. Wouter J. Den Haan London School of Economics. c by Wouter J. Den Haan

Projection. Wouter J. Den Haan London School of Economics. c by Wouter J. Den Haan Projection Wouter J. Den Haan London School of Economics c by Wouter J. Den Haan Model [ ] ct ν = E t βct+1 ν αz t+1kt+1 α 1 c t + k t+1 = z t k α t ln(z t+1 ) = ρ ln (z t ) + ε t+1 ε t+1 N(0, σ 2 ) k

More information

Function approximation

Function approximation Week 9: Monday, Mar 26 Function approximation A common task in scientific computing is to approximate a function. The approximated function might be available only through tabulated data, or it may be

More information

Lecture 4: Numerical solution of ordinary differential equations

Lecture 4: Numerical solution of ordinary differential equations Lecture 4: Numerical solution of ordinary differential equations Department of Mathematics, ETH Zürich General explicit one-step method: Consistency; Stability; Convergence. High-order methods: Taylor

More information

Approximate Dynamic Programming

Approximate Dynamic Programming Master MVA: Reinforcement Learning Lecture: 5 Approximate Dynamic Programming Lecturer: Alessandro Lazaric http://researchers.lille.inria.fr/ lazaric/webpage/teaching.html Objectives of the lecture 1.

More information

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b)

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b) Numerical Methods - PROBLEMS. The Taylor series, about the origin, for log( + x) is x x2 2 + x3 3 x4 4 + Find an upper bound on the magnitude of the truncation error on the interval x.5 when log( + x)

More information

NBER WORKING PAPER SERIES SOLVING DYNAMIC PROGRAMMING PROBLEMS ON A COMPUTATIONAL GRID. Yongyang Cai Kenneth L. Judd Greg Thain Stephen J.

NBER WORKING PAPER SERIES SOLVING DYNAMIC PROGRAMMING PROBLEMS ON A COMPUTATIONAL GRID. Yongyang Cai Kenneth L. Judd Greg Thain Stephen J. NBER WORKING PAPER SERIES SOLVING DYNAMIC PROGRAMMING PROBLEMS ON A COMPUTATIONAL GRID Yongyang Cai Kenneth L. Judd Greg Thain Stephen J. Wright Working Paper 18714 http://www.nber.org/papers/w18714 NATIONAL

More information

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form Qualifying exam for numerical analysis (Spring 2017) Show your work for full credit. If you are unable to solve some part, attempt the subsequent parts. 1. Consider the following finite difference: f (0)

More information

CS412: Introduction to Numerical Methods

CS412: Introduction to Numerical Methods CS412: Introduction to Numerical Methods MIDTERM #1 2:30PM - 3:45PM, Tuesday, 03/10/2015 Instructions: This exam is a closed book and closed notes exam, i.e., you are not allowed to consult any textbook,

More information

Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20

Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20 Exam 2 Average: 85.6 Median: 87.0 Maximum: 100.0 Minimum: 55.0 Standard Deviation: 10.42 Fall 2011 1 Today s class Multiple Variable Linear Regression Polynomial Interpolation Lagrange Interpolation Newton

More information

Distributed Optimization. Song Chong EE, KAIST

Distributed Optimization. Song Chong EE, KAIST Distributed Optimization Song Chong EE, KAIST songchong@kaist.edu Dynamic Programming for Path Planning A path-planning problem consists of a weighted directed graph with a set of n nodes N, directed links

More information

Hoover Institution, Stanford University and NBER. University of Alicante and Hoover Institution, Stanford University

Hoover Institution, Stanford University and NBER. University of Alicante and Hoover Institution, Stanford University Supplementary Material Supplement to Numerically stable and accurate stochastic simulation approaches for solving dynamic economic models : Appendices (Quantitative Economics, Vol. 2, No. 2, July 2011,

More information

Numerical Methods for Differential Equations Mathematical and Computational Tools

Numerical Methods for Differential Equations Mathematical and Computational Tools Numerical Methods for Differential Equations Mathematical and Computational Tools Gustaf Söderlind Numerical Analysis, Lund University Contents V4.16 Part 1. Vector norms, matrix norms and logarithmic

More information

In manycomputationaleconomicapplications, one must compute thede nite n

In manycomputationaleconomicapplications, one must compute thede nite n Chapter 6 Numerical Integration In manycomputationaleconomicapplications, one must compute thede nite n integral of a real-valued function f de ned on some interval I of

More information

The problems that follow illustrate the methods covered in class. They are typical of the types of problems that will be on the tests.

The problems that follow illustrate the methods covered in class. They are typical of the types of problems that will be on the tests. NUMERICAL ANALYSIS PRACTICE PROBLEMS JAMES KEESLING The problems that follow illustrate the methods covered in class. They are typical of the types of problems that will be on the tests.. Solving Equations

More information

Chapter 1: A Brief Review of Maximum Likelihood, GMM, and Numerical Tools. Joan Llull. Microeconometrics IDEA PhD Program

Chapter 1: A Brief Review of Maximum Likelihood, GMM, and Numerical Tools. Joan Llull. Microeconometrics IDEA PhD Program Chapter 1: A Brief Review of Maximum Likelihood, GMM, and Numerical Tools Joan Llull Microeconometrics IDEA PhD Program Maximum Likelihood Chapter 1. A Brief Review of Maximum Likelihood, GMM, and Numerical

More information

Numerical Methods I: Polynomial Interpolation

Numerical Methods I: Polynomial Interpolation 1/31 Numerical Methods I: Polynomial Interpolation Georg Stadler Courant Institute, NYU stadler@cims.nyu.edu November 16, 2017 lassical polynomial interpolation Given f i := f(t i ), i =0,...,n, we would

More information

NONLINEAR CLASSIFICATION AND REGRESSION. J. Elder CSE 4404/5327 Introduction to Machine Learning and Pattern Recognition

NONLINEAR CLASSIFICATION AND REGRESSION. J. Elder CSE 4404/5327 Introduction to Machine Learning and Pattern Recognition NONLINEAR CLASSIFICATION AND REGRESSION Nonlinear Classification and Regression: Outline 2 Multi-Layer Perceptrons The Back-Propagation Learning Algorithm Generalized Linear Models Radial Basis Function

More information

Chapter 1 Numerical approximation of data : interpolation, least squares method

Chapter 1 Numerical approximation of data : interpolation, least squares method Chapter 1 Numerical approximation of data : interpolation, least squares method I. Motivation 1 Approximation of functions Evaluation of a function Which functions (f : R R) can be effectively evaluated

More information

We consider the problem of finding a polynomial that interpolates a given set of values:

We consider the problem of finding a polynomial that interpolates a given set of values: Chapter 5 Interpolation 5. Polynomial Interpolation We consider the problem of finding a polynomial that interpolates a given set of values: x x 0 x... x n y y 0 y... y n where the x i are all distinct.

More information

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel LECTURE NOTES on ELEMENTARY NUMERICAL METHODS Eusebius Doedel TABLE OF CONTENTS Vector and Matrix Norms 1 Banach Lemma 20 The Numerical Solution of Linear Systems 25 Gauss Elimination 25 Operation Count

More information

8.3 Numerical Quadrature, Continued

8.3 Numerical Quadrature, Continued 8.3 Numerical Quadrature, Continued Ulrich Hoensch Friday, October 31, 008 Newton-Cotes Quadrature General Idea: to approximate the integral I (f ) of a function f : [a, b] R, use equally spaced nodes

More information

41903: Introduction to Nonparametrics

41903: Introduction to Nonparametrics 41903: Notes 5 Introduction Nonparametrics fundamentally about fitting flexible models: want model that is flexible enough to accommodate important patterns but not so flexible it overspecializes to specific

More information