fit.ssm fits a smooth supersaturated model to given data. By default
the model smooths over [-1, 1]^d and uses a basis of Legendre
polynomials. Many model parameters such as basis size and smoothing
criterion can be user-defined. Optionally, sensitivity indices and a
metamodel error estimating Gaussian process can be computed.
1 2 3
A matrix containing the design. Each design point is a row in
the matrix. Accepts a vector for a design in one variable. If the default
A vector containing the responses at design points. The
length must correspond with the number of rows in
(optional) A pre-existing SSM class object. If this argument is
(optional) A matrix where each row is an exponent vector of a
monomial. This is used in conjunction with
(optional) A number. Specifies the desired number of
polynomials in the model basis. If not supplied,
(optional) A semi-positive definite matrix specifying the weighting criterion of basis terms. If not supplied, default behaviour is to use the Frobenius norm of the term Hessian integrated over [-1, 1]^d with respect to a basis of Legendre polynomials.
(optional) A matrix defining the polynomials used to construct the model basis. Each column corresponds to one polynomial. If not supplied, a Legendre polynomial basis is used.
(optional) Specify a design model matrix. If
provided the new model will be fit to the basis and design implied by the
design model matrix regardless of the values of
(optional) Logical. If TRUE then Sobol indices, Total indices and Total interaction indices will be computed.
(optional) Logical. If TRUE then a GP metamodel error estimate will be computed.
(optional) Character. One of "exp" or "matern32". Specifies the
correlation function used to compute the GP covariance matrix. Irrelevant
(optional) Logical. If TRUE then the Leave-One-Out errors
are computed for each design point and the standardised root mean square
error calculated. The rmse is standardised against the variance of the
ybar estimator. If
(optional) A list of vectors of integers. These indicate terms
in the listed variables should be omitted from the model. e.g.
(optional) Character. Selects the distance function used
for the GP metamodel error estimate correlation function. One of
"distance", "line", "product", "area", "proddiff", or "smoothdiff". Uses
"distance", the standard Euclidean distance between points by default. For
further details see
Returns an SSM object containing the fitted smooth
supersaturated model. Minimal arguments required are
response. This will result in a model using Legendre polynomials
and smoothing over [-1, 1]^d. All other arguments will be assigned
automatically if not specified.
If the model is unable to be fit due to numerical instability a warning will
be given and the returned SSM object will have a zero vector of appropriate
length in the
theta slot. The
basis_size parameter is often
useful in this situation. Try reducing the basis_size until a model fit is
successful. Ideally the basis size should be as large as possible without
causing instability in the predictions (see the example below).
SA is TRUE then sensitivty analysis will be performed on the model.
Sobol indices for main effects, Total indices, and Total interaction indices
for second order interactions will be computed and held in the slots
total_int respectively. If
the number of factors is < 11 then Sobol indices will be computed for all
order interactions and stored in
int_sobol. Default behaviour is to
assume each input is uniformly distributed over [-1, 1]. If
has been used-defined then the polynomials defined by
P are assumed to
be an orthonormal system with respect to some measure on the reals. See
update.sensitivity for more details.
GP is TRUE (default behaviour is false due to computational cost)
then a the metamodel error is estimated using a zero-mean Gaussian process
with a constant trend. Scaling and length parameters are estimated using
maximum likelihood methods using the Leave-One-Out model errors and stored
r slots respectively. Model predictions
predict.SSM will then include credible intervals. The
distance between points is defined by the
distance_type argument and
is set to the standard Euclidean distance by default. See
new.distance for other options although they are experimental
and subject to erratic behaviour. The default correlation function used is
the square exponential although this can be changed to a Matern 3/2
function by setting the
type argument to
validation is TRUE then the Leave-One_Out error at each design
point will be computed and stored in the
residuals slot, and the LOO
RMSE computed and stored in the
LOO_RMSE slot. Note that if
GP is TRUE then these values will be computed regardless of the
validation as they are required to fit the metamodel error
An SSM object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
# A simple one factor example X <- seq(-1,1,0.5) # design Y <- c(0,1,0,0.5,0) # response s <- fit.ssm(X,Y) s plot(s) predict(s,0.3) # used defined basis sizes # A model that is too large to fit ## Not run: s <- fit.ssm(X, Y, basis_size=80) ## End(Not run) # A large model that can be fit but is unstable s <- fit.ssm(X, Y, basis_size=70) plot(s) # A model larger than default that is not unstable s <- fit.ssm(X, Y, basis_size=40) plot(s) # with metamodel error estimate s <- fit.ssm(X, Y, GP=TRUE) plot(s) predict(s,0.3) # Sensitivity analysis and main effect plotting # A design of 20 points over [-1, 1]^d X <- matrix(runif(20, -1, 1), ncol = 2) Y <- runif(10) s <- fit.ssm(X, Y, SA = TRUE) s sensitivity.plot(s) plot(s)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.