Skip to content

Commit

Permalink
New initial estimate for new base classification of sectors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanspeter85 committed Jan 27, 2022
1 parent 244cb70 commit 0df7b8c
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions IEfeeds_code/Ind20Pro21v1_InitialEstimate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit 0df7b8c

Please sign in to comment.