-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInd20Pro21v1_InitialEstimate.m
50 lines (36 loc) · 1.65 KB
/
Ind20Pro21v1_InitialEstimate.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
function [RegMap,IndMap,ProdMap]=Ind20Pro21v1_InitialEstimate(handles)
disp('Launching initial estimate for the extended PIOT version 1');
% Write handles variables into mat-file for R to read
% Working directory
filename = [handles.processeddatadir,'WorkingDirectory4R.mat'];
out = handles.motherALANGdir;
save(filename,'out');
% Write region aggregator to file
filename = [handles.processeddatadir,'RegionAggFile4R.mat'];
out = handles.regionaggfile;
save(filename,'out');
% Region aggregator
RegMap = csvread(handles.regionagg);
if size(RegMap,1) > size(RegMap,2) % check orientation of aggregator
RegMap = RegMap';
end
reg_proxy = ones(size(RegMap,2),1);
RegMap = prorate(RegMap,'col_proxy',reg_proxy);
% Product aggregator
ProdMap = csvread(handles.sectoraggprod);
if size(ProdMap,1) > size(ProdMap,2) % check orientation of aggregator
ProdMap = ProdMap';
end
prod_proxy = ones(size(ProdMap,2),1);
ProdMap = prorate(ProdMap,'col_proxy',prod_proxy);
% Industry aggregator
IndMap = csvread(handles.sectoragg);
if size(IndMap,1) > size(IndMap,2) % check orientation of aggregator
IndMap = IndMap';
end
ind_proxy = ones(size(IndMap,2),1);
IndMap = prorate(IndMap,'col_proxy',ind_proxy);
% To run Lab on Sydney machine: command = 'Rscript /import/emily1/isa/IELab/Roots/PIOLab/Rscripts/IEfeeds_code/Ind20Pro21v1_InitialEstimate.R';
command = 'Rscript /data/WULab/Roots/PIOLab/Rscripts/IEfeeds_code/Ind20Pro21v1_InitialEstimate.R';
system(command,'-echo');
end