predCrimMao: Spatio-temporal prediction of crimes in Manaus

Description Usage Arguments Value References Examples

View source: R/predCrimMao.R

Description

This function develops an one-step ahead prediction algorithm based on Poisson dynamic generalized linear model (DGLM) for the count of crime in Manaus.

Usage

1
2
predCrimMao(x, type = "ROUBO", nMap = 2, delta = 0.89, by1 = "week",
  k0 = NULL, UsePrior = FALSE, m0 = NULL, c0 = NULL)

Arguments

x

A data frame containig the following columns:LAT,LONG,DATA,DIA.SEMANA, HORA,PERIODO,Crime.

type

Character string giving the type of crime to make the predictions. In this version only "ROUBO" is available.

nMap

Number of maps to check the quality of predictions.

delta

Discount factor.

by1

Character string specifying the periodicity of the counts. In this version only "week" is available.

k0

Number of periods to use as prior information.

UsePrior

Default is FALSE, if TRUE the algorithm will take the informations of the last prediction from crimes1415 data set to use as prior. Incompatible with k0.

m0

First posterior moment at t-1.

c0

Second posterior moment at t-1.

Value

A map that provides predictions of crime intensity and the mean square error.

References

Harrison, Jeff, and Mike West. Bayesian forecasting & dynamic models. New York: Springer, 1999.

TRIANTAFYLLOPOULOS, K. Dynamic z generalized linear models for non-Gaussian time series forecasting. arXiv preprint arXiv:0802.0219, 2008.

Examples

1
2
data(crimes1415)
predCrimMao(crimes1415,type="ROUBO",by1="week",nMap=2)

lrcastro/PredCrim documentation built on May 21, 2019, 7:52 a.m.