Daily Homicides in Mexico (preliminary data) - ⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀
What is a Generalized Additive Model (GAM)?
A Generalized Additive Model, or GAM, is a type of statistical model used to understand how different factors influence something you're measuring— for example, daily homicides. It works by fitting smooth curves through noisy data to reveal the underlying patterns.
What Does "Additive" Mean?
Instead of using one complicated formula, a GAM breaks the problem into parts and adds the effects together. For instance, it might separately estimate:
- How things change over time (long-term trend)
- How each month of the year affects the outcome (seasonality)
- How different days of the week behave (weekday vs. weekend)
- How specific holidays influence the result
Each of these effects gets its own flexible curve, and the model adds them up to make a prediction.
Why Adjust for Seasonality, Weekdays, and Holidays?
- Seasonality: Some patterns repeat over the year (e.g., more crime in summer).
- Day of the Week: Behavior often shifts between weekdays and weekends.
- Holidays: Events like Christmas or Independence Day may cause spikes or drops.
What Does the Model Output?
The model produces a daily prediction based on all these factors.