best.models: Find top models for each flow regime.

Description Usage Arguments Details Value

View source: R/best.models.R

Description

Takes output from compile.vars and determines the best average model for each regime.

Usage

1
2
3
4
5
6
best.models(top_n_list, nvmax, n, unfilled_FDCs, expl, comp.wys,
  save.dir = NULL, cens_level = 0.005, zero.val = 0.001, WY.lim = 10,
  regimes = list(lowflow = c("0.0002", "0.0005", "0.001", "0.002", "0.005",
  "0.01", "0.02", "0.05", "0.1"), medflow = c("0.2", "0.25", "0.3", "0.4",
  "0.5", "0.6", "0.7", "0.75", "0.8", "0.9"), highflow = c("0.95", "0.98",
  "0.99", "0.995", "0.998", "0.999", "0.9995", "0.9998")))

Arguments

top_n_list

Output from compile.vars

nvmax

The maximum number of variables that will be considered in a regression. Prior to 9/2016, the default was 6.

n

The maximum number of models subsetted. Prior to 9/2016, the default was 20.

unfilled_FDCs

A matrix of the raw FDC quantiles 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.

comp.wys

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

save.dir

(optional) A directory to which results are to be saved. The default behavior save.dir=NULL does not save results.

cens_level

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

zero.val

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

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.

regimes

(optional) A list of two or more elements (names(regimes) = c('lowflow','medflow','highflow')), where each element is a character vector indicating the frequencies of each quantile. The default is list(lowflow = c("0.0002","0.0005","0.001","0.002","0.005","0.01","0.02", "0.05","0.1"),medflow = c("0.2", "0.25", "0.3", "0.4", "0.5","0.6", "0.7", "0.75", "0.8", "0.9"),highflow = c("0.95", "0.98", "0.99", "0.995", "0.998", "0.999", "0.9995", "0.9998")).

Details

This function outputs the top 3 models for each flow regime by both adjusted R^2 and AIC (for a total of 6 models). It takes the average adjusted R^2 and AIC across quantiles within a flow regime by each number of variables, and whichever number of variables has the highest R^2 or lowest AIC is the "best" type of model for the flow regime.

Value

Top three models (by AIC and adjusted R2) for each regime.


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