spflow_model-class()
R/class_generics_and_maybes.R
, R/class_spflow_model.R
predict.Rd
The methods predict()
and predict_effect()
compute spatial predictions.
The former will return the predicted values of the dependent variables and
the later computes the change in its levels given the input data changes.
predict_effect(object, ...)
# S4 method for spflow_model
predict(
object,
new_dat = NULL,
method = "BPA",
approx_expectation = TRUE,
expectation_approx_order = 10,
return_type = "OD",
add_new_signal = FALSE
)
# S4 method for spflow_model
predict_effect(
object,
new_dat,
old_signal = NULL,
approx_expectation = TRUE,
expectation_approx_order = 10,
return_type = "OD",
y_is_log = FALSE
)
not used (generic).
A named list of data.frames that contain the new data.
The names should correspond to spflow_network or spflow_pair
objects contained in the spflow_network_multi-class()
.
A character indicating which method to use for computing the predictions. Should be one of c("TS", "TC", "BP").
A logical, if TRUE
the expected value of the dependent variable is
approximated by a Taylor series. For spatial models this can lead to
significant performance gains.
A numeric, defining the order of the Taylor series approximation.
A character indicating the format of the returned values:
"V" leads to an atomic vector
"M" leads to a OD matrix where missing data is replaced by zeros
"OD" leads to a data.frame with columns being the the values and the id's of the destinations and the origins
A logical, if TRUE
the new signal is added to the as a column to
the results. This only works when the return type is "OD".
A matrix that can be supplied to specify the reference value for the signal. If not given the signal contained in the model is used.
Logical, if TRUE
the dependent variable is considered to be in logarithms and
the effects calculation is adjusted by the method proposed by Laurent et. al. (2023).
Predicted values in the format specified by the argument return_type.
The prediction methods used here have been developed or analyzed by Goulard et al. (2017) . Dargel and Thomas-Agnan (2023) describe how they can be adapted to the case of interaction models.
Dargel L, Thomas-Agnan C (2023).
“Efficient Estimation of Spatial Econometric Interaction Models for Sparse OD Matrices.”
TSE Working Paper, n. 23-1409, February 2023, https://www.tse-fr.eu/publications/generalized-framework-estimating-spatial-econometric-interaction-models.
Goulard M, Laurent T, Thomas-Agnan C (2017).
“About predictions in spatial autoregressive models: optimal and almost optimal strategies.”
Spatial Economic Analysis, 304--325.
https://doi.org/10.1080/17421772.2017.1300679.
-Laurent, Thibault, Paula Margaretic, and Christine Thomas‐Agnan. "Generalizing impact computations for the autoregressive spatial interaction model." Geographical Analysis (2023).