function [f,v] = dlqrriccati(a,b,q,r,tol,maxit) % %DLQRRICCATI Discrete linear quadratic regulator solution % [f,v] = dlqrdouble(a,b,q,r) solves the Riccati equation % associated with the real discrete time optimal linear regulator % problem of the form % % min sum {x'qx + u'ru} % st x(t+1) = ax(t) + bu(t) % % Returned are the matrices f and v such that the optimal decision rule % is -fx and the value function is x'vx. tol and maxit are optional % parameters. If they both are not inputted then they are given % default values. See the m-file riccati.m for a description of % tol and maxit. % % ALGORITHM: Riccati Equation Iteration % REFERENCES: E.W. Anderson, L.P. Hansen, E.R McGrattan and T.J Sargent(1996) % WRITTEN BY: Evan W. Anderson December 1, 1994 if nargin < 6, tol = 1e-15; maxit = 1e4; end [v,info] = riccati(a,b,q,r,tol,maxit,eye(size(a))); f = (b'*v*b + r)\b'*v*a;