Set or return options of sm library
Description
This function provides a means to control the behaviour of the sm
library such as the colour of the plotted lines, the size of the grid in 2d estimation, the set of evaluations points, and many others. A list may be given as the only argument, or any number of arguments may be in the name=value
form. If no arguments are specified then the function returns the current settings of all the arguments.
Usage
1 
Arguments
... 
A list may be given as the only argument, or any number of arguments may be in the 
 add

a logical value which controls whether the estimate is added to the current plot. Its default value is
FALSE
, which creates a new plot. This argument applies only with onedimensional data or to contour andrgl
created from twodimensional data.  alpha

an parameter, lying between 0 and 1, which controls the transparency of the surface used to construct an
rgl
plot for regression with two covariates. The default value is0.7
.  alpha.mesh

an parameter, lying between 0 and 1, which controls the transparency of the mesh lines used to construct an
rgl
plot for regression with two covariates. The default value is1
.  band

a logical value which controls whether the distance between the nonparametric estimate and a reference model should be indicated as a band (one covariate), or through colour painting of the regression surface (two covariates). This is activated only when a model has been nominated through the
model
parameter. In the case of two covariates, the setting of the argumentcol
has priority overband
. The settingse = TRUE
can also activate this feature.  col

the colour used for plotting observed points and estimated curves. Where groups are used, with one covariate,
col
may be set to a vector of colours associated with the groups. In regression with two covariates using anrgl
display,col
may be set to a single colour, or to the values"height"
or"se"
. These letter two setting cause the surface to be painted according to its height or to standard error information; see the information on the parametersse
,se.breaks
andmodel
. Default:col=1
.  col.band

the colour used for the reference band when a
model
is specified in regression with one covariate. Default:col.band="cyan"
.  col.mesh

the colour used for the ‘wire mesh’ representation plotting observed points in an rgl display for regression with two covariates. This can also be set by the second component of a vector of length two which is set for
col
. Default:col.mesh="black"
.  col.palette

the colours used for shading an image plot, or for surface painting in an rgl display, for regression with two covariates. Default:
col.palette=topo.colors(12)
.  col.points

the colour used for plotting observed points in a regression with one covariate or an
rgl
display for regression with two covariates. Default:col.points="black"
.  delta
in
sm.density
, a value which will be added to the data before they are log transformed in the procedure to handle positive data. The value ofdelta
is used only whenpositive
takes the valueTRUE
. The default value is the smallest value observed in each dimension. This argument does not apply with threedimensional data. Default:delta=NA
 describe

logical flag whiich affects the behaviour of
sm.script
andprovide.data
. Ifdescribe=TRUE
(default), a data documentation file is printed.  df
approximate degreesoffreedom of the smoothing parameter used in
sm.regression
, when a numerical value ofh
is not specified. In this case, the equivalent value ofh
will be computed and included in the list returned on exit fromsm.regression
. Default value is 6 ifx
is a vector and 12 ifx
is a matrix. diff.ord
in
sm.regression
, an integer defining the degree of differencing to be applied in the estimation process. When this argument is set to 1, the method of Rice, based on the squared differences of pairs of neighbouring observations, is used. When the argument is set to 2 (deafult), the method of Gasser, Sroka and JennenSteinmetz, based on differences between each observation and a linear interplotation from its two neighbours, is used. display

This argument applies only with one or twodimensional data. The setting
"none"
will prevent any graphical output from being produced. In one dimensions, the default setting"line"
will produce the estimate. (For compatibility with earlier versions of the package, the setting"se"
will produce a variability band to show the variability, but not the bias, of the estimate. This should now be controlled by setting the separate parameterse
toTRUE
.) In two dimensions, the default setting"persp"
will produce a perspective plot of the estimate, while the settings"slice"
,"image"
and"rgl"
will produce slice (contour), image orrgl
plots.  eval.grid

logical flag which controls how the options
eval.points
are used fow twodimensional data. Ifeval.grid=TRUE
(default), evaluation is perfomed at points obtained by the crossproduct of the two columns ofeval.points
. Ifeval.grid=FALSE
then evaluation is performed at points with coordinates specified by the coordinates ineval.points
 eval.points

the points at which the density or the regression curve or surface estimate should be evaluated, for the values returned in the result of the function. This should be a vector for onedimensional data and a twocolumn matrix for twodimensional data. This argument does not apply with threedimensional data.
 h.weights

a vector of weights which multiply the smoothing parameter used in the kernel function at each observation. This argument does not apply with threedimensional data. Default value: 1.
 hmult

a factor which can be used to multiply the normal smoothing parameter before construction of the density estimate. Default value: 1.
 hull

a logical value which controls whether the estimate is evaluated and plotted only on grid points which fall within the convex hull of the data. When this argument is set to
FALSE
, evaluation and plotting take place at all grid points where the contribution from at least one kernel function is nonnegligible. Both of these settings ensure that the estimate is not evaluated at points where there are no observations nearby. This argument applies only tosm.regression
andsm.discontinuity
in the case of two covariates.  lty

the line type used to plot the estimate. This argument applies only when the estimate is displayed as a curve or a countour. Default value: 1.
 method

the method used to select smoothing parameters. In density estimation the default is
"normal"
which uses a value which is asymptotically optimal for the normal distribution. Other possibilities are"cv"
for crossvalidation and"sj"
for the SheatherJones method. In nonparametric regression, the deault is"df"
which selects a smoothing parameters associated with the approximate degrees of freedom given in thedf
option. Other possibilities are"cv"
for crossvalidation and"aicc"
for an AICbased method proposed by Hurvich, Simonoff and Tsai.  nbins

the number of bins used in onedimensional binning operations; in twodimensional cases,
nbins
refers to the number of bins formed along each axis. Bins with 0 observed frequencies are ignored. Ifnbins=0
, binning is not performed; ifnbins=NA
(default), binning is switched on when the number of observations exceeds a certain threshold, which depends on the function.  nboot

number of samples generated in bootstraps. Default value: 100.
 ngrid

the number of points in the regular grid used to plot the estimate. For two and threedimensional data,
ngrid
refers to the number of points along the axis in each dimension. The same parameter is also used by a few other functions which perform some form of search (e.g.hcv
). Default value forsm.regression
: 50 and 20 for 1, 2dimensional data, respectively. Default value forsm.density
: 100, 50 and 20 for 1, 2 and 3dimensional data, respectively.  panel

a logical value which, when set to true, creates a panel which allows interactive control of
sm.regression
orsm.density
plots for one or twodimensional data. The panel can be used to alter the value of the smoothing parameter and control a variety of other settings.  panel.plot

a logical value which, when set to true (the default), places the plot inside the control panel (see the
panel
argument above), This creates a neater screen arrangement.  pch

the standard plotting charater identified for data plotting. Default value: 1.
 period

a vector of length one or two identifying the period for covariates which are on a periodic scale. Periodic smoothing is implemented by local mean estimation, using a von Mises kernel function. Nonperiodic covariates are identified by NA. Default value: NA.
 phi

the vertical rotation (in degrees) of perspective plots of estimate in the form of surfaces. Default value: 40.
 poly.index

an integer defining local constant (0) or local linear (1) smoothing. Default value: 1.
 positive

a logical value which indicates whether the data should be assumed to take positive values only, in
sm.density
. When this argument is set toTRUE
, a log transformation is applied to the data before construction of a density estimate. The result is transformed back to the original scale. This argument does not apply with threedimensional data. Default value:FALSE
.  props

a vector defining the proportions of the data to be included within each contour in a slice plot, from twodimensional data, or a contour surface plot, from threedimensional data. In the threedimensional case only the first element of the vector will be used. This argument does not apply to onedimensional data. Default value:
c(75,50,25)
.  rugplot

logical flag which regulates whether a rugplot is superimposed to the density estimate, in the univariate case. Default value:
TRUE
.  se

logical flag which regulates whether a standard error information is added to the plot produced by
sm.regression
. If amodel
is specified, then these standard errors refer to the difference between this fitted model and the nonparametric regression estimate. Default value:TRUE
.  se.breaks

a numerical vector which defines the cutpoints, on a standard error scale, for the assignment of colours when painting a regression surface with standard error information. Default value:
c(3, 2, 3, 3)
.  show.script

logical flag which affects the behaviour of
sm.script
when this is called with nonempty argument. Ifshow.script=TRUE
(default) a window is opened to display the source code of the script.  size

an integer which defines the size of plotted points in
rgl
displays. The default value is2
.  structure.2d

the structure of the smoothing parameter in twodimensional settings. The default is
"scaled"
, which uses the structure (h*sd(x[,1]), h*sd(x[,2])). Other possibilities are"separate"
, which uses (h1, h2), and"common"
which uses (h, h). The"common"
option may be particularly appropriate when the data have a spatial origin, where distances in each variable havae the same meaning. Note that the"separate"
option is not available when"method"
is set to"df"
.  test

a logical flag controlling the production of a formal test, using the reference model as the null hypothesis. Default value:
TRUE
.  theta

the horizontal rotation (in degrees) of perspective plots of estimates in the form of surfaces. Default value: 30.
 verbose

regulates the amount of messages and other output printed out. If
verbose=0
only errors produce messages; ifverbose=1
(default value) warnings and the more relevant numerical output are printed ; ifverbose=2
more messages and more numerical output are printed.  xlab

the label attached to the xaxis.
 xlim

the range of the horizontal axis of the plot. This argument does not apply with threedimensional data.
 yht

the upper limit of the vertical axis in a plot of a onedimensional density estimate. The lower limit is always set to 0. This argument does not apply with two or threedimensional data.
 ylab

the label attached to the yaxis.
 ylim

the range of the vertical axis of the plot. This argument does not apply with threedimensional data.
 zlab

the label attached to the zaxis (threedimensional plots only).
 zlim

the range of the vertical axis when estimates are displayed as perspective plots.
Details
Arguments which are set by a function call will remain in effect until the end of the current Splus session, unless overwritten by a subsequent call. In addition, they can be added as optional parameters of calls to specific functions of the sm
package; in this case, their effect is
limited to that function call.
See the documentation of specific functions for the list of options which are recognised by that function. Notice that some options are relevant only to some functions.
Value
a list with the updated values of the parameters. If the argument list is not empty, the returned list is invisible.
Examples
1 2 3 4 5 6 7 8 9 10  ## Not run: sm.options(poly.index = 0)
# subsequent regression estimations will be performed using local means
# instead of local regression
#
sm.options(describe = FALSE)
# turns off typing documentation files of data loaded by `sm.script'
# (works from commandline)
#
## End(Not run)
