%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This script is used to calculate hazard indices for the baseline period % of 1980-2011 as reported in: % % Daniel Nohrstedt, Maurizio Mazzoleni, Charles F. Parker, and Giuliano Di % Baldassarre. Policy change after natural hazard % events, Nature Communication % % This script was prepared by Maurizio Mazzoleni % Uppsala University, 2020 % mail to: maurizio.mazzoleni@geo.uu.se % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%Estimate hazard indeces for the baseline period 1980-2011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Preallocation fatalities_tot=zeros(size(Summary_data,2),1); affected_tot=zeros(size(Summary_data,2),1); damage_tot=zeros(size(Summary_data,2),1); events_tot=zeros(size(Summary_data,2),1); for jj=1:size(Summary_data,2) country=analysis_country{jj,1}; position_new=find(strcmp(emdatcountries_1970_2018, country)==1); %which position in EMDATA is the country 'pais' year_temp=EM_DATA_1970_2018_Disaster{10,position_new+1}; rows_tot=find(year_temp>=lower_limit_baseline & year_temp<=higher_limit_baseline); %%Fatalities fatalities2=EM_DATA_1970_2018_Disaster{4,position_new+1}(rows_tot,1); fatalities1=nanmean(fatalities2); fatalities_tot(jj,1)=fatalities1; %%Affected affected2=EM_DATA_1970_2018_Disaster{8,position_new+1}(rows_tot,1); affected1=nanmean(affected2); affected_tot(jj,1)=affected1; %%Damages damage2=EM_DATA_1970_2018_Disaster{9,position_new+1}(rows_tot,1); damage1=nanmean(damage2); damage_tot(jj,1)=damage1; %%Events events2=EM_DATA_1970_2018_Disaster{3,position_new+1}(rows_tot,1); events1=nanmean(events2); events_tot(jj,1)=events1; end %%Estimate the normalized ratio Analysis_tot1(1,:)=Analysis_0711(1,:)./fatalities_tot'; Analysis_tot1(2,:)=Analysis_0711(2,:)./affected_tot'; Analysis_tot1(3,:)=Analysis_0711(3,:)./damage_tot'; Analysis_tot1(4,:)=Analysis_0711(4,:)./events_tot'; Analysis_tot1(5:9,:)=Analysis_0711(5:9,:); Analysis_tot=Analysis_tot1'; Analysis_mean2=Analysis_tot(:,5:9); Analysis_mean1=mean(Analysis_mean2,2); Analysis_mean=cat(2,Analysis_tot(:,1:4),Analysis_mean1); %%Main matrix in which the results are saved %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%Save results %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%Main matrix in which the results of Figure 1 are stored Results_Figure1=cell(size(Analysis_mean,1)+1,7); Results_Figure1{1,1}='Country code'; Results_Figure1{1,2}='Country name'; Results_Figure1{1,3}='Fatalities'; Results_Figure1{1,4}='Affected people'; Results_Figure1{1,5}='Economic losses'; Results_Figure1{1,6}='Number of events'; Results_Figure1{1,7}='PFA changes'; Results_Figure1(2:end,1:2)=analysis_country; Results_Figure1(2:end,3:end)=num2cell(Analysis_mean);