Introduction

GNI per capita (formerly GNP per capita) is the gross national income, converted to U.S. dollars using the World Bank Atlas method, divided by the midyear population. GNI is the sum of value added by all resident producers plus any product taxes (less subsidies) not included in the valuation of output plus net receipts of primary income (compensation of employees and property income) from abroad. “GNI, calculated in national currency, is usually converted to U.S. dollars at official exchange rates for comparisons across economies, although an alternative rate is used when the official exchange rate is judged to diverge by an exceptionally large margin from the rate actually applied in international transactions”(worldbank). To smooth fluctuations in prices and exchange rates, a special Atlas method of conversion is used by the World Bank. “This applies a conversion factor that averages the exchange rate for a given year and the two preceding years, adjusted for differences in rates of inflation between the country, and through 2000, the G-5 countries (France, Germany, Japan, the United Kingdom, and the United States)”(worldbank). “From 2001, these countries include the Euro area, Japan, the United Kingdom, and the United States”(worldbank).

Bangladesh a South-East Asian country, which falls under a lower middle income level country. Considering this r-project, I have decided to show the exponential growth of the “Gross National Income” (GNI) of Bangladesh from 2000 to 2020. The data set is retrieved from “datatopics.worldbank.org”. My x-values are the years from 2000-2020 and my y-values are the GNI (units per billion PPP dollars)

The Data Table

Year <- c(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
GNI <- c(175.5,188.1,200.2,213.7,231.6,254.7,283.1,313.5,342.9,363.7,389.1,
         422.2,481.1,518.8,555.1,591.6,643.1,693,767.3,846.1,875.0)
dframe <- data.frame(Year, GNI)
knitr::kable(dframe, caption = "Gross National Income of Bangladesh from 2000-2020 (GNI in Billions)") 
Gross National Income of Bangladesh from 2000-2020 (GNI in Billions)
Year GNI
0 175.5
1 188.1
2 200.2
3 213.7
4 231.6
5 254.7
6 283.1
7 313.5
8 342.9
9 363.7
10 389.1
11 422.2
12 481.1
13 518.8
14 555.1
15 591.6
16 643.1
17 693.0
18 767.3
19 846.1
20 875.0

Plotted Data

Considering the data mentioned in “The Data Table,” will generate an exponential growth curve when plotted as a graph. The R-code used to generate this plot is mentioned below,

Year <- c(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
GNI <- c(175.5,188.1,200.2,213.7,231.6,254.7,283.1,313.5,342.9,363.7,389.1,
         422.2,481.1,518.8,555.1,591.6,643.1,693,767.3,846.1,875.0)
plot(Year,GNI,main="Exponential growth of the Gross National Income 
of Bangladesh from 2000-2020",xlab="Years (2000-2020)",
ylab="Gross National Income (units per billion PPP dollars)")

Nonlinear Fitting

Considering the “Plotted Data,” we can observe that the graph shows a exponential trend. To show the nonlinear fitting the R-command nonlinear least squares (nls) is performed. “The nls function uses a relative-offset convergence criterion that compares the numerical imprecision at the current parameter estimates to the residual sum-of-squares”(RDocumentation). The R-code used for the nonlinear regression analysis is mentioned below,

fit <- nls(GNI ~ alpha * exp(k*Year) ,  
                   start = c(alpha = 180, k = .1))
plot(Year,predict(fit),main="Exponential Fit of Bangladesh's GNI from 2000-2020",
xlab="Years(2000-2020)",
ylab="Gross National Income (units per billion PPP dollars)")
lines(Year, predict(fit),col = "red4")

We can observe from the fitted graph the red line passes smoothly through all the points, proving that the fitted parameters are reasonable . To have a better understanding of the fitted parameters, a summary is generated using “summary (fit)” command on R.

Summary

summary(fit)
## 
## Formula: GNI ~ alpha * exp(k * Year)
## 
## Parameters:
##        Estimate Std. Error t value Pr(>|t|)    
## alpha 1.739e+02  2.573e+00   67.58   <2e-16 ***
## k     8.205e-02  9.367e-04   87.60   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 9.982 on 19 degrees of freedom
## 
## Number of iterations to convergence: 4 
## Achieved convergence tolerance: 1.488e-06

Regarding the summary(fit), we can observe that the residual standard error is 9.982, which is relatively small and indicates that the points are well scattered around the regression line. To further prove this notion a residuals plot was generated. The R-codes used in generating this is mentioned below,

plot(Year,residuals(fit),main="Residuals Fit of Bangladesh's GNI from 2000-2020",
xlab="Years(2000-2020)", ylab="Gross National Income (units per billion PPP dollars)")
abline(0,0)

The residuals plot concludes our previous statement as we can observe the points well scattered around the fitted regression line. Indicating the exponential regression is a good fit.

Conclusion

From this experiment we can conclude that regarding the small residual standard error shown in “Summary” our exponential growth function was a good fit and therefore, no logistic function was necessary.