darg(d, X, samp.size = 1000)
garg(g, y)NULL, or a scalar indicating an initial value
or a partial list whose format matches the one described
in the Value section belowNULL, or a scalar indicating an initial value
or a partial list whose format matches the one described
in the Value section belowmatrix or data.frame containing
the full (large) design matrix of input locationsX to use
for calculations; this is important for very large X matrices
since the calculations are quadratic in nrow(X)d or g) specifies one of the values then
that value is copied to the same list entry on output. See the
Details section for how these values are calculatedTRUE for darg and FALSE
for gargdistance(X) or (y - mean(y))^2)X or y,
to form weakly informative default priors, and choose initial values,
for a lengthscale and nugget parameter. This is useful since the
likelihood can sometimes be very flat, and even with proper priors
inference can be very sensitive to the specification of those priors
and any initial search values. darg output specifies MLE inference (out$mle = TRUE)
by default, whereas garg instead fixes the nugget at the starting value;
when out$mle = FALSE the calculated range outputs c(out$min, out$max)
are set to dummy values that are ignored in other parts of the
darg calculates a Gaussian distance matrix between all pairs of
X rows, or a subsample of rows of size samp.size. From
those distances it chooses the range and start values from the range
of (non-zero) distances and the 0.1 quantile, respectively.
The Gamma prior values have a shape of out$a = 3/2 and a rate
out$b chosen by the incomplete Gamma inverse function to put
0.95 probability below out$max.
garg is similar except that it works with (y- mean(y))^2
instead of the pairwise distances of darg. The only difference
is that the starting value is chosen as the 2.5% quantile.
laGP, aGP, laGP,
mleGP, distance, llikGP## motorcycle data
library(MASS)
X <- matrix(mcycle[,1], ncol=1)
Z <- mcycle[,2]
## get darg and garg
darg(NULL, X)
garg(list(mle=TRUE), Z)Run the code above in your browser using DataLab