Predicting and calculating sequential design and optimization statistics at new design points (i.e., active learning heuristics) for dynamic tree models
# S3 method for dynaTree
predict(object, XX, yy = NULL, quants = TRUE,
ei = FALSE, verb = 0, ...)
# S3 method for dynaTree
coef(object, XX, verb = 0, ...)
The object returned is of class "dynaTree"
, which includes a
copy of the list elements from the object
passed in,
with the following (predictive)
additions depending on whether object$model
is for
regression ("constant"
or "linear"
) or classification
("class"
).
For regression:
a vector containing an estimate of the predictive mean
at the XX
locations
a vector containing an estimate of the variance of predictive mean
at the XX
locations
a vector containing an estimate of the predictive
variance (average variance plus variance of mean) at the XX
locations
a vector containing the average degrees of freedom at the XX
locations
a vector containing an estimate of the 5% quantile of
the predictive distribution at the XX
locations,
unless quants = FALSE
a vector containing an estimate of the 95% quantile of
the predictive distribution at the XX
locations, unless
quants = FALSE
if yy != NULL
then this contains the
predictive probability of the true yy
values at the
XX
locations
a vector containing an estimate of the EI statistic,
unless ei = FALSE
;
For classification:
a nrow(XX)
-by-max(object$y)
matrix
of
mean class probabilities for each of max(object$y)
classes
at the predictive data locations
a nrow(XX)
vector of predictive entropys
at the predictive data locations
;
For coef
a new XXc
field is created so as not to trample
on XX
s that may have been used in a previous predict
,
plus
a nrow(XX)
-by-m+icept
matrix of particle- averaged regression coefficients.
a "dynaTree"
-class object built by dynaTree
a design matrix
of predictive locations (where ncol(XX) ==
ncol(X)
)
an optional vector of “true” responses at the XX
predictive locations at which the log posterior probability are
to be reported
a scalar logical
indicating if predictive quantiles
are desired (useful for visualization, but less so for active
learning); calculating predictive quantiles is expensive and should
be turned off if prediction is not being used for visualization,
e.g., if used for active learning
a scalar logical
indicating if the expected improvement
statistic (for optimization) should be calculated and returned
a positive scalar integer indicating how many predictive locations
(iterations) after which a progress statement should be
printed to the console; a (default) value of verb = 0
is quiet
to comply with the generic predict
method --
currently unused
Robert B. Gramacy rbg@vt.edu,
Matt Taddy and Christoforos Anagnostopoulos
predict
returns predictive summary statistics by averaging over the
samples from the posterior predictive distribution obtained
from each of the particles in the cloud pointed to by the
object (object
)
coef returns a matrix of regression coefficients used in linear
model leaves (model = "linear"
) leaves, averaged over all particles,
for each XX
location. For other models it prints a warning and
defaults to predict
.
The value(s) calculated are appended to object
; the new
fields are described below
Note that ALC calculations have been moved to the alc.dynaTree
function(s)
Taddy, M.A., Gramacy, R.B., and Polson, N. (2011). “Dynamic trees for learning and design” Journal of the American Statistical Association, 106(493), pp. 109-123; arXiv:0912.1586
dynaTree
, update.dynaTree
,
plot.dynaTree
, alc.dynaTree
,
entropyX.dynaTree
## see the example(s) section(s) of dynaTree and
## update.dynaTree and the demos (demo(package=dynaTree))
Run the code above in your browser using DataLab