Problema Asignado 18.9

After having made a model for the Dutch police about burglaries by occasional burglars and organized criminals, you are now asked to make a simulation model about home burglaries (from now on referred to as burglaries) and shop robberies (from now on referred to as robberies) with a time horizon of 10 years for a particular police precinct. Burglary and robbery are both ‘High Impact Crimes’. Such models are needed since burglaries and robberies are substitutes: more/better preventive measures against robberies lead to more burglaries, and vice versa. Use the following information, obtained during interviews and background research, in your model.

The first iteration In this precinct, burglaries and robberies are committed by locals, initially by some 200 known offenders at liberty and –so the police thinks– by some 750 unknown offenders at liberty. The average number of offenses per known offender at liberty amounts to 2.5 per year and the average number of offenses per unknown offender is assumed to amount to 1 per year. Burglaries are seasonal: the number of seasonal robberies and burglaries could be modeled as the seasonality of these offenses times the sum of the number of offenses per known offender at liberty times the number of known offenders at liberty and the number of offenses per unknown offender times the unknown offenders at liberty. Model the seasonality of these offenses such that the number of offenses reaches its peak at the end of the year and its low during the summer holidays, and that the peak is 50% higher than the average and the low 50% lower. The number of burglaries could be calculated as the relative attractiveness of burglary times the number of seasonal robberies and burglaries. The relative attractiveness of burglary could be calculated as the attractiveness of burglary divided by the sum of the attractiveness of burglary and the attractiveness of robbery. The attractiveness of burglary is proportional to the average gain per burglary and inversely proportional to both the chance of being caught after a burglary and the relative difficulty of a burglary. The average gain per burglary is e600, the chance of being caught after a burglary is 8%, and the relative difficulty of a burglary is the norm for all High Impact Crimes, i.e. it equal to 100%. The number of effective arrests after burglaries equals the chance of being caught after a burglary times the number of burglaries. Do the same for robberies3. Assume that the relative difficulty of a robbery is 10 times higher than the relative difficulty of a burglary, that the average gain per robbery is about e1200, and that the chance of being caught after a robbery is about 33%. Model the total number of arrests after burglaries and robberies as a 3rd order delay of the sum of arrests after burglaries and arrests after robberies with a delay time of a quarter of a year and an initial value of 100 offenses. The number of known offenders that is sent to jail then consists of the total number of arrests after burglaries and robberies times the number of offenses per known offender at liberty divided by the sum of the number of offenses per known offender at liberty and the number of offenses per unknown offender. The remainder of the arrests are arrests of unknown offenders. In other words, the non-negative number of unknown offenders sent to jail equals the difference between the total number of arrests after burglaries and robberies and the number of known offenders sent to jail. Initially, the number of offenders in jail is equal to 185. This stock only increases through the inflows of unknown offenders sent to jail and known offenders sent to jail, and only decreases through the outflows of known offenders released from jail and those who stop after leaving jail. Assume that 25% stops after leaving jail: model the number of those who stop after leaving jail as the product of the percentage that stops after leaving jail of 25% and the number of offenders in jail, divided by an average time in jail of 2 year. The flow of known offenders released from jail then equals the number of offenders in jail divided by the average time in jail minus the number of those who stop after leaving jail. Do not forget at this point, to adapt the equation of the stock variable known offenders at liberty. That is, known offenders released from jail become, after being released, known offenders at liberty. The number of unknown offenders at liberty is the integral of the new offenders minus the unknown offenders sent to jail over time. Model the number of new offenders as the number of unknown offenders at liberty times the percentage increase of new offenders of 2% per year. After all, petty crime is contagious.

Variables

Variables de Estado Known Offenders at Liberty = 200 Unknown Offenders at Liberty = 750 Offenders in Jail = 185 Total Arrests = 100 c/u

Variables de flujo New offenders entering UOL Unknown offenders arrested Known offenders arrested Known offenders released from jail Offenders who stop after jail

Variables auxiliares endógenas Seasonality Seasonal Offenses Attractiveness of Burglary Attractiveness of Robbery Relative Attractiveness of Burglary Number of Burglaries Number of Robberies Arrests after Burglaries Arrests after Robberies Total Arrests Fraction Known Arrested

Variables auxiliares
Offenses per Known Offender = 2.5
Offenses per Unknown Offender = 1
Average Gain per Burglary = 600
Average Gain per Robbery = 1200 Catch Chance Burglary = 0.08 Catch Chance Robbery = 0.33 Relative Difficulty Burglary = 1
Relative Difficulty Robbery = 10
Percentage Stop after Jail = 0.25 Average Time in Jail = 2 Percentage New Offenders = 0.02 Delay Time Arrests = 0.25 INITIAL TIME = 0
FINAL TIME = 10
TIME STEP = 0.25

InitialConditions <- c(
  KnownOffenders = 200,
  UnknownOffenders = 750,
  Jail = 185
)

parameters <- c(
  OffensesKnown = 2.5,
  OffensesUnknown = 1,
  GainBurglary = 600,
  GainRobbery = 1200,
  CatchBurglary = 0.08,
  CatchRobbery = 0.33,
  DifficultyBurglary = 1,
  DifficultyRobbery = 10,
  PercentStop = 0.25,
  JailTime = 2,
  GrowthUnknown = 0.02
)

times <- seq(0, 10, by = 0.01)
burglary_model <- function(t, state, parameters) {

  with(as.list(c(state, parameters)), {

    Seasonality <- 1 + 0.5 * cos(2 * pi * t)

    TotalOffenses <-
      OffensesKnown * KnownOffenders +
      OffensesUnknown * UnknownOffenders

    SeasonalOffenses <-
      Seasonality * TotalOffenses

    AttractivenessBurglary <-
      GainBurglary /
      (CatchBurglary * DifficultyBurglary)

    AttractivenessRobbery <-
      GainRobbery /
      (CatchRobbery * DifficultyRobbery)

    RelativeBurglary <-
      AttractivenessBurglary /
      (AttractivenessBurglary + AttractivenessRobbery)

    RelativeRobbery <-
      AttractivenessRobbery /
      (AttractivenessBurglary + AttractivenessRobbery)

    Burglaries <-
      RelativeBurglary * SeasonalOffenses

    Robberies <-
      RelativeRobbery * SeasonalOffenses

    ArrestsBurglary <-
      CatchBurglary * Burglaries

    ArrestsRobbery <-
      CatchRobbery * Robberies

    TotalArrests <-
      ArrestsBurglary + ArrestsRobbery

    KnownSentToJail <-
      TotalArrests *
      OffensesKnown /
      (OffensesKnown + OffensesUnknown)

    UnknownSentToJail <-
      pmax(
        0,
        TotalArrests - KnownSentToJail
      )

    StopAfterJail <-
      PercentStop *
      Jail /
      JailTime

    ReleasedKnown <-
      Jail / JailTime -
      StopAfterJail

    NewOffenders <-
      GrowthUnknown *
      UnknownOffenders

    dKnownOffenders <-
      ReleasedKnown -
      KnownSentToJail

    dUnknownOffenders <-
      NewOffenders -
      UnknownSentToJail

    dJail <-
      KnownSentToJail +
      UnknownSentToJail -
      ReleasedKnown -
      StopAfterJail

    list(
      c(
        dKnownOffenders,
        dUnknownOffenders,
        dJail
      ),
      Seasonality = Seasonality,
      TotalOffenses = TotalOffenses,
      SeasonalOffenses = SeasonalOffenses,
      Burglaries = Burglaries,
      Robberies = Robberies,
      ArrestsBurglary = ArrestsBurglary,
      ArrestsRobbery = ArrestsRobbery,
      TotalArrests = TotalArrests,
      KnownSentToJail = KnownSentToJail,
      UnknownSentToJail = UnknownSentToJail,
      ReleasedKnown = ReleasedKnown,
      StopAfterJail = StopAfterJail,
      NewOffenders = NewOffenders
    )

  })

}
out <- ode(
  y = InitialConditions,
  times = times,
  func = burglary_model,
  parms = parameters,
  method = "rk4"
)

out <- as.data.frame(out)
par(mfrow = c(3,2))
plot(
  out$time,
  out$KnownOffenders,
  type = "l",
  xlab = "Time (years)",
  ylab = "Known Offenders"
)

plot(
  out$time,
  out$UnknownOffenders,
  type = "l",
  xlab = "Time (years)",
  ylab = "Unknown Offenders"
)

plot(
  out$time,
  out$Jail,
  type = "l",
  xlab = "Time (years)",
  ylab = "Offenders in Jail"
)

plot(
  out$time,
  out$Burglaries,
  type = "l",
  xlab = "Time (years)",
  ylab = "Burglaries"
)

plot(
  out$time,
  out$Robberies,
  type = "l",
  xlab = "Time (years)",
  ylab = "Robberies"
)

Con delays

par(mfrow = c(2,3))

plot(
  out$time,
  out$KnownOffenders,
  type = "l",
  main = "Known Offenders",
  xlab = "Years",
  ylab = ""
)

plot(
  out$time,
  out$UnknownOffenders,
  type = "l",
  main = "Unknown Offenders",
  xlab = "Years",
  ylab = ""
)

plot(
  out$time,
  out$Jail,
  type = "l",
  main = "Offenders in Jail",
  xlab = "Years",
  ylab = ""
)

plot(
  out$time,
  out$Burglaries,
  type = "l",
  main = "Burglaries",
  xlab = "Years",
  ylab = ""
)

plot(
  out$time,
  out$Robberies,
  type = "l",
  main = "Robberies",
  xlab = "Years",
  ylab = ""
)

plot(
  out$time,
  out$TotalArrests,
  type = "l",
  main = "Total Arrests (3rd Order Delay)",
  xlab = "Years",
  ylab = ""
)

par(mfrow = c(1,1))