-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_illustrations.m
57 lines (42 loc) · 1.33 KB
/
run_illustrations.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
% This script creates the figures used in Section 4
addpath('matlabinclude');
addpath('autotrade');
addpath('..');
clear
clc
%% 2: Persistently heterogeneous consumer economy
close all;
% common
mp = setparams.default(); % parameters used for illustration
mp.ntypes = 2;
mp.ncartypes=1; % switch to 1 car type
mp.lbl_cartypes = {' '}; % no label for the only car
s = trmodel.index(mp);
% 1. Normal transaction cost
% 1.a set parameters
mp.transcost = 0;
mp = trmodel.update_mp(mp);
% 1.b solve model
[sol]=equilibrium.solve(mp, s); % solve model in baseline
% 1.c graphs
f = graphs.agg_holdings(mp,s,sol);
ylim = get(gca, 'ylim');
legend('off');
saveas(f, 'results/illustration/example_holdings_tc_0.eps', 'epsc');
f1 = graphs.prices_with_hom(mp,s,sol);
legend('off');
saveas(f1, 'results/illustration/example_prices_tc_0.eps', 'epsc');
% 2. With high transaction costs
% 2.a set parameters
mp.transcost=10;
mp.psych_transcost = {0};
mp=trmodel.update_mp(mp); % standard model parameters
% 2.b solve model
[sol]=equilibrium.solve(mp, s); % solve model in baseline
% 2.c graphs
f = graphs.agg_holdings(mp,s,sol);
set(gca, 'ylim', ylim);
legend('location', 'north');
saveas(f, 'results/illustration/example_holdings_tc_10.eps', 'epsc');
f2 = graphs.prices_with_hom(mp,s,sol);
saveas(f2, 'results/illustration/example_prices_tc_10.eps', 'epsc');