Skip to contents

These functions provide the path of steepest ascent (or descent) for a fitted response surface produced by rsm.

Usage

steepest (object, dist = seq(0, 5, by = .5), descent = FALSE)
canonical.path(object, which = ifelse(descent, length(object$b), 1),
               dist = seq(-5, 5, by = 0.5), descent = FALSE, ...)

Arguments

object

rsm object to be analyzed.

dist

Vector of desired distances along the path of steepest ascent or descent. In steepest, these must all be non-negative; in canonical.path, you may want both positive and negative values, which specify opposite directions from the stationary point.

descent

Set this to TRUE to obtain the path of steepest descent, or FALSE to obtain the path of steepest ascent. This value is ignored in canonical.path if which is specified.

which

Which canonical direction (eigenvector) to use.

...

Optional arguments passed to canonical. Currently this includes only threshold.

Details

steepest returns the linear path of steepest ascent for first-order models, or a path obtained by ridge analysis (see Draper 1963) for second-order models. In either case, the path begins at the origin.

canonical.path applies only to second-order models (at least a TWI term present). It determines a linear path along one of the canonical variables, originating at the stationary point (not the origin). We need to specify which canonical variable to use. The eigenvalues obtained in the canaonical analysis are always in decreasing order, so the first canonical direction will be the path of steepest ascent (or slowest descent, if all eigenvalues are negative) from the stationary point, and the last one will be the path of steepest descent (or slowest ascent, if all eigenvalues are positive). These are the defaults for which when descent=FALSE and descent=TRUE respectively.

All eigenvalues less (in absolute value than) threshold are taken to be zero. Increasing this threshold may bring the stationary point, and hence the canonical path, much closer to the design center, and thus less extrapolation.

With either function, the path in uncoded units depends on how the data are coded. Accordingly, it is important to code the predictor variables appropriately before fitting the response-surface model. See coded.data and its relatives for more information.

Value

A data.frame of points along the path of steepest ascent (or descent). For steepest, this path originates from the center of the experiment; for canonical.path, it starts at the stationary point. If coding information is available, the data frame also includes the uncoded values of the variables.

For first-order response surfaces, only steepest may be used; the path is linear in that case. For second-order surfaces, steepest uses ridge analysis, and the path may be curved.

References

Draper, NR (1963), ``Ridge analysis of response surfaces'', Technometrics, 5, 469--479.

Lenth RV (2009). ``Response-Surface Methods in R, Using rsm'', Journal of Statistical Software, 32(7), 1--17. doi:10.18637/jss.v032.i07

Author

Russell V. Lenth

Note

Take careful note of the fitted values along the outputted path (labeled yhat). For example, if the stationary point is a maximum (all eigenvalues negative), the fitted values from steepest will increase as far as the stationary point, then they will decrease as we proceed along what is now the path of slowest descent.

See also

Examples

library(rsm)
heli.rsm = rsm (ave ~ block + SO(x1, x2, x3, x4), data = heli) 

steepest(heli.rsm)
#> Path of steepest ascent from ridge analysis:
#>    dist     x1    x2    x3     x4 |       A       R       W      L |    yhat
#> 1   0.0  0.000 0.000 0.000  0.000 | 12.4000 2.52000 1.25000 2.0000 | 372.800
#> 2   0.5 -0.127 0.288 0.116 -0.371 | 12.3238 2.59488 1.27900 1.8145 | 377.106
#> 3   1.0 -0.351 0.538 0.312 -0.700 | 12.1894 2.65988 1.32800 1.6500 | 382.675
#> 4   1.5 -0.595 0.775 0.526 -1.009 | 12.0430 2.72150 1.38150 1.4955 | 389.783
#> 5   2.0 -0.846 1.007 0.745 -1.309 | 11.8924 2.78182 1.43625 1.3455 | 398.485
#> 6   2.5 -1.101 1.237 0.966 -1.605 | 11.7394 2.84162 1.49150 1.1975 | 408.819
#> 7   3.0 -1.356 1.465 1.189 -1.897 | 11.5864 2.90090 1.54725 1.0515 | 420.740
#> 8   3.5 -1.613 1.693 1.413 -2.188 | 11.4322 2.96018 1.60325 0.9060 | 434.322
#> 9   4.0 -1.870 1.920 1.637 -2.477 | 11.2780 3.01920 1.65925 0.7615 | 449.497
#> 10  4.5 -2.127 2.147 1.862 -2.766 | 11.1238 3.07822 1.71550 0.6170 | 466.323
#> 11  5.0 -2.385 2.373 2.086 -3.054 | 10.9690 3.13698 1.77150 0.4730 | 484.750

canonical.path(heli.rsm)
#>    dist     x1     x2     x3     x4 |       A       R       W      L |    yhat
#> 1  -5.0 -1.728  1.921  1.419 -2.967 | 11.3632 3.01946 1.60475 0.5165 | 453.627
#> 2  -4.5 -1.469  1.696  1.193 -2.682 | 11.5186 2.96096 1.54825 0.6590 | 438.150
#> 3  -4.0 -1.210  1.471  0.967 -2.397 | 11.6740 2.90246 1.49175 0.8015 | 424.302
#> 4  -3.5 -0.951  1.246  0.742 -2.112 | 11.8294 2.84396 1.43550 0.9440 | 412.094
#> 5  -3.0 -0.692  1.021  0.516 -1.827 | 11.9848 2.78546 1.37900 1.0865 | 401.504
#> 6  -2.5 -0.434  0.795  0.290 -1.541 | 12.1396 2.72670 1.32250 1.2295 | 392.534
#> 7  -2.0 -0.175  0.570  0.064 -1.256 | 12.2950 2.66820 1.26600 1.3720 | 385.203
#> 8  -1.5  0.084  0.345 -0.162 -0.971 | 12.4504 2.60970 1.20950 1.5145 | 379.502
#> 9  -1.0  0.343  0.120 -0.388 -0.686 | 12.6058 2.55120 1.15300 1.6570 | 375.429
#> 10 -0.5  0.602 -0.105 -0.614 -0.401 | 12.7612 2.49270 1.09650 1.7995 | 372.986
#> 11  0.0  0.861 -0.331 -0.839 -0.116 | 12.9166 2.43394 1.04025 1.9420 | 372.172
#> 12  0.5  1.120 -0.556 -1.065  0.169 | 13.0720 2.37544 0.98375 2.0845 | 372.987
#> 13  1.0  1.378 -0.781 -1.291  0.454 | 13.2268 2.31694 0.92725 2.2270 | 375.428
#> 14  1.5  1.637 -1.006 -1.517  0.739 | 13.3822 2.25844 0.87075 2.3695 | 379.499
#> 15  2.0  1.896 -1.232 -1.743  1.024 | 13.5376 2.19968 0.81425 2.5120 | 385.206
#> 16  2.5  2.155 -1.457 -1.969  1.309 | 13.6930 2.14118 0.75775 2.6545 | 392.538
#> 17  3.0  2.414 -1.682 -2.195  1.594 | 13.8484 2.08268 0.70125 2.7970 | 401.498
#> 18  3.5  2.673 -1.907 -2.421  1.879 | 14.0038 2.02418 0.64475 2.9395 | 412.088
#> 19  4.0  2.932 -2.132 -2.646  2.164 | 14.1592 1.96568 0.58850 3.0820 | 424.295
#> 20  4.5  3.190 -2.358 -2.872  2.449 | 14.3140 1.90692 0.53200 3.2245 | 438.140
#> 21  5.0  3.449 -2.583 -3.098  2.734 | 14.4694 1.84842 0.47550 3.3670 | 453.615