compute.leaps.for: Determine Best Subsets Models

Description Usage Arguments Details Value

View source: R/compute.leaps.for.R

Description

The function compute.leaps.for explores the wide set of candidate best-subsets models for each quantile. The function compute.leaps.foreach accomplishes the same thing using a parallel for loop.

Usage

1
2
3
compute.leaps.for(unfilled_FDCs, filled_FDCs, comp.wys, expl, nvmax, nb,
  WY.lim = 10, zero.val = 0.001, cens_level = 0.005, max.VIF = 10,
  plunge.ahead = T, forced.BC = NULL)

Arguments

unfilled_FDCs

A matrix of the raw FDC quantiles for each site. This is derived from the output of calcEmpFDCs.

filled_FDCs

A matrix of the censor-filled FDC quantiles for each site. This is derived from the output of calcEmpFDCs.

comp.wys

A vector indicating how many complete water years were present for each site. This is derived from the output of calcEmpFDCs.

expl

A data frame of the potential explanatory variables, derived from the output of getBasinChar.

nvmax

The maximum number of variables that will be considered in a regression. When specifying this number, the user should take into consideration the number of sites. Prior to 9/2016 the default was 6.

nb

The maximum number of models that will be considered for each quantile. Prior to 9/2016 the default was 3.

WY.lim

(optional) The minimum number of water years required to be included in the formation of regional regressions. Only reference-quality sites with at least this many complete water years will be used. The default is 10.

zero.val

(optional) The value to which zeroes or negative quantiles will be set to. The default is 0.001.

cens_level

(optional) The value establishing left censoring. The default is 0.005.

max.VIF

(optional) The maximum variance inflation factor permitted in a candidate model. The default is 10.

plunge.ahead

(optional) A logical vector indicating if zero values should or should not be handled with the zero.val. The default is TRUE.

forced.BC

(optional) A single basin characteristic that candidate models are required to include. The default is NULL.

Details

This function creates and ranks regression models. It runs regsubsets on the filled FDCs, and then uses those models in censReg on the unfilled FDCs. All of the FDCs are transformed using the common logarithm. Any model with a variable that has a VIF higher than the user defined limit max.VIF will be dropped. The models are automatically ranked by regsubsets' weighted least-sqaures method, but the reported R^2 and BIC are calculated from censReg.

Value

A list of lists, one for each quantile, with each of those containing one array of models per variable level. The models are automatically ranked by regsubsets' weighted least-sqaures method, but the reported R^2 and BIC are calculated from censReg.


wfarmer-usgs/PUBAD documentation built on May 4, 2019, 5:21 a.m.