-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparent_script.m
More file actions
74 lines (60 loc) · 2.08 KB
/
parent_script.m
File metadata and controls
74 lines (60 loc) · 2.08 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
%% Parent Script
% * Filename: parent_script.m
% * Authors: Matt Reimer
% * Created: 02/02/18
% * Updated: 01/10/20
%
%% Description
% The script |parent_script| is a guide for how to generate data and
% estimate parameters.
%
%% Notes
% Note that much of the data-generating and analysis for the paper takes
% place in other scripts, namely |monte_carlo_data|, |monte_carlo_analysis|,
% and |policy_simulations|.
%
%% PRELIMINARIES
% Environment
clc, clear
close all
directory = 'Documents/GitHub/RERUM';
cd(homedir)
cd(directory)
addpath(genpath(pwd))
% Load default parameters
par = parameters;
% Clusters: for parallel computing (none, local, or cloud)
% NOTE: function will need adapting to local conditions.
cluster = 'none';
open = 'no';
[c,poolsize] = clust(cluster,open);
%% GENERATE DATA: LOCATION CHOICES, CATCH, & QUOTA PRICES
% A single draw from the DGP (default parameter values)
b = par.btrue; % Default structural parameter vector
D = dgpdraw(b,par);
% Multiple draws from the DGP (default parameter values)
draws = 5;
for k = 1:draws
DD(k) = dgpdraw(b,par,[],k);
end
% A single draw with non-default parameter values
par = set(par,{'periods','gridsize'},{45,8});
D = dgpdraw(b,par);
% A single draw with 10 closed "hot-spot" areas
closures = 10; % Number of closures
[~,closed] = hotspots(D,closures,par); % Areas with the most bycatch
D = dgpdraw(b,par,[],[],closed);
% Figures
fig1 = fig_wstar(D,'single'); % Fishery outcomes from a single draw
fig2 = fig_wstar(DD,'all'); % Quota prices from several draws
%% ESTIMATION: Using a single draw from the dgp
% Draw data from dgp
data = dgpdraw(b,par);
% Estimation Options
display = 'iter'; % Option for displaying iterations
multi_start = 'off'; % Option for multiple starting values
b0 = par.btrue; % Initial guess
spec = 'RERUM'; % Model specification
options = {'display',display,'b0',b0,'multi_start',multi_start};
% Estimation
estimate = estimation(data,spec,options);