View source: R/spflow_matrices.R
derive_spflow_matrices | R Documentation |
spflow()
These are internal functions called within the estimation procedure
derive_spflow_matrices(
id_net_pair,
spflow_networks,
spflow_formula,
spflow_control,
na_rm = FALSE
)
The key to an efficient estimation is to preserve the relational representation of the data for origins, destinations and origins-destinations pairs. This requires to be aware of the following;
there are up to three sources of data: OD-pairs & origin-nodes & destination-nodes
each variable may be used in three different ways: directly & as a spatial lag (like in the SDM) & as an instrument for the S2SLS estimator
the model matrices can be split into five groups
"Y_" = OD-flows (the dependent variable, in matrix form)
"P_" = OD-pair attributes (in matrix form)
"D_" = destination attributes
"O_" = origin attributes
"I_" = intra-regional attributes
The additional separation of model matrices and data-sources makes sense if the list of origins coincides with the list of destinations. In this case, we can use data from the same set of nodes as origin, destination, and intra-regional characteristics and each of these enter the model in different ways.
The model formula interface in spflow()
is used to specify, how the variables
in the data-sources are used.
Any transformations of variables are handled by R's build-in tools and
spatial lags, that are specified in the augments sdm_variables
and
twosls_instrumental_variables
to spflow_control()
are calculated after
transformations have been applied.
Below is an explanation of the formula parts:
"norm" variables are not lagged
"sdm" variables are lagged once and used as explanatory variables
"inst" variables are lagged twice and used as instruments. If a variable is at the same time as instrument and as sdm-variable we have to increase the lags-order to avoid multicollinearity issues \insertCiteDargel2021spflow.
A list containing all design matrices required for estimation, impact calculation and prediction
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.