Fits and plots quantile regressions for nonlinear models (D.B. Baird).
|What to print (
||What to plot (
||Variates to fit in the model|
||Data to bootstrap in parallel with
||Whether to include a constant in the model (
||Calculation of explanatory variates involving nonlinear parameters|
||Pointer to scalars representing the nonlinear parameters to be optimized in the expressions|
||Initial values for parameters|
||Lower bound for parameters|
||Upper bound for parameters|
||Step sizes for parameters|
||Pointer to scalars representing the linear parameters in the model (including the constant)|
||Which optimization method to use (
||Number of times to bootstrap data to estimate confidence limits; default 100|
||Seed for bootstrap randomization; default 0|
||Probability level for confidence interval; default 0.95|
||Maximum number of iterations for optimization; default 200|
||Variate to plot fitted values against; default is the first variate on the right-hand side of the
||Proportion at which to calculate the quantile for each response variate; default 0.5|
||Residuals from the nonlinear model|
||Fitted values from the nonlinear model|
||Estimates of the parameters in the model (nonlinear, linear and constant)|
||Standard errors of the parameters|
||Variance-covariance matrix for the parameters|
||Lower confidence limits for the parameters|
||Upper confidence limits for the parameters|
||Lower confidence limits for the fitted values|
||Upper confidence limits for the fitted values|
||Optimal values of the objective function|
||Titles for fitted value graphs|
RQNONLINEAR calculates and plots quantile nonlinear regressions. The dependent variate is specified by the
Y parameter. The proportion (between 0 and 1) for which the model is to be fitted is specified by the
PRQUANTILE parameter, as a scalar is there is only one. The default value is 0.5, i.e. the median.
X option lists the variates that are to be fitted in the model. Some of these will be functions of nonlinear parameters, which must be be supplied (as a set of scalars in a pointer) using the
PARAMETERS option. The
CALCULATION option supplies a list of expression structures to calculate the values of the relevant
X variates (from the parameters and other data structures). By default the model will include the constant, but this can be omitted by setting option
LINEARPARAMETERS option can be set to a pointer containing a set of scalars to represent the linear parameters in the model (i.e. the regression coefficients and the constant, if present). Initial values, lower and upper bounds and step lengths for the parameters are supplied, in variates, by the
STEPLENGTHS options, respectively. The
METHOD option specifies the method to use to estimate the nonlinear parameters. The settings
fletcherpowell use the
FITNONLINEAR directive, with the Gauss-Newton, Newton-Raphson or Fletcher-Powell optimization methods, respectively. These methods require initial values to be supplied. The simplex setting uses the
SIMPLEX procedure, which requires lower and upper bounds to be supplied. The
MAXCYCLE option specifies the maximum number of iterations to be used.
Output is controlled by the
||a description of the model;|
||a summary of the fit;|
||the model estimates (and confidence limits, standard errors and t-values if bootstrapping is used);|
||the residuals and fitted values from the model;|
||correlations between the estimates; and|
||monitoring information for the fit.|
Correlations are available only if bootstrapping is done.
PLOT option controls what plots are displayed, with settings
||histograms of residuals;|
||histograms of the bootstrap estimates for each parameter;|
||observed and fitted values plotted against the explanatory variate specified by the
||includes confidence intervals in the fitted-value plot (available only if bootstrapping is done).|
For the fitted plot, the observed and fitted values can be plotted against a specific variate given by the option
XPLOT, rather than just the default which is the first variate in the right-hand side of the
CALCULATION expressions. The
TITLE parameter can supply a title for the plot.
NBOOT option specifies the number of bootstrap samples that are taken, and the
CIPROBABILITY option sets the size of the confidence limits. The
SEED option defines the seed for the random numbers that are used to select the bootstrap samples. The default of zero continues the existing sequence of random numbers if any have already been used in the current Genstat job. If none have been used, Genstat picks a seed at random.
RQNONLINEAR can automatically select the data vectors to bootstrap along with the
Y variate: they consist of all the variates or factors on the right-hand side of the
CALCULATION expressions that are of the same length as Y, plus any
X variates that are not calculated by the expressiions. If this does not produce the correct set of vectors for bootstrapping, you can specify them automatically using the
The results from the nonlinear fit can be saved by the parameters
The nonlinear parameters are estimated by either
SIMPLEX, operating on a target function in which the objective function from the quantile regression is calculated by the
RQOBJECTIVE function. The
FRQUANTILES directive is then used to obtain the estimates of the linear parameters. For further details of the underlying methodology, see Koenker & D’Orey (1987) or Koenker (2005).
Restrictions on the
Y variate or on
X variates or factors are combined, and only those units which are unrestricted in all structures are used in the regression.
Koenker, R. (2005). Quantile Regression. Cambridge University Press, New York.
Koenker, R.W. & D’Orey, V. (1987). Algorithm AS229 computing regression quantiles. Applied Statistics, 36, 383-393.
Commands for: Regression analysis.
CAPTION 'RQNONLINEAR example'; STYLE=meta VARIATE [VALUES=0,0.2...7.6] X & [VALUES=2.204,2.950,3.982,3.700,4.804,5.241,5.588,\ 5.268,7.171,7.898,7.248,7.815,6.323,6.981,6.415,\ 8.008,6.676,8.954,7.798,9.826,8.570,8.836,9.521,\ 10.297,7.554,8.910,10.156,9.103,10.070,8.652,6.878,\ 9.429,11.325,7.563,10.534,9.804,8.697,6.861,8.749] Y EXPRESSION expx; VALUE=!e(Z=EXP(-C*X)) RQNONLINEAR [PRINT=model,estimates,summary,monitoring;\ PLOT=fitted,confidence; X=Z; CALCULATION=expx;\ PARAMETERS=!p(C); INITIAL=!(0.5); SEED=13; MAXCYCLE=500]\ 3(Y); PRQUANTILE=0.25,0.5,0.75