spflow_refit: Refitting spflow models

View source: R/spflow_refit.R

spflow_refitR Documentation

Refitting spflow models

Description

(warning: experimental functionality)
Use the statistics contained in an spflow_model-class() to efficiently estimate new models.

Usage

spflow_refit(
  object,
  refit_type = "ar_family",
  sample_weights = NULL,
  protected_params = "(Intercept)",
  keep_data = FALSE
)

Arguments

object

a spflow_model-class()

refit_type

A character

sample_weights

A list of lists

protected_params

A character

keep_data

A logical, if TRUE the refitted model retains all data of the original

Details

There are three possible ways to refit the model, which can be selected via the refit_type argument.

  • "ar_family" allows to estimate the 9 forms of autocorrelation version detailed in the docs of spflow_control()

  • "stepwise" implements a backward selection procedure for the explanatory variables.

  • "samples" allows to estimate the same model on different sub samples. the interface to this functionality will probably change in future versions.

Value

A list of models

Author(s)

Lukas Dargel

Examples


# fit the most exhaustive model (default)
res <- spflow(y9 ~ . + P_(DISTANCE), multi_net_usa_ge)

# refit the family of 9 models based on different autocorrelation structures
res9_ar <- spflow_refit(res)
compare_results(res9_ar)

# refit based on stepwise selection procedure
res_Xstep <- spflow_refit(res, refit_type = "stepwise")
compare_results(res_Xstep)


LukeCe/spflow documentation built on Nov. 11, 2023, 8:20 p.m.