No BSD License
-
[P,R,eig]=solve_deterministic...
PURPOSE: finds matrices P,R such that
-
[RR,PP,SS1,SS2,QQ1,QQ2]=state...
PURPOSE: set chosen variables as state variables in a model in the
-
gradient(A,B,C,V,W,P,R,S1,S2,...
PURPOSE: finds first differential of matrices representing solution with
-
gsch_order(U,V,TA,TB,SELECT);
PURPOSE: returns ordered generalized Shur decomposition
-
gschur(A,B,COND);
PURPOSE: returns ordered generalized Schur decomposition of a matrix pair (A,B)
-
gsylvester(A,B,C,D,E,F,versio...
PURPOSE: solves the generalized Sylvester equations:
-
gsylvester_schur(A,B,C,D,E,F)
PURPOSE: solves the generalized Sylvester equation:
-
linear2ss(A,B,C,V,W,xi,do_red...
PURPOSE: solves model of the form
-
lineareq(A,B,method,tol)
-
model_reduction(A,B,method)
PURPOSE: reduces dimension of the problem of finding matrices R, P, such that AR = BRP
-
null2(A,method,tol)
PURPOSE: returns an orthonormal basis of the null space and range of A
-
putv(A,method,tol)
-
rank2(A,tol)
PURPOSE: estimates matrix rank of an triangular matrix
-
schur_ord(A,B,xi)
PURPOSE: performs generalized Schur decomposition, eigenvalues lambda,
-
solve_stochastic(A,B,V,W,R,me...
PURPOSE: solves stochastic part of the mdel
-
state_check(K,R)
PURPOSE: checks whether variables defined by the matrix K can be chosen
-
state_find(K,R)
PURPOSE: finds whether some additional variable can be chosen as state variables
-
contents.m
-
demo.m
-
View all files
from
Solution to Linear Rational Expectations Models
by Pawel Kowal
Solves linear rational expectation models, delivers derivatives of solutions
|
| state_check(K,R)
|
function [info,N] = state_check(K,R)
% PURPOSE: checks whether variables defined by the matrix K can be chosen
% as state variables
%
% as state variables are taken variables
% x_t = K y_t
%
% if variables x_t cannot be chosen as state variables, then the
% matrix N presents relations between variables x_t, that
% always holds in the model:
% Nx_t = 0
%
% ---------------------------------------------------
% USAGE: state_check(K,R)
% where:
% K a matrix representing state variables
% R a matrix determining observations in
% the system
% u_t = P u_t-1 + V epsilon_t
% y_t = R u_t + W epsilon_t
%
% Output:
% info 0 if selected variables may not
% represent state variables, 1 otherwise
% N matrix representing relations between variables x_t, that
% always holds in the model
%
% COMMENTS:
%
% Copyright (c) Pawel Kowal (2006)
% All rights reserved
% LREM_SOLVE toolbox is available free for noncommercial academic use only.
% pkowal3@sgh.waw.pl
R = K*R;
S = sum(abs(R),2);
I = find(S==0);
for i=1:1:length(I)
warning(['selected variable ' int2str(I(i)) ' may not be a state variable']);
end
[Q,R,E] = qr(R);
[Abar,U,k] = putv(R,1);
if k < size(R,1)
info = 0;
else
info = 1;
end
if nargout==2
N = U(:,k+1:end)';
end
|
|
Contact us at files@mathworks.com