-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgess.m
35 lines (24 loc) · 1.39 KB
/
gess.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% Main program for "Precautionary Price Stickiness"
% version November 2009, rootfinding on wbar
% Solve general equilibrium steady-state searching for the wage that satisfies the aggregate price identity
%clear all;
tic;
global fzeroiter
if exist('GE_ss.mat','file'), delete GE_ss.mat, end;
fzeroiter = 0; % reset iteration counter
param; % load macro parameters and the guess for wages "wflex"
adjparams;
options = optimset('Display','off','TolFun',tol); % set convergence tolerance level and silent mode
[wbar,fval,exitflag] = fzero('Pidentity',wflex,options); % find equilibrium wage given "wflex" as inital guess
if abs(fval)>tol, fval; warning('Convergence failure'); end % check convergence
clear;
load GE_ss; % load steady-state objects into workspace
clear data;
%if adjtype<5, calcstats_ssdp; else calcstats; end % calculate steady-state statistics
calcstats; %NOW USE SAME PROGRAM FOR ALL VERSIONS
if showconverge
printstats % print steady-state statistics
% plotfigs % plot steady-state graphs
fprintf('\n')
fprintf('Elapsed time: %d seconds', round(toc))
end