| GauPro_base | R Documentation |
Class providing object with methods for fitting a GP model
Class providing object with methods for fitting a GP model
R6Class object.
Object of R6Class with methods for fitting GP model.
new(X, Z, corr="Gauss", verbose=0, separable=T, useC=F,useGrad=T,
parallel=T, nug.est=T, ...)This method is used to create object of this class with X and Z as the data.
update(Xnew=NULL, Znew=NULL, Xall=NULL, Zall=NULL,
restarts = 5,
param_update = T, nug.update = self$nug.est)This method updates the model, adding new data if given, then running optimization again.
XDesign matrix
ZResponses
NNumber of data points
DDimension of data
nug.minMinimum value of nugget
nugValue of the nugget, is estimated unless told otherwise
verbose0 means nothing printed, 1 prints some, 2 prints most.
useGradShould grad be used?
useCShould C code be used?
parallelShould the code be run in parallel?
parallel_coresHow many cores are there? It will self detect, do not set yourself.
nug.estShould the nugget be estimated?
param.estShould the parameters be estimated?
mu_hatMean estimate
s2_hatVariance estimate
KCovariance matrix
KcholCholesky factorization of K
KinvInverse of K
corr_func()Correlation function
GauPro_base$corr_func(...)
...Does nothing
new()Create GauPro object
GauPro_base$new( X, Z, verbose = 0, useC = F, useGrad = T, parallel = FALSE, nug = 1e-06, nug.min = 1e-08, nug.est = T, param.est = TRUE, ... )
XMatrix whose rows are the input points
ZOutput points corresponding to X
verboseAmount of stuff to print. 0 is little, 2 is a lot.
useCShould C code be used when possible? Should be faster.
useGradShould the gradient be used?
parallelShould code be run in parallel? Make optimization faster but uses more computer resources.
nugValue for the nugget. The starting value if estimating it.
nug.minMinimum allowable value for the nugget.
nug.estShould the nugget be estimated?
param.estShould the kernel parameters be estimated?
...Not used
initialize_GauPr()Not used
GauPro_base$initialize_GauPr()
fit()Fit the model, never use this function
GauPro_base$fit(X, Z)
XNot used
ZNot used
update_K_and_estimates()Update Covariance matrix and estimated parameters
GauPro_base$update_K_and_estimates()
predict()Predict mean and se for given matrix
GauPro_base$predict(XX, se.fit = F, covmat = F, split_speed = T)
XXPoints to predict at
se.fitShould the se be returned?
covmatShould the covariance matrix be returned?
split_speedShould the predictions be split up for speed
pred()Predict mean and se for given matrix
GauPro_base$pred(XX, se.fit = F, covmat = F, split_speed = T)
XXPoints to predict at
se.fitShould the se be returned?
covmatShould the covariance matrix be returned?
split_speedShould the predictions be split up for speed
pred_one_matrix()Predict mean and se for given matrix
GauPro_base$pred_one_matrix(XX, se.fit = F, covmat = F)
XXPoints to predict at
se.fitShould the se be returned?
covmatShould the covariance matrix be returned?
pred_mean()Predict mean
GauPro_base$pred_mean(XX, kx.xx)
XXPoints to predict at
kx.xxCovariance matrix between X and XX
pred_meanC()Predict mean using C code
GauPro_base$pred_meanC(XX, kx.xx)
XXPoints to predict at
kx.xxCovariance matrix between X and XX
pred_var()Predict variance
GauPro_base$pred_var(XX, kxx, kx.xx, covmat = F)
XXPoints to predict at
kxxCovariance matrix of XX with itself
kx.xxCovariance matrix between X and XX
covmatNot used
pred_LOO()Predict at X using leave-one-out. Can use for diagnostics.
GauPro_base$pred_LOO(se.fit = FALSE)
se.fitShould the standard error and t values be returned?
plot()Plot the object
GauPro_base$plot(...)
...Parameters passed to cool1Dplot(), plot2D(), or plotmarginal()
cool1Dplot()Make cool 1D plot
GauPro_base$cool1Dplot( n2 = 20, nn = 201, col2 = "gray", xlab = "x", ylab = "y", xmin = NULL, xmax = NULL, ymin = NULL, ymax = NULL )
n2Number of things to plot
nnNumber of things to plot
col2color
xlabx label
ylaby label
xminxmin
xmaxxmax
yminymin
ymaxymax
plot1D()Make 1D plot
GauPro_base$plot1D( n2 = 20, nn = 201, col2 = 2, xlab = "x", ylab = "y", xmin = NULL, xmax = NULL, ymin = NULL, ymax = NULL )
n2Number of things to plot
nnNumber of things to plot
col2Color of the prediction interval
xlabx label
ylaby label
xminxmin
xmaxxmax
yminymin
ymaxymax
plot2D()Make 2D plot
GauPro_base$plot2D()
loglikelihood()Calculate the log likelihood, don't use this
GauPro_base$loglikelihood(mu = self$mu_hat, s2 = self$s2_hat)
muMean vector
s2s2 param
optim()Optimize parameters
GauPro_base$optim( restarts = 5, param_update = T, nug.update = self$nug.est, parallel = self$parallel, parallel_cores = self$parallel_cores )
restartsNumber of restarts to do
param_updateShould parameters be updated?
nug.updateShould nugget be updated?
parallelShould restarts be done in parallel?
parallel_coresIf running parallel, how many cores should be used?
optimRestart()Run a single optimization restart.
GauPro_base$optimRestart( start.par, start.par0, param_update, nug.update, optim.func, optim.grad, optim.fngr, lower, upper, jit = T )
start.parStarting parameters
start.par0Starting parameters
param_updateShould parameters be updated?
nug.updateShould nugget be updated?
optim.funcFunction to optimize.
optim.gradGradient of function to optimize.
optim.fngrFunction that returns the function value and its gradient.
lowerLower bounds for optimization
upperUpper bounds for optimization
jitIs jitter being used?
update()Update the model, can be data and parameters
GauPro_base$update( Xnew = NULL, Znew = NULL, Xall = NULL, Zall = NULL, restarts = 5, param_update = self$param.est, nug.update = self$nug.est, no_update = FALSE )
XnewNew X matrix
ZnewNew Z values
XallMatrix with all X values
ZallAll Z values
restartsNumber of optimization restarts
param_updateShould the parameters be updated?
nug.updateShould the nugget be updated?
no_updateShould none of the parameters/nugget be updated?
update_data()Update the data
GauPro_base$update_data(Xnew = NULL, Znew = NULL, Xall = NULL, Zall = NULL)
XnewNew X matrix
ZnewNew Z values
XallMatrix with all X values
ZallAll Z values
update_corrparams()Update the correlation parameters
GauPro_base$update_corrparams(...)
...Args passed to update
update_nugget()Update the nugget
GauPro_base$update_nugget(...)
...Args passed to update
deviance_searchnug()Optimize deviance for nugget
GauPro_base$deviance_searchnug()
nugget_update()Update the nugget
GauPro_base$nugget_update()
grad_norm()Calculate the norm of the gradient at XX
GauPro_base$grad_norm(XX)
XXPoints to calculate at
sample()Sample at XX
GauPro_base$sample(XX, n = 1)
XXInput points to sample at
nNumber of samples
print()Print object
GauPro_base$print()
clone()The objects of this class are cloneable with this method.
GauPro_base$clone(deep = FALSE)
deepWhether to make a deep clone.
#n <- 12
#x <- matrix(seq(0,1,length.out = n), ncol=1)
#y <- sin(2*pi*x) + rnorm(n,0,1e-1)
#gp <- GauPro(X=x, Z=y, parallel=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.