Learn R Programming

geocausal (version 0.4.0)

get_adaptive_baseline_dens: Generate adaptive intervention densities based on historical data

Description

`get_adaptive_baseline_dens()` takes a hyperframe for historical data and returns fitted densities for the current data. The output is used as counterfactural densities.

Usage

get_adaptive_baseline_dens(
  hfr_hist,
  hfr_current,
  dep_var,
  indep_var,
  ngrid = 100,
  window
)

Value

list of the following: * `indep_var`: independent variables * `coef`: coefficients * `intens_grid_cells`: im object of observed densities for each time period * `estimated_counts`: the number of events that is estimated by the poisson point process model for each time period * `sum_log_intens`: the sum of log intensities for each time period * `actual_counts`: the number of events (actual counts)

Arguments

hfr_hist

hyperframe for historical data

hfr_current

hyperframe for current data

dep_var

The name of the dependent variable Since we need to obtain the counterfactural density of treatment events, `dep_var` should be the name of the treatment variable.

indep_var

vector of names of independent variables (covariates)

ngrid

the number of grid cells that is used to generate observed densities. By default = 100. Notice that as you increase `ngrid`, the process gets computationally demanding.

window

owin object

Details

`get_adaptive_baseline_dens()` assumes the poisson point process model and calculates observed densities for each time period. It depends on `spatstat.model::mppm()`. Users should note that the coefficients in the output are not directly interpretable, since they are the coefficients inside the exponential of the poisson model.