Introduction

This document explores the population growth of the United States between 1790 and 1850. We will fit an exponential model to the data and visualize the results.

Data and Plot

Data Overview

The data below represents the US population (in millions) from the years 1790 to 1850:

# Data for the population and years
year <- c(0, 10, 20, 30, 40, 50, 60)
pop <- c(3.929, 5.308, 7.240, 9.638, 12.866, 17.069, 23.192)

# Create a data frame
data <- data.frame(year, pop)
# Load necessary libraries
library(ggplot2)

# Plot the data
ggplot(data, aes(x = year, y = pop)) +
  geom_point(color = "blue", size = 3) +
  labs(title = "US Population Growth from 1790 to 1850", 
       x = "Years from 1790", 
       y = "Population in Millions") +
  theme_minimal()

Model Fitting

We fit an exponential growth model to the population data. The exponential model assumes that the population grows at a constant rate, which can be described by the equation: \[ \text{pop} = \text{pop_ini} \cdot \exp(k \cdot \text{year}) \]

where: - \(\text{pop_ini}\) is the initial population in 1790. - \(k\) is the growth rate of the population. - \(\text{year}\) is the number of years since 1790.

# Load the nls2 library for non-linear fitting
library(nls2)
## Loading required package: proto
# Fit the exponential model
exp_model <- nls2(pop ~ pop_ini * exp(k * year), 
                  start = list(pop_ini = 3.929, k = 0.05), 
                  data = data)

# Extract the coefficients (pop_ini and k)
coef(exp_model)
##    pop_ini          k 
## 3.97440643 0.02934212

Model Coefficients

The fitted values for the model parameters are:

Initial Population (pop_ini) = r round(coef(exp_model)[1], 2)
Growth Rate (k) = r round(coef(exp_model)[2], 4)

These values provide an estimate of the population’s initial size in 1790 and the growth rate over the time period considered.

Results and Discussion

Fitted Model

We can now visualize the fitted exponential curve alongside the original data. The following plot shows the population data and the fitted exponential growth curve.

# Plot data with exponential fit
ggplot(data, aes(x = year, y = pop)) +
  geom_point(color = "blue", size = 3) + # Points remain with 'size'
  stat_function(fun = function(x) coef(exp_model)[1] * exp(coef(exp_model)[2] * x), 
                color = "red", linewidth = 1) + # Use 'linewidth' instead of 'size' for lines
  labs(title = "US Population Growth from 1790 to 1850 with Exponential Fit", 
       x = "Years from 1790", 
       y = "Population in Millions") +
  theme_minimal() +
  annotate("text", x = 50, y = 17, 
           label = paste("pop_ini =", round(coef(exp_model)[1], 2), 
                         "\nk =", round(coef(exp_model)[2], 4)),
           color = "red", size = 5, fontface = "italic")

From the plot, we can see that the exponential model provides a reasonable fit to the population data. The red curve shows the predicted population values based on the model, and it closely matches the observed data points.

Discussion

The exponential model suggests that the population of the US grew at a constant rate over the 60-year period from 1790 to 1850. The fitted growth rate kk indicates that the population was increasing at a specific rate each decade. This type of growth pattern is typical for early-stage population dynamics, where growth is accelerated due to factors such as higher birth rates and immigration.

While the model fits the data well, it is important to note that the exponential growth model may not capture more complex dynamics that might occur later (e.g., population saturation, policy impacts, etc.). Nonetheless, the exponential model is a useful approximation for this early period in US population history.

Conclusion

This analysis has shown that the US population from 1790 to 1850 can be modeled effectively using an exponential growth function. The model’s parameters, including the initial population and the growth rate, have been estimated and plotted. Although the exponential model provides a good fit to the data, future work could explore more complex models to account for different growth dynamics.

In this study, we have demonstrated how non-linear fitting can be applied to historical demographic data to gain insights into population trends. Further research could extend this approach to other periods or countries.