- object
The return object of fitting functions HLfit,corrHLfit,HLCor... returning an object inheriting from HLfit class.
- newdata
Either NULL, a matrix or data frame, or a numeric vector.
If NULL, the original data are reused. Otherwise, all variables required to evaluate model formulas must be included. Which variables are required may depend on other arguments: see “prediction with given phi's” example, also illustrating the syntax when formulas include an offset.
If newdata is a numeric vector, its names (if any) are ignored. This makes it easier to use predict as an objective function for an
optimization procedure such as optim, which calls the objective function on unnamed vectors. However, one must make sure that the order of elements in the vector is the order of first occurrence of the variables in the model formula. This order can be checked in the error message returned when calling predict on a newX vector of clearly wrong size, e.g. predict(<object>,newdata=numeric(0)).
- newX
equivalent to newdata, available for back-compatibility
- re.form
formula for random effects to include. By default, it is NULL, in which case all random effects are included. If it is NA, no random effect is included. If it is a formula, only the random effects it contains are retained. The other variance components are removed from both point prediction and variances calculations. If you want to retain only the spatial effects in the point prediction, but all variances, either use re.form and add missing variances (on linear predictor scale) manually, or ignore this argument and see Details and Examples for different ways of controlling variances.
- variances
A list whose elements control the computation of different estimated variances.
predict can return four components of prediction variance: fixefVar, predVar, residVar and respVar, whose definitions is detailed in predVar. They are all returned as attributes of the point predictions.
In particular, variances=list(predVar=TRUE) is suitable for uncertainty in point prediction, distinguished from the response variance given by list(respVar=TRUE). See the predVar help page for further explanations and other options.
- intervals
NULL or character string or vector of strings. Provides prediction intervals with nominal level level, deduced from the given prediction variance term, e.g. intervals="predVar". Currently only intervals from fixefVar and predVar (and for LMMs respVar including the residual variance) may have a probabilistic meaning. Intervals returned in other cases are (currently) meaningless.
- which
any of "predVar","respVar","residVar", "fixefVar", "intervals", or "naive".
- level
Coverage of the intervals.
- binding
If binding is a character string, the predicted values are bound with the newdata and the result is returned as a data frame (except for multivariate-response fits: see Details). The predicted values column name is the given binding, or a name based on it if the newdata already include a variable with this name.
If binding is FALSE, The predicted values are returned as a one-column matrix and the data frame used for prediction is returned as an attribute
(unless it was NULL). If binding is NA, a vector is returned, without the previous attributes.
- fixdata
A data frame describing reference data whose covariances with variable newdata may be requested.
- fix_X_ZAC.object
The return value of calling preprocess_fix_corr (see trivial Example). This is a more efficient way of providing information about the fixdata for repeated calls to get_predCov_var_fix with variable newdata.
- blockSize
For data with many rows, it may be more efficient to perform some operations on slices of the data, and this gives the maximum number or rows of each slice. Further, parallelisation of computations over the slices is possible, as controlled by the cluster_args argument. Slicing and parallelisation may operate only if covariance matrices are not requested.
- type
character string; The returned point predictions are on the response scale if type="response" (the default; for binomial response, a frequency 0<.<1). It is on the linear predictor scale if type="link".
* The “prediction variance” (as opposed to the response variance, see predVar) that may be returned as a "predVar" attribute of the point predictions is always on the linear predictor scale, even when type="response". If you want to extract this predVar transformed to the response scale, use predict(.,variances=list(respVar=TRUE)) and take the difference between the respVar and residVar attributes of the result.
* Prediction intervals (as opposed to the response intervals) will be on the linear predictor or response scale depending on type (new to versions more recent than 3.12.0).
- control
A list; a warning will direct you to relevant usage when needed.
- cluster_args
Passed to makeCluster. Parallel computations are possible if the slicing mechanism (as controlled by argument blockSize) is effective.
- verbose
a list or a vector; The NULL default is interpreted as
c(showpbar=eval(spaMM.getOption("barstyle")), na=TRUE, na_once=FALSE).
showpbar controls whether to show a progress bar (and its style) in certain prediction variance computations; na controls whether to output a message when values required for some predictions are missing from the data; and setting na_once=TRUE is useful to prevent repetitive messages when predict is called repeatedly by an higher-level function (e.g., pdep_effects sets na_once=TRUE internally).
- na.action
Possible values of this argument are some of the functions dealing with NAs in data frames (see na.omit). if it is set to na.exclude, NAs will be included in the returned point predictions, for rows of the newdata which do not provide information for all required predictor variables. The effect of the default na.omit is to not include such NAs (this differs from the default of, e.g., predict.lm). Implementation is limited; in particular, na.exclude currently does not have the effect of including NAs in the optional attributes providing (co-)variance information, except the "mv" attribute for predictions of multivariate-response fits.
- ...
further arguments passed to or from other methods. For the get_... functions, they are passed to predict.