rebuild | R Documentation |
Functions to make hetGP
objects lighter before exporting them, and to reverse this after import.
The rebuild
function may also be used to obtain more robust inverse of covariance matrices using ginv
.
rebuild(object, robust)
## S3 method for class 'homGP'
rebuild(object, robust = FALSE)
strip(object)
## S3 method for class 'hetGP'
rebuild(object, robust = FALSE)
## S3 method for class 'homTP'
rebuild(object, robust = FALSE)
## S3 method for class 'hetTP'
rebuild(object, robust = FALSE)
object |
|
robust |
if |
object
with additional or removed slots.
set.seed(32)
## motorcycle data
library(MASS)
X <- matrix(mcycle$times, ncol = 1)
Z <- mcycle$accel
## Model fitting
model <- mleHetGP(X = X, Z = Z, lower = 0.1, upper = 50)
# Check size
object.size(model)
# Remove internal elements, e.g., to save it
model <- strip(model)
# Check new size
object.size(model)
# Now rebuild model, and use ginv instead
model <- rebuild(model, robust = TRUE)
object.size(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.