spflow_model-class: Class spflow_model

Description Usage Arguments Slots Main results See Also Examples

Description

An S4 class that contains the estimation results of spatial econometric interaction models estimated by the spflow() function.

There are four subclasses that are specific to the chosen estimation method (OLS, MLE, Bayesian MCMC or S2SLS). They contain some additional information specific to the corresponding method but most behaviours and data are identical among them.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## S4 method for signature 'spflow_model'
coef(object)

## S4 method for signature 'spflow_model'
fitted(object)

## S4 method for signature 'spflow_model'
nobs(object)

## S4 method for signature 'spflow_model'
predict(object, ..., type = "BP")

## S4 method for signature 'spflow_model'
resid(object)

## S4 method for signature 'spflow_model'
results(object)

## S4 method for signature 'spflow_model'
sd_error(object)

## S4 method for signature 'spflow_model_mle'
logLik(object)

## S4 method for signature 'spflow_model_mle_s2sls_ols'
varcov(object)

## S4 method for signature 'spflow_model_mcmc'
mcmc_results(object)

Arguments

object

A spflow_model-class()

...

Further arguments passed to the prediction function

type

A character declaring the type of prediction (for now only "BP")

Slots

estimation_results

A data.frame that contains the main results() of the estimation

estimation_control

A list that contains all control parameters of the estimation (see spflow_control())

N

A numeric that corresponds to the number of origin-destination pairs (the sample size in this model)

sd_error

A numeric representing the standard deviation of the residual

R2_corr

A numeric that serves as a goodness of fit criterion. The R2_corr is computed as squared correlation between the fitted values and the observed values of the dependent variable.

resid

A numeric vector of regression residuals

fitted

A numeric vector of fitted values computed as the in sample prediction trend signal (TS) prediction described by @Goulard2017

spatial_filter_matrix

A matrix (can be sparse) or NULL

design_matrix

A matrix (can be sparse) or NULL

varcov

A matrix or NULL

ll

A numeric or NULL

AIC

A numeric or NULL

BIC

A numeric or NULL

mcmc_results

A data.frame containing the estimated parameters for each iteration of the MCMC sampling procedure

Main results

The main results are accessed with the results() method. They are given in the form of a data frame with the following columns;

See Also

spflow(), spflow_network_classes()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
spflow_results <- spflow(y9 ~ . + G_(DISTANCE),multi_net_usa_ge)

# General methods
results(spflow_results) # data.frame of main results
coef(spflow_results) # vector of estimated coefficients
fitted(spflow_results) # vector of fitted values
resid(spflow_results) # vector of residuals
nobs(spflow_results) # number of observations
sd_error(spflow_results) # standard deviation of the error term
predict(spflow_results) # computation of the in sample predictor

# MLE methods
logLik(spflow_results) # value of the likelihood function

# MLE, OLS and S2SLS methods
varcov(spflow_results) # variance covariance matrix of the estimators

# MCMC methods
spflow_results_mcmc <- spflow(
  y2 ~ . + G_(DISTANCE),
  multi_net_usa_ge,
  flow_control = spflow_control(estimation_method = "mcmc",
                                model = "model_2"))
results(spflow_results)
mcmc_results(spflow_results_mcmc) # parameter values during the mcmc sampling

spflow documentation built on Sept. 9, 2021, 5:06 p.m.