# dopt.gp

##### Sequential D-Optimal Design for a Stationary Gaussian Process

Create sequential D-Optimal design for a stationary Gaussian process model of fixed parameterization by subsampling from a list of candidates

##### Usage

`dopt.gp(nn, X=NULL, Xcand, iter=5000, verb=0)`

##### Arguments

- nn
Number of new points in the design. Must be less than or equal to the number of candidates contained in

`Xcand`

, i.e.,`nn <= nrow(Xcand)`

- X
`data.frame`

,`matrix`

or vector of input locations which are forced into (already in) the design- Xcand
`data.frame`

,`matrix`

or vector of candidates from which new design points are subsampled. Must have the same dimension as`X`

, i.e.,`ncol(X) == ncol(Xcand)`

- iter
number of iterations of stochastic accent algorithm, default

`5000`

- verb
positive integer indicating after how many rounds of stochastic approximation to print each progress statement; default

`verb=0`

results in no printing

##### Details

Design is based on a stationary Gaussian process model with stationary isotropic
exponential correlation function with parameterization fixed as a function
of the dimension of the inputs. The algorithm implemented is a simple stochastic
ascent which maximizes `det(K)`

-- the covariance matrix constructed
with locations `X`

and a subset of `Xcand`

of size `nn`

.
The selected design is *locally* optimal

##### Value

The output is a list which contains the inputs to, and outputs of, the C code
used to find the optimal design. The chosen design locations can be
accessed as list members `XX`

or equivalently `Xcand[fi,]`

.

Input argument: `data.frame`

of inputs `X`

, can be `NULL`

Input argument: number new points in the design

Input argument: `data.frame`

of candidate locations `Xcand`

Number of rows in `Xcand`

, i.e., `nncand = dim(Xcand)[1]`

Vector of length `nn`

describing the selected new design locations
as indices into `Xcand`

`data.frame`

of selected new design locations, i.e.,
`XX = Xcand[fi,]`

##### Note

Inputs `X, Xcand`

containing `NaN, NA, Inf`

are discarded with non-fatal
warnings. If `nn > dim(Xcand)[1]`

then a non-fatal warning is displayed
and execution commences with `nn = dim(Xcand)[1]`

In the current version there is no progress indicator. You will have to be patient. Creating D-optimal designs is no speedy task

##### References

Gramacy, R. B. (2020) *Surrogates: Gaussian Process Modeling,
Design and Optimization for the Applied Sciences*. Boca Raton,
Florida: Chapman Hall/CRC. (See Chapter 6.)
https://bobby.gramacy.com/surrogates/

Chaloner, K. and Verdinelli, I. (1995).
*Bayesian experimental design: A review.*
Statist. Sci., 10, (pp. 273--304).

##### See Also

##### Examples

```
# NOT RUN {
#
# 2-d Exponential data
# (This example is based on random data.
# It might be fun to run it a few times)
#
# get the data
exp2d.data <- exp2d.rand()
X <- exp2d.data$X; Z <- exp2d.data$Z
Xcand <- exp2d.data$XX
# find a treed sequential D-Optimal design
# with 10 more points
dgp <- dopt.gp(10, X, Xcand)
# plot the d-optimally chosen locations
# Contrast with locations chosen via
# the tgp.design function
plot(X, pch=19, xlim=c(-2,6), ylim=c(-2,6))
points(dgp$XX)
# }
```

*Documentation reproduced from package tgp, version 2.4-17, License: LGPL*