Home
  • Portfolio
  • Tableau
  1. Reports
  2. The Economist & Data Scientist Role in Public Security
  • Reports
    • BI with SQL & Markdown
    • BI as Code
    • Docs as Code
    • Slides as Code
    • Duckdb & Evidence
    • Duckdb & Google Sheets
    • Judiciary Elections in Mexico
    • Social Security in Mexico
    • National Guard in Mexico
    • The Economist & Data Scientist Role in Public Security
    • Plotting with ggplot2 in Python
    • Understanding Spotify User Behavior
    • Gasoline Prices in Mexico
    • Farmacias Similares Locations
    • Cluster analysis with Python and Polars
  • Slideshows
    • Gasoline Prices in Mexico
    • Water Collection Systems in Mexico
    • Goodbye, Lake Zumpango
    • Why BI tools Fall short
    • Window Functions in SQL
    • Dashboards vs Web reports
  • Dashboards
    • Gasoline Prices in Mexico
    • Farmacias Similares Dashboard
    • Mexico City Crime Dashboard
    • Streamlit Financial Dashboard
    • Percepción de Seguridad en México ENSU 2015-2025
    • Car Sales Dashboard

Table of Contents

  • Analyzing Data, from Crime Trends to Resource Allocation
    • Economist Contributions
    • Data Scientist Contributions
    • Synergistic Collaboration
  • Key functions that an economist and data scientist might perform in public security.
  • Conclusions
  • References
  • Contact
  1. Reports
  2. The Economist & Data Scientist Role in Public Security

Analyzing Data, from Crime Trends to Resource Allocation

The Economist and Data Scientist Role in Public Security
May, 2025

Jesus LM
Economist & Data Scientist

Image by NBER

The combination of economic and data science expertise can be highly valuable in enhancing public security. Here’s a breakdown of how these professionals can contribute.

Economist Contributions



  • Analyzing the Economic Roots of Crime

    Economists can study the correlation between economic factors (poverty, unemployment, inequality) and crime rates. They can analyze how economic policies impact crime rates, helping policymakers understand the potential consequences of their decisions.

  • Cost-benefit analysis of crime prevention programs

    Economists can evaluate the economic efficiency of various public security initiatives.

  • Resource Allocation

    They can help optimize the allocation of public security resources, ensuring that funds are directed towards the most effective programs and areas. Analyzing the economic impact of crime on communities and businesses.

  • Understanding illicit economies

    Analyzing the economic structures of illegal markets, such as those involving drugs, human trafficking, or illegal arms sales. Evaluating the effectiveness of policies aimed at disrupting these markets.

Data Scientist Contributions



  • Predictive Policing

    Data scientists can develop models to predict crime hotspots and identify individuals at high risk of involvement in criminal activity.
    Analyzing crime patterns and trends to inform resource deployment.

  • Data-Driven Crime Analysis

    They can analyze large datasets from various sources (police reports, social media, etc.) to identify patterns and insights that would be difficult to detect manually. Using geospatial analysis to map crime hotspots and understand spatial patterns.

  • Improving Law Enforcement Efficiency

    Developing tools to automate tasks, improve data management, and enhance communication between law enforcement agencies. Analyzing the effectiveness of law enforcement strategies and identifying areas for improvement.

  • Fraud Detection

    Data Scientists can build models that detect fraudulent activities, which are often connected to organized crime.

  • Analyzing the effects of social programs

    They can analyze the effects of social programs on crime rates, and help determine which programs are the most effective.

Synergistic Collaboration

When economists and data scientists collaborate, they can provide a more comprehensive understanding of public security challenges. Economists can provide the context and theoretical framework, while data scientists can provide the tools and techniques for analyzing the data. This interdisciplinary approach can lead to more effective and evidence-based public security policies. In essence, by combining economic theory with data-driven analysis, these professionals can play a vital role in creating safer and more secure communities.

Key functions that an economist and data scientist might perform in public security.


Crime Pattern Analysis and Prediction

  • Economist Focus

    Analyze how economic conditions (e.g., unemployment, poverty, income inequality) correlate with crime rates in specific areas. Develop economic models to explain these relationships.

  • Data Scientist Focus

    Use machine learning algorithms to identify patterns in crime data (time, location, type of crime, offender demographics). Build predictive models to forecast future crime hotspots and times.

import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor

def predict_crime_hotspots(crime_data, features, target, test_size=0.2):
    """
    Predicts crime hotspots using a Random Forest Regressor model.

    Args:
        crime_data (pd.DataFrame): DataFrame containing crime data.
        features (list): List of feature columns to use for prediction.
        target (str): The target variable (e.g., 'crime_rate').
        test_size (float): Proportion of the data to use for testing.

    Returns:
        tuple: (model, X_test, y_test) - Trained model, test features, 
        and test target.
    """
    X = crime_data[features]
    y = crime_data[target]

    X_train, X_test, y_train, y_test = train_test_split(X, y, 
    test_size=test_size, random_state=42)

    model = RandomForestRegressor(n_estimators=100, random_state=42)
    model.fit(X_train, y_train)

    return model, X_test, y_test

Example usage:

''' 
Assuming 'crime_data' is a DataFrame with columns like:
    'location_x', 'location_y', 'time', 'crime_type', 
    'unemployment_rate', 'poverty_rate', 'crime_rate'
'''

features = ['location_x', 'location_y', 'time', 'crime_type', 
            'unemployment_rate', 'poverty_rate']
target = 'crime_rate'
model, X_test, y_test = predict_crime_hotspots(crime_data, features,
                                                target)
predictions = model.predict(X_test)
print(predictions)

Conclusions

In summary, the combined expertise of economists and data scientists offers a powerful toolkit for enhancing public security. Economists illuminate the underlying causes of crime, while data scientists provide the means to predict, prevent, and effectively respond to threats. Embracing this interdisciplinary approach is crucial for developing smarter, more targeted, and ultimately more successful strategies for creating safer communities.

References

  • NBER (2025). Economics of Crime. Retrieved from website.

Contact

Jesus LM
Economist & Data Scientist

Linkedin | Medium | Twitter

National Guard in Mexico
Plotting with ggplot2 in Python
 
  • License

  •   © 2026