1.1 Prepare Dataset for Analysis

1.2 Import Data

Install packages and load libraries, set working directory

setwd("/Users/tessaschneider/Desktop/Final Data Analysis")

df <- read.csv("unhcr_popstats_refugee-status.csv", skip = 2, stringsAsFactors = F, na.string=c("", "*"))
df2 <- read.csv("unhcr_popstats_export_persons_of_concern_all_data.csv", skip = 3, stringsAsFactors = F, na.string=c("", "*"))

1.3 Tidy Data

Convert Total.Population to numeric before merging the datasets (after merging, data before 2000 drops out)

df2$Total.Population[df2$Total.Population=="*"] <- "2.5"
df2$Total.Population <- as.numeric(df2$Total.Population)

merged_data <- merge(df2, df, by = c("Year", "Country...territory.of.asylum.residence", "Origin"))

table(merged_data$Year)
## 
##  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011 
##  4301  4683  4988  5473  5668  5778  5806  6064  6120  6207  7080  7209 
##  2012  2013  2014  2015  2016 
##  7537  8332  9191 10071  9495

2.1 Exploring Data: Top Destination Countries

destination_country_total <- merged_data %>%
  group_by(Country...territory.of.asylum.residence, Year) %>%
  summarise(Total = sum(Total.Population))

top_destcountries <- destination_country_total %>%
  group_by(Country...territory.of.asylum.residence) %>%
  summarise(Total = sum(Total, na.rm = TRUE)) %>%
  top_n(20)

top_destcountries2 <- as.character(top_destcountries$Country...territory.of.asylum.residence)

plot1 <- destination_country_total %>%
  filter(Country...territory.of.asylum.residence %in% top_destcountries2) %>%
  ggplot(mapping = aes(x = Year, y = Total)) +
  geom_line() + coord_cartesian(ylim = c(0, 3e6)) +
  facet_wrap( ~ Country...territory.of.asylum.residence, ncol=4)

ggplotly(plot1)

2.2 Exploring Data: Top Origin Countries

origin_country_total <- merged_data %>%
  group_by(Origin, Year) %>%
  summarise(Total = sum(Total.Population))
  
top_origcountries <- origin_country_total %>%
  group_by(Origin) %>%
  summarise(Total = sum(Total, na.rm = TRUE)) %>%
  top_n(20)

top_origcountries2 <- as.character(top_origcountries$Origin)

plot2 <- origin_country_total %>%
  filter(Origin %in% top_origcountries2) %>%
  ggplot(mapping = aes(x = Year, y = Total)) +
  geom_line() + coord_cartesian(ylim = c(0, 1e7)) +
  facet_wrap( ~ Origin, ncol=4)

ggplotly(plot2)
table(merged_data$Year)
## 
##  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011 
##  4301  4683  4988  5473  5668  5778  5806  6064  6120  6207  7080  7209 
##  2012  2013  2014  2015  2016 
##  7537  8332  9191 10071  9495

2.3 Exploring Data: Percent Change in Total Population

By “People of Concern”“, subset for only PoC category counts by year change value from character to integer

Year_Pop <- aggregate(merged_data$`Total.Population`, by=list(Year = merged_data$Year), FUN=sum, na.rm = TRUE)

Year_Pop$rate <- NA

Year_Pop$rate[which(Year_Pop$Year>2000)] = 100*(diff(Year_Pop$x)/Year_Pop[-nrow(Year_Pop),]$x)

plot3 <- ggplot(Year_Pop, aes(x= Year, y= rate)) + geom_line() + 
  labs(title="Percent Change in People of Concern",
       subtitle="(2000 - 2016)",
       x="Year", 
       y="Percent Change")

ggplotly(plot3)
PoC_count <- merged_data[c(1,4:10)]

PoC_count <- melt(PoC_count, id=c("Year"))

str(PoC_count)
## 'data.frame':    798021 obs. of  3 variables:
##  $ Year    : int  2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 ...
##  $ variable: Factor w/ 7 levels "Refugees..incl..refugee.like.situations.",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ value   : int  NA NA 9 507 2 5 NA 1 5 20 ...
PoC_count$value <- as.integer(PoC_count$value)

Starting from 2013 the number of refugees has increased dramatically and with it pending cases for asylum seekers have also increased

plot4 <- ggplot(PoC_count,aes(Year,value, na.rm = TRUE)) +
  geom_bar(aes(fill=variable),stat="identity") +
  labs(title="UNHCR Population Statistics Database",
       subtitle="(2000 - 2016)",
       x="Year", 
       y="Number of People (Millions)")
ggplotly(plot4)

3.1 Time Series Analysis: Preparation

  • y is PoC in Germany
  • x is PoC in all countries in database
  • t is Years (2000-2016)

All variables used in the model must be declared as time series

Germany_PoC <- merged_data %>% group_by(Country...territory.of.asylum.residence, Year) %>% 
  filter('Germany' %in% Country...territory.of.asylum.residence) %>% 
  summarise(Total = sum(Total.Population, na.rm = TRUE))

Germany_data <- merge(Germany_PoC, Year_Pop, by = "Year")

Germany_data$Year <- ts(Germany_data$Year)
Germany_data$Total <- ts(Germany_data$Total)
Germany_data$x <- ts(Germany_data$x)

3.2 Time Series Analysis: Test for Time Series Problems

Test for Persistence or Dependence

Row is <1 so it meets the stability condition for weak dependency

summary(dynlm(Total ~ L(Total, 1), data = Germany_data))
## 
## Time series regression with "ts" data:
## Start = 2, End = 17
## 
## Call:
## dynlm(formula = Total ~ L(Total, 1), data = Germany_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1167358  -221340  -102116   196356  1555201 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.183e+06  7.834e+05   1.510    0.153
## L(Total, 1) 4.726e-01  3.772e-01   1.253    0.231
## 
## Residual standard error: 583500 on 14 degrees of freedom
## Multiple R-squared:  0.1008, Adjusted R-squared:  0.03661 
## F-statistic:  1.57 on 1 and 14 DF,  p-value: 0.2307

Test for Persistence or Dependence

Germany’s Total persons of concern annual data shows that the correlation of lags of the Total Population variable drops to zero after 1 lag with statistical insignificant correlation after 1 lag, therefore it is not persistent

acf(Germany_data$Total, na.action = na.pass, lag.max = 5)

Tests for Stationarity

Germany Total PoC annual is trending after 2012 Stochastic trend (increases and decreases inconsistently) in the Germany Total plot Deterministic trend (increases and decreases consistently) in the Germany x plot

ggplot(data=Germany_data,
       mapping = aes(x = Year, y = Total)) + geom_line()

par(mfrow = c(1,2))
plot(Germany_data$Total)
plot(Germany_data$x)

Tests for Stationarity - Unit Root Test - Dickey Fuller Test

(p value <.05 then there is no unit root)

adf.test(Germany_data$Total)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  Germany_data$Total
## Dickey-Fuller = -4.0015, Lag order = 2, p-value = 0.0232
## alternative hypothesis: stationary

Detrend: When there is a Deterministic Trend

Regress y, x1 and x2 on trend term(Year) and intercept, save residuals for y, x1 and x2, and then regress y residual on x1 residual and x2 residual The regression with residuals shows an increase in the correlation, but it is still not statistically significant Even after detrending there is still no statistically significant coefficient

fit = lm(Germany_data$Total ~ Germany_data$Year, na.action = NULL)
plot(resid(fit), type="o", main="Detrended")

fit1 <- lm(Germany_data$Total ~ Germany_data$Year)
res_Germany_dataTotal <- residuals(fit1)

fit2 <- lm(Germany_data$x ~ Germany_data$Year)
res_Germany_datax <- residuals(fit2)

summary(m3 <- dynlm(res_Germany_dataTotal ~ res_Germany_datax))
## 
## Time series regression with "numeric" data:
## Start = 1, End = 17
## 
## Call:
## dynlm(formula = res_Germany_dataTotal ~ res_Germany_datax)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -974291 -205771   50893  170461 1342713 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)
## (Intercept)       -2.175e-12  1.326e+05   0.000    1.000
## res_Germany_datax  4.506e-02  2.726e-02   1.653    0.119
## 
## Residual standard error: 546900 on 15 degrees of freedom
## Multiple R-squared:  0.1541, Adjusted R-squared:  0.09771 
## F-statistic: 2.733 on 1 and 15 DF,  p-value: 0.1191

Detrend: When there is a Stochastic Trend

First differencing then plotting shows that the trend was removed in this case

diff_Germany_dataTotal <- c(NA, diff(Germany_data$Total))
diff_Germany_datax <- c(NA, diff(Germany_data$x))

par(mfrow = c(1,2))
plot(diff_Germany_dataTotal)
plot(diff_Germany_datax)

3.3 Run OLS regression

This time series regression resulted in no statistically significant correlation between the selected variables Since there is monthly data on asylum seekers, perhaps it is possible to predict future numbers of asylum seekers in Germany through a forecasting model (there are clear limitations in only looking at one variable, so these predictions cannot be interpreted as exact predictions)

summary(m1 <- dynlm(Germany_data$Total ~ Germany_data$x, Germany_data$Year))
## 
## Time series regression with "ts" data:
## Start = 1, End = 17
## 
## Call:
## dynlm(formula = Germany_data$Total ~ Germany_data$x, data = Germany_data$Year)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1211044  -166431    17327   234881  1377285 
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    1.860e+06  3.367e+05   5.526 5.82e-05 ***
## Germany_data$x 1.539e-02  1.659e-02   0.928    0.368    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 578300 on 15 degrees of freedom
## Multiple R-squared:  0.05424,    Adjusted R-squared:  -0.008807 
## F-statistic: 0.8603 on 1 and 15 DF,  p-value: 0.3683
summary(m2 <- dynlm(diff_Germany_dataTotal ~ diff_Germany_datax))
## 
## Time series regression with "numeric" data:
## Start = 1, End = 16
## 
## Call:
## dynlm(formula = diff_Germany_dataTotal ~ diff_Germany_datax)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1193689  -234226   -54765   183611  1575194 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)
## (Intercept)        6.296e+04  1.654e+05   0.381    0.709
## diff_Germany_datax 2.980e-02  4.267e-02   0.698    0.496
## 
## Residual standard error: 612300 on 14 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.03366,    Adjusted R-squared:  -0.03536 
## F-statistic: 0.4877 on 1 and 14 DF,  p-value: 0.4964

4.1 Forecasting Number of Future Asylum Seekers in Germany: Preparation

As before, we convert values to numeric, create an object that sums all origin countries to Germany by month, declare variables as time series variables

df3 <- read.csv("unhcr_popstats_export_asylum_seekers_monthly_2017_12_04_203715.csv", skip = 2, stringsAsFactors = F)

df3$Value[df3$Value=="*"] <- "0"
df3$Value <- as.numeric(df3$Value)

Germany_monthlyasylum_total <- df3 %>%
  group_by(Country...territory.of.asylum.residence, Year, Month) %>%
  summarise(Total = sum(Value))

Germany_monthly <- ts(Germany_monthlyasylum_total$Total, 
                      start = c(1999, 1), frequency = 12)

4.2 Forecasting Number of Future Asylum Seekers in Germany: Test for Time Series Problems

Stationarity Test

Plot and observe trends

autoplot(as.zoo(Germany_monthly), geom = "line")

Persistence Test 1

After dynlm, row is <1 so it meets the stability condition for weak dependency)

summary(dynlm(Germany_monthly ~ L(Germany_monthly, 1)))
## 
## Time series regression with "ts" data:
## Start = 1999(2), End = 2017(9)
## 
## Call:
## dynlm(formula = Germany_monthly ~ L(Germany_monthly, 1))
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -57837  -1677  -1197     32  55483 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           1919.7596   722.1649   2.658  0.00842 ** 
## L(Germany_monthly, 1)    0.8129     0.0391  20.792  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9061 on 222 degrees of freedom
## Multiple R-squared:  0.6607, Adjusted R-squared:  0.6592 
## F-statistic: 432.3 on 1 and 222 DF,  p-value: < 2.2e-16

Persistence Test 2

After acf, Germany monthly’s correlation of lags drops to zero after 2.5 lags therefore it is not persistent

acf(Germany_monthly, na.action = na.pass, lag.max = 40)

Persistence Test 3

After Dickey Fuller Test for Unit Root, p value is <.05 then there is no unit root)

adf.test(Germany_monthly)
## 
##  Augmented Dickey-Fuller Test
## 
## data:  Germany_monthly
## Dickey-Fuller = -2.4282, Lag order = 6, p-value = 0.3961
## alternative hypothesis: stationary

4.3 Forecasting Number of Future Asylum Seekers in Germany

Decompose

Then we can decompose the additives of time series. This returns estimates of the seasonal component, trend component and irregular components or “random”

plot(decompose(Germany_monthly))

4.4 Forecasting Number of Future Asylum Seekers in Germany

Seasonal Changes

To look more closely at the seasonal changes in the number of asylum seekers we use the “stl” function Germany has had a positive net flow of asylum seekers in June, July, November, December and the highest typically in February between 2000 and 2015

stl(Germany_monthly, s.window="periodic")
##  Call:
##  stl(x = Germany_monthly, s.window = "periodic")
## 
## Components
##            seasonal     trend    remainder
## Jan 1999 -1096.5685  8382.805   -795.23610
## Feb 1999  2071.6000  8308.566  -1475.16642
## Mar 1999 -1925.2727  8234.328    782.94448
## Apr 1999  -685.5828  8143.483   -124.90010
## May 1999  -821.2551  8052.638    984.61760
## Jun 1999  1040.4846  7955.450    412.06530
## Jul 1999   747.7001  7858.263   1034.03719
## Aug 1999  -432.3683  7761.744    595.62406
## Sep 1999  -960.8065  7665.226    206.58066
## Oct 1999  -103.5304  7510.303     69.22730
## Nov 1999   486.5990  7355.380   -336.97938
## Dec 1999  1679.0011  7158.084   -408.08481
## Jan 2000 -1096.5685  6960.787   -860.21851
## Feb 2000  2071.6000  6814.316  -1378.91557
## Mar 2000 -1925.2727  6667.844   1220.42859
## Apr 2000  -685.5828  6635.522    167.06075
## May 2000  -821.2551  6603.200    836.05518
## Jun 2000  1040.4846  6628.591  -1140.07529
## Jul 2000   747.7001  6653.982  -1654.68157
## Aug 2000  -432.3683  6692.536    -56.16740
## Sep 2000  -960.8065  6731.090    545.71652
## Oct 2000  -103.5304  6795.146   1217.38410
## Nov 2000   486.5990  6859.203    338.19838
## Dec 2000  1679.0011  6941.661  -1454.66231
## Jan 2001 -1096.5685  7024.120    254.44874
## Feb 2001  2071.6000  7086.457    -20.05693
## Mar 2001 -1925.2727  7148.794    352.47862
## Apr 2001  -685.5828  7201.892   -296.30872
## May 2001  -821.2551  7254.989   1149.26622
## Jun 2001  1040.4846  7278.844   -226.32904
## Jul 2001   747.7001  7302.700  -1441.40010
## Aug 2001  -432.3683  7223.854    459.51459
## Sep 2001  -960.8065  7145.007    756.79903
## Oct 2001  -103.5304  7053.462   1056.06879
## Nov 2001   486.5990  6961.916   1315.48524
## Dec 2001  1679.0011  6855.799   -534.79988
## Jan 2002 -1096.5685  6749.682    365.88675
## Feb 2002  2071.6000  6606.268  -2897.86776
## Mar 2002 -1925.2727  6462.854    156.41895
## Apr 2002  -685.5828  6306.624    149.95835
## May 2002  -821.2551  6150.395   2432.86004
## Jun 2002  1040.4846  6015.083  -1108.56798
## Jul 2002   747.7001  5879.772   -963.47181
## Aug 2002  -432.3683  5719.493    409.87578
## Sep 2002  -960.8065  5559.213    747.59310
## Oct 2002  -103.5304  5408.174    205.35641
## Nov 2002   486.5990  5257.135    824.26641
## Dec 2002  1679.0011  5119.676   -512.67732
## Jan 2003 -1096.5685  4982.218    126.35069
## Feb 2003  2071.6000  4850.295  -3373.89490
## Mar 2003 -1925.2727  4718.372    622.90072
## Apr 2003  -685.5828  4587.348    584.23505
## May 2003  -821.2551  4456.323   2488.93166
## Jun 2003  1040.4846  4351.293   -863.77749
## Jul 2003   747.7001  4246.262  -1340.96246
## Aug 2003  -432.3683  4130.795    630.57286
## Sep 2003  -960.8065  4015.329    703.47792
## Oct 2003  -103.5304  3887.690     45.84079
## Nov 2003   486.5990  3760.051     96.35034
## Dec 2003  1679.0011  3642.490   -903.49118
## Jan 2004 -1096.5685  3524.929    586.63902
## Feb 2004  2071.6000  3435.775  -2564.37451
## Mar 2004 -1925.2727  3346.620   1324.65318
## Apr 2004  -685.5828  3258.516    416.06725
## May 2004  -821.2551  3170.411   1417.84360
## Jun 2004  1040.4846  3085.082  -1218.56703
## Jul 2004   747.7001  2999.753   -852.45347
## Aug 2004  -432.3683  2906.202    937.16639
## Sep 2004  -960.8065  2812.651    757.15598
## Oct 2004  -103.5304  2731.787     36.74333
## Nov 2004   486.5990  2650.924   -239.52264
## Dec 2004  1679.0011  2576.775  -1487.77610
## Jan 2005 -1096.5685  2502.626    859.94219
## Feb 2005  2071.6000  2445.359  -2093.95865
## Mar 2005 -1925.2727  2388.091   1634.18173
## Apr 2005  -685.5828  2356.611    429.97168
## May 2005  -821.2551  2325.131    834.12390
## Jun 2005  1040.4846  2291.785  -1182.26988
## Jul 2005   747.7001  2258.439   -719.13947
## Aug 2005  -432.3683  2196.380    458.98795
## Sep 2005  -960.8065  2134.321    933.48510
## Oct 2005  -103.5304  2090.565    476.96519
## Nov 2005   486.5990  2046.809   -286.40804
## Dec 2005  1679.0011  2004.249  -1176.24975
## Jan 2006 -1096.5685  1961.688    634.88028
## Feb 2006  2071.6000  1919.898  -2092.49830
## Mar 2006 -1925.2727  1878.108   1563.16434
## Apr 2006  -685.5828  1846.831    617.75169
## May 2006  -821.2551  1815.554    974.70131
## Jun 2006  1040.4846  1783.516  -1434.00038
## Jul 2006   747.7001  1751.478   -995.17788
## Aug 2006  -432.3683  1704.632    867.73650
## Sep 2006  -960.8065  1657.786    997.02061
## Oct 2006  -103.5304  1635.534    216.99653
## Nov 2006   486.5990  1613.282   -257.88087
## Dec 2006  1679.0011  1596.015  -1644.01628
## Jan 2007 -1096.5685  1578.748    720.82005
## Feb 2007  2071.6000  1557.806  -1711.40616
## Mar 2007 -1925.2727  1536.864   1653.40885
## Apr 2007  -685.5828  1539.895    444.68807
## May 2007  -821.2551  1542.926    941.32955
## Jun 2007  1040.4846  1557.840  -1115.32492
## Jul 2007   747.7001  1572.755  -1079.45519
## Aug 2007  -432.3683  1569.161    331.20748
## Sep 2007  -960.8065  1565.567    742.23987
## Oct 2007  -103.5304  1599.996    456.53468
## Nov 2007   486.5990  1634.425   -199.02383
## Dec 2007  1679.0011  1680.356  -1588.35752
## Jan 2008 -1096.5685  1726.288   1064.28053
## Feb 2008  2071.6000  1751.670  -2164.27010
## Mar 2008 -1925.2727  1777.052   1693.22048
## Apr 2008  -685.5828  1789.498    714.08469
## May 2008  -821.2551  1801.944   1416.31117
## Jun 2008  1040.4846  1815.331  -1062.81557
## Jul 2008   747.7001  1828.718   -904.41812
## Aug 2008  -432.3683  1835.209    142.15927
## Sep 2008  -960.8065  1841.700    718.10639
## Oct 2008  -103.5304  1879.220    -45.68989
## Nov 2008   486.5990  1916.741   -449.33947
## Dec 2008  1679.0011  1971.063  -1685.06408
## Jan 2009 -1096.5685  2025.385   1029.18306
## Feb 2009  2071.6000  2080.004  -1624.60366
## Mar 2009 -1925.2727  2134.622   1960.65084
## Apr 2009  -685.5828  2189.875    540.70826
## May 2009  -821.2551  2245.127   1023.12795
## Jun 2009  1040.4846  2297.944   -732.42811
## Jul 2009   747.7001  2350.760  -1093.45997
## Aug 2009  -432.3683  2405.060    106.30823
## Sep 2009  -960.8065  2459.360    400.44617
## Oct 2009  -103.5304  2539.501     82.02913
## Nov 2009   486.5990  2619.642   -414.24123
## Dec 2009  1679.0011  2701.520  -1677.52145
## Jan 2010 -1096.5685  2783.398    770.17007
## Feb 2010  2071.6000  2862.601   -833.20049
## Mar 2010 -1925.2727  2941.803   2682.47016
## Apr 2010  -685.5828  3060.241     78.34147
## May 2010  -821.2551  3178.680    358.57505
## Jun 2010  1040.4846  3287.588   -948.07229
## Jul 2010   747.7001  3396.495  -1250.19543
## Aug 2010  -432.3683  3453.566   -305.19763
## Sep 2010  -960.8065  3510.637   -132.83009
## Oct 2010  -103.5304  3583.718   1272.81266
## Nov 2010   486.5990  3656.799    833.60209
## Dec 2010  1679.0011  3726.905   -636.90609
## Jan 2011 -1096.5685  3797.011    330.55748
## Feb 2011  2071.6000  3826.847  -1833.44735
## Mar 2011 -1925.2727  3856.684   2242.58904
## Apr 2011  -685.5828  3861.367    194.21540
## May 2011  -821.2551  3866.051    856.20403
## Jun 2011  1040.4846  3865.081  -1349.56589
## Jul 2011   747.7001  3864.112  -1356.81161
## Aug 2011  -432.3683  3893.333    164.03516
## Sep 2011  -960.8065  3922.555    539.25167
## Oct 2011  -103.5304  4000.364    992.16604
## Nov 2011   486.5990  4078.174   -380.77291
## Dec 2011  1679.0011  4164.190  -1653.19086
## Jan 2012 -1096.5685  4250.206    129.36292
## Feb 2012  2071.6000  4327.690   -913.28991
## Mar 2012 -1925.2727  4405.174   2400.09847
## Apr 2012  -685.5828  4617.449    -15.86657
## May 2012  -821.2551  4829.724    658.53066
## Jun 2012  1040.4846  5157.646  -1446.13034
## Jul 2012   747.7001  5485.567  -2106.26715
## Aug 2012  -432.3683  5833.644  -1684.27564
## Sep 2012  -960.8065  6181.721  -1630.91439
## Oct 2012  -103.5304  6532.367   2571.16372
## Nov 2012   486.5990  6883.013   2826.38851
## Dec 2012  1679.0011  7230.741  -1984.74179
## Jan 2013 -1096.5685  7578.469   1230.09965
## Feb 2013  2071.6000  7830.621    -72.22059
## Mar 2013 -1925.2727  8082.772   3060.50039
## Apr 2013  -685.5828  8316.624  -1636.04166
## May 2013  -821.2551  8550.477   -199.22144
## Jun 2013  1040.4846  8853.714    -88.19841
## Jul 2013   747.7001  9156.951  -1303.65118
## Aug 2013  -432.3683  9609.779  -3387.41049
## Sep 2013  -960.8065 10062.607  -1418.80007
## Oct 2013  -103.5304 10601.161   1903.36898
## Nov 2013   486.5990 11139.716   1658.68471
## Dec 2013  1679.0011 11660.604  -1610.60538
## Jan 2014 -1096.5685 12181.492   -597.92374
## Feb 2014  2071.6000 12566.536   1387.86382
## Mar 2014 -1925.2727 12951.580   6032.69260
## Apr 2014  -685.5828 13336.893  -2476.31033
## May 2014  -821.2551 13722.206     27.04902
## Jun 2014  1040.4846 14407.222   1361.29354
## Jul 2014   747.7001 15092.238  -3330.93775
## Aug 2014  -432.3683 16488.808  -5881.43920
## Sep 2014  -960.8065 17885.377  -5364.57090
## Oct 2014  -103.5304 19580.961   -448.43019
## Nov 2014   486.5990 21276.544  -2531.14280
## Dec 2014  1679.0011 23030.706  -7626.70721
## Jan 2015 -1096.5685 24784.868   2153.70012
## Feb 2015  2071.6000 26556.353   7684.04747
## Mar 2015 -1925.2727 28327.837  20327.43604
## Apr 2015  -685.5828 30515.340  -5756.75677
## May 2015  -821.2551 32702.842  -8968.58730
## Jun 2015  1040.4846 35311.515    154.99992
## Jul 2015   747.7001 37920.189  -4580.88866
## Aug 2015  -432.3683 40501.539 -10057.17073
## Sep 2015  -960.8065 43082.890 -17001.08306
## Oct 2015  -103.5304 45810.396  11981.13414
## Nov 2015   486.5990 48537.903   9108.49802
## Dec 2015  1679.0011 51765.326  -8963.32753
## Jan 2016 -1096.5685 54992.750  12322.81865
## Feb 2016  2071.6000 57445.000  32552.40031
## Mar 2016 -1925.2727 59897.250 -39046.97682
## Apr 2016  -685.5828 60141.983  13330.60017
## May 2016  -821.2551 60386.716  -2407.46057
## Jun 2016  1040.4846 58737.660  16719.85509
## Jul 2016   747.7001 57088.605  20741.69494
## Aug 2016  -432.3683 53906.252  11748.11617
## Sep 2016  -960.8065 50723.899   9901.90715
## Oct 2016  -103.5304 46491.068 -20531.53769
## Nov 2016   486.5990 42258.237 -10400.83585
## Dec 2016  1679.0011 37841.641  36936.35815
## Jan 2017 -1096.5685 33425.045 -19035.47611
## Feb 2017  2071.6000 29831.949 -15300.54906
## Mar 2017 -1925.2727 26238.854  -9404.58078
## Apr 2017  -685.5828 22702.980  -6012.39721
## May 2017  -821.2551 19167.106  -3384.85135
## Jun 2017  1040.4846 15789.875  -3177.35931
## Jul 2017   747.7001 12412.643   4867.65693
## Aug 2017  -432.3683  9268.890   6236.47844
## Sep 2017  -960.8065  6125.137   9360.66968

4.5 Forecasting Number of Future Asylum Seekers in Germany

The ARIMA forecasting method shows possible future changes in the number of asylum seekers in Germany in the next years The wide confidence intervals show the uncertainty in forecasting with the dark grey representing 95 percent confidence and the light grey representing 80 percent confidence

plot(forecast(auto.arima(Germany_monthly), 30), main = "ARIMA Forecast: Germany Asylum Seeker Arrivals", ylab = "Number of Asylum Seekers", xlab = "Year", ylim=c(0, 90000))

ARIMA Forecast Values

forecast(auto.arima(Germany_monthly), 24)
##          Point Forecast        Lo 80    Hi 80      Lo 95    Hi 95
## Oct 2017      13600.045   4001.42590 23198.66  -1079.776 28279.87
## Nov 2017      12602.114   2690.66757 22513.56  -2556.135 27760.36
## Dec 2017       9783.970   -539.22427 20107.16  -6003.993 25571.93
## Jan 2018      12492.452   1138.14968 23846.75  -4872.455 29857.36
## Feb 2018       4125.247  -8174.02286 16424.52 -14684.863 22935.36
## Mar 2018      22453.966   9277.32413 35630.61   2302.031 42605.90
## Apr 2018      10594.123  -3405.01062 24593.26 -10815.704 32003.95
## May 2018      14587.126   -188.78676 29363.04  -8010.682 37184.93
## Jun 2018       8506.528  -7007.31837 24020.38 -15219.853 32232.91
## Jul 2018       7885.977  -8332.26208 24104.22 -16917.679 32689.63
## Aug 2018      12268.575  -4624.71179 29161.86 -13567.478 38104.63
## Sep 2018      13974.220  -3568.15671 31516.60 -12854.530 40802.97
## Oct 2018      19766.918   1900.25116 37633.58  -7557.791 47091.63
## Nov 2018      18144.497   -251.95305 36540.95  -9990.446 46279.44
## Dec 2018       8374.367 -10523.66592 27272.40 -20527.680 37276.41
## Jan 2019      22188.573   2857.62113 41519.53  -7375.567 51752.71
## Feb 2019      19746.164     -8.22251 39500.55 -10465.563 49957.89
## Mar 2019      21940.352   1771.41815 42109.29  -8905.370 52786.07
## Apr 2019      21460.855    885.72496 42035.98 -10006.091 52927.80
## May 2019      22219.733   1246.27226 43193.19  -9856.407 54295.87
## Jun 2019      20951.172   -413.19458 42315.54 -11722.807 53625.15
## Jul 2019      20087.011  -1661.23559 41835.26 -13174.062 53348.08
## Aug 2019      21572.478   -552.98949 43697.95 -12265.504 55410.46
## Sep 2019      22135.917   -360.44712 44632.28 -12269.303 56541.14

The TBATS forecasting method shows another possible future change in the number of asylum seekers in Germany in the next years

plot(forecast(tbats(Germany_monthly), 30), main = "TBATS Forecast: Germany Asylum Seeker Arrivals", ylab = "Number of Asylum Seekers", xlab = "Year", ylim=c(0, 90000))

TBATS Forecast Values

forecast(tbats(Germany_monthly), 24)
##          Point Forecast     Lo 80    Hi 80     Lo 95    Hi 95
## Oct 2017       17677.72 12843.324 24331.86 10844.966 28815.39
## Nov 2017       21482.21 15101.356 30559.19 12531.104 36827.17
## Dec 2017       17205.55 11693.651 25315.53  9531.590 31057.88
## Jan 2018       15371.73 10134.801 23314.71  8129.215 29066.77
## Feb 2018       17522.07 11242.393 27309.38  8888.643 34541.02
## Mar 2018       15753.26  9844.956 25207.34  7676.085 32329.65
## Apr 2018       14612.84  8911.857 23960.77  6859.269 31130.86
## May 2018       17094.15 10186.737 28685.32  7745.093 37728.38
## Jun 2018       17283.33 10070.144 29663.29  7565.720 39482.50
## Jul 2018       16052.74  9158.985 28135.25  6805.177 37866.81
## Aug 2018       15243.82  8521.070 27270.52  6262.908 37103.21
## Sep 2018       14373.66  7877.165 26227.99  5729.283 36060.75
## Oct 2018       17677.72  9519.380 32827.97  6859.701 45556.21
## Nov 2018       21482.21 11365.829 40602.86  8114.143 56874.17
## Dec 2018       17205.55  8929.264 33152.89  6309.918 46915.19
## Jan 2019       15371.73  7832.675 30167.21  5481.564 43106.30
## Feb 2019       17522.07  8776.609 34981.94  6086.666 50441.87
## Mar 2019       15753.26  7756.225 31995.61  5330.319 46557.28
## Apr 2019       14612.84  7077.428 30171.27  4821.688 44286.35
## May 2019       17094.15  8148.019 35862.68  5504.322 53087.34
## Jun 2019       17283.33  8108.219 36840.83  5431.517 54996.34
## Jul 2019       16052.74  7417.964 34738.70  4929.540 52274.73
## Aug 2019       15243.82  6939.160 33487.34  4574.840 50793.91
## Sep 2019       14373.66  6447.303 32044.75  4217.526 48986.59