SURfit function

Fit SUR models with or without constraints

Fit SUR models with or without constraints

A wrapper for the systemfit::systemfit

function that will construct formulas for all equations based on specified moderators. This function was NOT designed for user-level functionality, but rather exists to be embedded within fitNetwork. The purpose for making it available to the user is for allowing the exact fitted model to be highly customizable.

SURfit( data, varMods = NULL, mod = "min", maxiter = 100, m = NULL, type = "g", center = TRUE, scale = FALSE, exogenous = TRUE, covs = NULL, sur = TRUE, consec = NULL, ... )

Arguments

  • data: Dataframe or matrix containing idiographic temporal data.
  • varMods: Output of varSelect or modSelect. The latter must be applied to resample results in order for it to work as input for this argument.
  • mod: Character string. Only applies if output from varSelect or modSelect is used to constrain the model, and cross-validation "CV" was set as the criterion for model/variable selection. Options include "min", which uses the lambda value that minimizes the objective function, or "1se" which uses the lambda value at 1 standard error above the value that minimizes the objective function.
  • maxiter: Numeric. The maximum number of iterations to attempt before stopping the function.
  • m: Character string or numeric value to specify the moderator (if any).
  • type: Indicates the type of model to use, either "g" for gaussian, or "c" for categorical (i.e., binary, at present). This argument should not be edited by the user, as the appropriate input will automatically be detected.
  • center: Logical. Determines whether to mean-center the variables.
  • scale: Logical. Determines whether to standardize the variables.
  • exogenous: Logical. See fitNetwork function for details.
  • covs: something
  • sur: Logical. Provides input to the method argument of the systemfit::systemfit function. If TRUE, then the method will be "SUR". If FALSE, then the method will be "OLS". These two methods only differ when constraints are applied. When a saturated model is fit, both methods produce the same results.
  • consec: A logical vector that identifies which values to include in accordance with the beepno and dayno arguments in the fitNetwork function.
  • ...: Additional arguments.

Returns

A SUR model, as fit with the systemfit::systemfit function.

Details

See the systemfit package for details on customizing systemfit::systemfit objects. Constraints can be applied via the varMods argument, which is intended to facilitate the output of the varSelect and resample functions. These objects can be further edited to apply constraints not specified by these automated functions. Moreover, there are a variety of additional arguments that can be supplied to the systemfit::systemfit function if desired.

If the variable selection results from resample are intended to be used as input for the varMods argument, then these results must be fed into the modSelect function.

See Also

SURnet, fitNetwork, systemfit::systemfit

  • Maintainer: Trevor Swanson
  • License: GPL (>= 3)
  • Last published: 2021-10-01