From 0df7b8cc8353115501b112ce8b047ea2877ec1fe Mon Sep 17 00:00:00 2001 From: Hanspeter85 Date: Thu, 27 Jan 2022 16:10:13 +0100 Subject: [PATCH] New initial estimate for new base classification of sectors. --- IEfeeds_code/Ind20Pro21v1_InitialEstimate.m | 50 +++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 IEfeeds_code/Ind20Pro21v1_InitialEstimate.m diff --git a/IEfeeds_code/Ind20Pro21v1_InitialEstimate.m b/IEfeeds_code/Ind20Pro21v1_InitialEstimate.m new file mode 100644 index 0000000..53e7f92 --- /dev/null +++ b/IEfeeds_code/Ind20Pro21v1_InitialEstimate.m @@ -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 \ No newline at end of file