# object: Optimization of posterior likelihood of hyperparameters In approximator: Bayesian Prediction of Complex Computer Codes

 object R Documentation

## Optimization of posterior likelihood of hyperparameters

### Description

Returns the likelihood of a set of hyperparameters given the data. Functions `opt1()` and `opt.gt.1()` find hyperparameters that maximize the relevant likelihood for level 1 and higher levels respectively. Function `object()` returns the expression given by equation 9 in KOH2000, which is minimized `opt1()` and `opt.gt.1()`.

### Usage

``````object(level, D, z, basis, subsets, hpa)
opt.1(D, z, basis, subsets, hpa.start, give.answers=FALSE, ...)
opt.gt.1(level, D, z, basis, subsets, hpa.start, give.answers=FALSE, ...)
``````

### Arguments

 `level` level `D` Design matrix for top-level code `z` Data `basis` Basis function `subsets` subsets object `hpa` hyperparameter object `hpa.start` Starting value for hyperparameter object `give.answers` Boolean, with default `FALSE` meaning to return just the point estimate, and `TRUE` meaning to return extra information from the call to `optim()` `...` Extra arguments passed to `optim()`. A common one would be `control=list(trace=100)`

### Details

This function is the object function used in toy optimizers `optimal.hpa()`.

### Author(s)

Robin K. S. Hankin

### References

M. C. Kennedy and A. O'Hagan 2000. “Predicting the output from a complex computer code when fast approximations are available” Biometrika, 87(1): pp1-13

`genie`

### Examples

``````data(toyapps)
object(level=4, D=D1.toy , z=z.toy,basis=basis.toy,
subsets=subsets.toy, hpa=hpa.fun.toy(1:19))
object(level=4, D=D1.toy , z=z.toy,basis=basis.toy,
subsets=subsets.toy, hpa=hpa.fun.toy(3+(1:19)))

# Now a little example of finding optimal hyperpameters in the toy case
# (a bigger example is given on the genie help page)
jj <- list(trace=100,maxit=10)

hpa.toy.level1 <- opt.1(D=D1.toy, z=z.toy, basis=basis.toy,
subsets=subsets.toy, hpa.start=hpa.toy,control=jj)

hpa.toy.level2 <- opt.gt.1(level=2, D=D1.toy, z=z.toy,
basis=basis.toy, subsets=subsets.toy,
hpa.start=hpa.toy.level1, control=jj)

hpa.toy.level3 <- opt.gt.1(level=3, D=D1.toy, z=z.toy,
basis=basis.toy, subsets=subsets.toy,
hpa.start=hpa.toy.level2, control=jj)

hpa.toy.level4 <- opt.gt.1(level=4, D=D1.toy, z=z.toy,
basis=basis.toy, subsets=subsets.toy,
hpa.start=hpa.toy.level3, control=jj)

``````

approximator documentation built on Aug. 25, 2023, 1:07 a.m.