`get_obs_dens()` takes a hyperframe and returns observed densities. The output is used as propensity scores.
get_obs_dens(hfr, dep_var, indep_var, ndim = 128, resolution = NULL, window)list of the following: * `indep_var`: independent variables * `coef`: coefficients * `deviance`: deviance * `null_deviance`: null deviance * `dispersion`: dispersion parameter * `res_df`: average residuals as a dataframe * `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) * `window`: window object used as an input
hyperframe
The name of the dependent variable. Since we need to obtain the observed density of treatment events, `dep_var` should be the name of the treatment variable.
vector of names of independent variables (covariates)
the number of grid cells that is used to generate observed densities. By default = 128 (128 x 128). Notice that as you increase `ndim`, the process gets computationally demanding.
the resolution in km per pixel. If specified, overrides `ndim`. For example, `resolution = 5` creates ~5km x 5km grid cells.
owin object
`get_obs_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.