%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This script is used to calculate hazard indices for the four different % baseline periods 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 different baseline periods %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Total_Diff_tab=zeros(4,5,length(lower_limit_baseline)); for tt=1:length(lower_limit_baseline) lower_limit_tot=lower_limit_baseline(tt); %%Define lower boundary of the baseline higher_limit_tot=2011; 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 pais=1:size(Summary_data,2) %loop based on country vector from policy change country=analysis_country{pais,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_tot & year_temp<=higher_limit_tot); %%Fatalities fatalities2=EM_DATA_1970_2018_Disaster{4,position_new+1}(rows_tot,1); fatalities1=nanmean(fatalities2); fatalities_tot(pais,1)=fatalities1; %%Affected affected2=EM_DATA_1970_2018_Disaster{8,position_new+1}(rows_tot,1); affected1=nanmean(affected2); affected_tot(pais,1)=affected1; %%Damages damage2=EM_DATA_1970_2018_Disaster{9,position_new+1}(rows_tot,1); damage1=nanmean(damage2); damage_tot(pais,1)=damage1; %%Events events2=EM_DATA_1970_2018_Disaster{3,position_new+1}(rows_tot,1); events1=nanmean(events2); events_tot(pais,1)=events1; end %%Calculate normalized index as ration between hazard measure in 2007-2011 and baseline 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'; %%%%%%% Average per positive and non-positive normalized indices %%%%%% %%Fatalities Fatalities_PF_sort1=[Analysis_tot(:,1),Analysis_tot(:,5),Analysis_tot(:,6),Analysis_tot(:,7),Analysis_tot(:,8),Analysis_tot(:,9)]; Fatalities_PF_tot1=sortrows(Fatalities_PF_sort1,1); Fatalities_PF_tot=Fatalities_PF_tot1; Fatalities_PF_tot(any(isnan(Fatalities_PF_tot), 2), :) = []; l_death = find(Fatalities_PF_tot1(:,1)>1, 1); Fatalities_tab=zeros(3,5); for i=1:5 Fatalities_LowEqOne=Fatalities_PF_tot(1:l_death-1,i+1); Fatalities_HighOne=Fatalities_PF_tot(l_death:end,i+1); Fatalities_tab(1,i)=mean(Fatalities_LowEqOne); Fatalities_tab(2,i)=mean(Fatalities_HighOne); Fatalities_tab(3,i)=Fatalities_tab(2,i)-Fatalities_tab(1,i); end %%Affected Affected_PF_sort1=[Analysis_tot(:,2),Analysis_tot(:,5),Analysis_tot(:,6),Analysis_tot(:,7),Analysis_tot(:,8),Analysis_tot(:,9)]; Affected_PF_tot1=sortrows(Affected_PF_sort1,1); Affected_PF_tot=Affected_PF_tot1; Affected_PF_tot(any(isnan(Affected_PF_tot), 2), :) = []; l_affected = find(Affected_PF_tot(:,1)>1, 1); Affected_tab=zeros(3,5); for i=1:5 Affected_LowEqOne=Affected_PF_tot(1:l_affected-1,i+1); Affected_HighOne=Affected_PF_tot(l_affected:end,i+1); Affected_tab(1,i)=mean(Affected_LowEqOne); Affected_tab(2,i)=mean(Affected_HighOne); Affected_tab(3,i)=Affected_tab(2,i)-Affected_tab(1,i); end %%Damages Damage_PF_sort1=[Analysis_tot(:,3),Analysis_tot(:,5),Analysis_tot(:,6),Analysis_tot(:,7),Analysis_tot(:,8),Analysis_tot(:,9)]; Damage_PF_tot1=sortrows(Damage_PF_sort1,1); Damage_PF_tot=Damage_PF_tot1; Damage_PF_tot(any(isnan(Damage_PF_tot), 2), :) = []; l_damage = find(Damage_PF_tot(:,1)>1,1); Damage_tab=zeros(3,5); for i=1:5 Damage_LowEqOne=Damage_PF_tot(1:l_damage-1,i+1); Damage_HighOne=Damage_PF_tot(l_damage:end,i+1); Damage_tab(1,i)=mean(Damage_LowEqOne); Damage_tab(2,i)=mean(Damage_HighOne); Damage_tab(3,i)=Damage_tab(2,i)-Damage_tab(1,i); end %%Events Events_PF_sort1=[Analysis_tot(:,4),Analysis_tot(:,5),Analysis_tot(:,6),Analysis_tot(:,7),Analysis_tot(:,8),Analysis_tot(:,9)]; Events_PF_tot1=sortrows(Events_PF_sort1,1); Events_PF_tot=Events_PF_tot1; Events_PF_tot(any(isnan(Events_PF_tot), 2), :) = []; l_event = find(Events_PF_tot(:,1)>1, 1); Events_tab=zeros(3,5); for i=1:5 Events_LowEqOne=Events_PF_tot(1:l_event-1,i+1); Events_HighOne=Events_PF_tot(l_event:end,i+1); Events_tab(1,i)=mean(Events_LowEqOne); Events_tab(2,i)=mean(Events_HighOne); Events_tab(3,i)=Events_tab(2,i)-Events_tab(1,i); end %%Save total tab Total_Diff_tab(1,:,tt)=Fatalities_tab(3,:); Total_Diff_tab(2,:,tt)=Affected_tab(3,:); Total_Diff_tab(3,:,tt)=Damage_tab(3,:); Total_Diff_tab(4,:,tt)=Events_tab(3,:); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%Save results %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%Main matrix in which the results of Figure 2 are stored Results_Figure2=cell(2,4); Results_Figure2{1,1}='Fatalities'; Results_Figure2{1,2}='Affected people'; Results_Figure2{1,3}='Economic losses'; Results_Figure2{1,4}='Number of events'; for ii=1:4 Results_temp=cell(6,5); Results_temp{1,2}='1970'; Results_temp{1,3}='1980'; Results_temp{1,4}='1990'; Results_temp{1,5}='2000'; Results_temp{2,1}='PFA1'; Results_temp{3,1}='PFA2'; Results_temp{4,1}='PFA3'; Results_temp{5,1}='PFA4'; Results_temp{6,1}='PFA5'; Results_temp(2:end,2:end)=num2cell(reshape(Total_Diff_tab(ii,:,:),5,4)); Results_Figure2{2,ii}=Results_temp; end