@param y a numpy array of exceedance values (values of the outcome variable above the threshold). For better optimization performance, it is recommended that the ‘y’ have magnitude around one (see ‘Details’), for which one can use ‘scaling’.
@param x a numpy array or pandas data frame with columns corresponding to covariate/predictor/feature variables and each row containing the values of the variable for a block (e.g., often a year with climate data). The number of rows must equal the number of blocks.
@param threshold a single numeric value for constant threshold or a numpy array with length equal to the number of blocks, indicating the threshold for each block.
@param locationFun numpy array of either character strings or indices describing a linear model (i.e., regression function) for the location parameter using columns from ‘x’. ‘x’ must be supplied if this is anything other than ‘None’.
@param scaleFun numpy array of either character strings or indices describing a linear model (i.e., regression function) for the (potentially transformed) scale parameter using columns from ‘x’. ‘x’ must be supplied if this is anything other than ‘None’. ‘logscale’ controls whether this determines the log of the scale or the scale directly.
@param shapeFun numpy array of either character strings or indices describing a linear model (i.e., regression function) for the shape parameter using columns from ‘x’. ‘x’ must be supplied if this is anything other than ‘None’.
@param nBlocks number of blocks (e.g., a block will often be a year with climate data); note this value determines the interpretation of return values/periods/probabilities; see ‘returnPeriod’ and ‘returnValue’.
@param blockIndex numpy array providing the index of the block corresponding to each element of ‘y’. Used only when ‘x’ is provided to match exceedances to the covariate/predictor/feature value for the exceedance or when using bootstrapping with the resampling based on blocks based on the ‘by’ element of ‘bootControl’. If ‘firstBlock’ is not equal to one, then ‘blockIndex’ need not have one as its smallest possible value.
@param firstBlock single numeric value indicating the numeric value of the first possible block of ‘blockIndex’. For example the values in ‘blockIndex’ might indicate the year of each exceedance with the first year of data being 1969, in which case ‘firstBlock’ would be 1969. Note that the first block may not have any exceedances so it may not be represented in ‘blockIndex’. Used only to adjust ‘blockIndex’ so that the block indices start at one and therefore correspond to the rows of ‘x’.
@param index (optional) numpy array providing the integer-valued index (e.g., julian day for daily climate data) corresponding to each element of ‘y’. For example if there are 10 original observations and the third, fourth, and seventh values are exceedances, then ‘index’ would be the vector 3,4,7. Used only when ‘declustering’ is provided to determine which exceedances occur sequentially or within a contiguous set of values of a given length. The actual values are arbitrary; only the lags between the values are used.
@param nReplicates numeric value indicating the number of replicates.
@param replicateIndex numpy array providing the index of the replicate corresponding to each element of ‘y’. Used for three purposes: (1) when using bootstrapping with the resampling based on replicates based on the ‘by’ element of ‘bootControl’, (2) to avoid treating values in different replicates as potentially being sequential or within a short interval when removing values based on ‘declustering’, and (3) to match outcomes to ‘weights’ or ‘proportionMissing’ when either vary by replicate.  
@param weights a numpy array providing the weights by block. When there is only one replicate or the weights do not vary by replicate, a one-dimensional array of length equal to the number of blocks. When weights vary by replicate, a two-dimensional array with rows corresponding to blocks and columns to replicates. Likelihood contribution of each block is multiplied by the corresponding weight. 
@param proportionMissing a numeric value or numpy array indicating the proportion of missing values in the original dataset before exceedances were selected. When the proportion missing is the same for all blocks and replicates, a single value. When there is only one replicate or the weights do not vary by replicate, a one-dimensional array of length equal to the number of blocks. When weights vary by replicate, a two-dimensional array with rows corresponding to blocks and columns to replicates.
@param returnPeriod numeric value giving the number of blocks for which return values should be calculated. For example a ‘returnPeriod’ equal to 20 will result in calculation of the value of an event that occurs with probability 1/20 in any block and therefore occurs on average every 20 blocks. Often blocks will correspond to years.
@param returnValue numeric value giving the value for which return probabilities/periods should be calculated, where the resulting period will be the average number of blocks until the value is exceeded and the probability the probability of exceeding the value in any single block.
@param getParams boolean indicating whether to return the fitted parameter values and their standard errors; WARNING: parameter values for models with covariates for the scale parameter must interpreted based on the value of ‘logScale’.
@param getFit boolean indicating whether to return the full fitted model (potentially useful for model evaluation and for understanding optimization problems); note that estimated parameters in the fit object for nonstationary models will not generally match the MLE provided when ‘getParams’ is ‘True’ because covariates are normalized before fitting and the fit object is based on the normalized covariates. Similarly, parameters will not match if ‘scaling’ is not 1. 
@param xNew object of the same form as ‘x’, providing covariate/predictor/feature values for which return values/periods/probabilities are desired.
@param xContrast object of the same form and dimensions as ‘xNew’, providing covariate/predictor/feature values for which to calculate the differences of the return values and/or log return probabilities relative to the values in ‘xNew’. This provides a way to estimate differences in return value or log return probabilities (i.e., log risk ratios).
@param declustering one of ‘None’, ‘'noruns'’, or a number. If ‘'noruns'’ is specified, only the maximum (or minimum if ‘upperTail = False’) value within a set of exceedances corresponding to successive indices is included. If a number, this should indicate the size of the interval (which will be used with the ‘index’ argument) within which to allow only the largest (or smallest if ‘upperTail = False’) value.
@param upperTail boolean indicating whether one is working with exceedances over a high threshold (‘True’) or exceedances under a low threshold (‘False’); in the latter case, the function works with the negative of the values and the threshold, changing the sign of the resulting location parameters.
@param scaling positive-valued scalar used to scale the data values for more robust optimization performance. When multiplied by the values, it should produce values with magnitude around 1.
@param bootSE boolean indicating whether to use the bootstrap to estimate standard errors.
@param bootControl a dictionary of control parameters for the bootstrapping. See ‘Details’.
@param optimArgs a dictionary with named components matching exactly any arguments that the user wishes to pass to R's ‘optim’ function. See ‘help(optim)’ in R for details. Of particular note, ‘'method'’ can be used to choose the optimization method used for maximizing the log-likelihood to fit the model (e.g., ‘'method'’ could be 'BFGS' instead of the default 'Nelder-Mead'). To specify the ‘control’ argument, use ‘optimControl’ rather than including ‘control’ here.
@param optimControl a dictionary with named components matching exactly any elements that the user wishes to pass as the ‘control’ argument to R's ‘optim’ function. For example, ‘control={'maxit': VALUE)’ for a user-specified VALUE can be used to increase the number of iterations if the optimization is converging slowly.
@param initial a dictionary with components named ‘'location'’, ‘'scale'’, and ‘'shape'’ providing initial parameter values, intended for use in speeding up or enabling optimization when the default initial values are resulting in failure of the optimization; note that use of ‘scaling’, ‘logScale’ and ‘.normalizeX = True’ cause numerical changes in some of the parameters. For example with ‘logScale = True’, initial value(s) for ‘'scale'’ should be specified on the log scale.
@param logScale boolean indicating whether optimization for the scale parameter should be done on the log scale. By default this is ‘False’ when the scale is not a function of covariates and ‘True’ when the scale is a function of covariates (to ensure the scale is positive regardless of the regression coefficients). 
@param .normalizeX boolean indicating whether to normalize 'x' values for better numerical performance; default is ‘True’.
@param .getInputs boolean indicating whether to return intermediate objects used in fitting. Defaults to ‘False’ and intended for internal use only
