To determine the growth constant for the US population from 1790-1850, a non-linear least squares regression model was fit to an exponential curve via the nls2 package. The year 1790 will be represented as 0 to prevent experimental analysis errors, and the population of the United States in the following decades until 1850, was recorded and processed, indicating an evident first order exponential growth function as the population grows rapidly over time.
## Data set provided is the US Population Growth from 1790-1850 where year 1790 = 0
Year <- c(0,10,20,30,40,50,60)
Year
## [1] 0 10 20 30 40 50 60
# Population in Millions
Pop <- c(3.929, 5.308, 7.240, 9.638, 12.866, 17.069, 23.192)
Pop
## [1] 3.929 5.308 7.240 9.638 12.866 17.069 23.192
# Graphing the US Population Growth from 1790-1850
plot(Year, Pop,xlab = 'Years from 1790 (0) to 1850 (60)',ylab = 'Population (in millions)',main = 'US Population Growth from 1790-1850', col = "#2a5d7f")
As shown, the curve is based on a first order reaction for exponential growth, a function represented by the following equation: \[ A = A_i \times exp^{kt} \]
For non-linear least squares regression, or the fitting of challenging non-linear models, a package in R markdown was used, known as ‘nls2’. The curve was best fit to the plotted data points on the exponential plot and in fitting a non-linear model to the data, information about the k value can be extracted:
## nls2 package
library(nls2)
## Loading required package: proto
fitline <- nls2(Pop ~ Ai*exp(k * Year),
start = list(Ai = 3.929, k = 0.05),
)
# Estimated parameters
summary(fitline)
##
## Formula: Pop ~ Ai * exp(k * Year)
##
## Parameters:
## Estimate Std. Error t value Pr(>|t|)
## Ai 3.9744064 0.0407277 97.58 2.14e-09 ***
## k 0.0293421 0.0002023 145.02 2.96e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.09817 on 5 degrees of freedom
##
## Number of iterations to convergence: 5
## Achieved convergence tolerance: 7.969e-08
plot(Year, Pop,xlab = 'Years from 1790 (0) to 1850 (60)',ylab = 'Population (in millions)',main = 'US Population Growth from 1790-1850', col = "#2a5d7f")
# Fitting exponential curve line
lines (Year,predict (fitline), col = "purple")
In fitting the exponential data set for the US Population Growth from 1790 to 1850 to a non-linear model/curve, precise estimated parameters for K was calculated and determined to be .0293421. As the line demonstrates an excellent fit to the data points of the first order exponential growth curve, the k value can be deemed considerably accurate. Finally, the estimated parameter for \(A_i\) which is the initial population size at year 0 was determined to be 3.9744064 which is also considerably close to the actual data point for the US population in 1790 or year 0, which was 3.929, further deeming the line a good fit.