ts_forecast: Time Series Forecast for Daily Crime Data
Description
This function transforms traditional crime data into a time
series and forecasts future incident counts based on the input data
over a specified duration. The forecast is computed using simple exponential
smoothing with additive errors. Returned is a plot of the time series, trend,
and the upper and lower prediction limits for the forecast.
Usage
ts_forecast(data, start, duration = NULL)
Value
Returns a plot of the time series entered (black), a forecast over the
specified duration (blue), the exponentially smoothed trend for both the
input data (red) and forecast (orange), and the upper and lower bounds for
the prediction interval (grey).
Arguments
data
Data frame of crime or RMS data. See provided Chicago Data Portal
example for reference
start
Start date for the time series being analyzed. The format is as
follows: c('year', 'month', 'day'). See example below for reference.
duration
Number of days for the forecast. If NULL, the default
duration for the forecast is 365 days.