GithubHelp home page GithubHelp logo

us-shootings's Introduction

Introduction

On January 27th 2021, the Washington Post reported 984 people were shot and killed by the police in 2020. It was also reported that the rate at which black Americans were killed by police is more than twice as high as the rate for white Americans ref. Amongst the killings was that of George Perry Floyd Jr, an unarmed black man that was reported been killed by an officer who knelt on his neck for 8mins and 46 seconds. This sparked an outrage in the US marked by weeks of unrest all over the country. This incident and many others has motivated the current president, Joe Biden to issue series of executive presidential orders to address racial inequality in federal policy.

Project Objective

We aimed at applying time series anlysis techniques in order to forecast the number of deaths per week in the nearest future given the current and past deaths of US citizens by the police department in the USA.

Methodology

About the Data

The dataset contains 4,851 every day killings by the US police from 2015-01-02 till 2020-06-15. It caputure information such as the name, manner of death, race, armed etc source.
For our analysis we aggregated the data into weekly killings (287). To train our model, we use 90% of the data (258 obs) and left out 10% (29) for the test data set.

Modelling

Several ARMA models were tested on the train dataset and the model with the smallest aic was choosen. To check how well our model was doing, we calculated mean square error by using the final model to predict the the test observations.
All implementation can be seen in the shooting_ts notebook

Results

Data Exploration

Looking at the various exploratory plots as seen below and also based on the values of ACF and PACF, we could see a slight downward trend detected in the time series plot. Also the values of ACF and PACF were not trailling off quicky at early lags. No form of seasonality was found and the data looks normally distributed.

drawing

The train dataset was detrended which led to better results as we see in the ACF and PACF plot below.

drawing drawing

Model Results

Based on ACF and PACF values, we ran several ARMA models with AR order from 0 - 4 and MA order 0 - 2 on the detrended data and ARMA (3,0,1) with aic 1524.3 was found to best fit our data. The model diagnostics as seen below looks good.
drawing The standardized residuals seems to fluctuate around the zero line with possible outliers. QQ plot shows residuals lying on the straight line with some deviations at the ends. ACF plot shows pattern of a white noise.

Model Predictions

To evaluate the model, we predicted the test observations and compared with the actual observations. drawing Our model seems not tp be doing well as the predicted values in green do not correspond or match with observed values in orange. Also our MSE is quite high (25.96). We tried other ARMA models but seems not to get better results

Conclusion

The ARMA(3,1,1) model on the train data does not seems to be good model to predict the number of deaths per week by US police in the USA. Other time series model can be exploited for better results.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.