EK.eqn10.supp(X.dist, D1, D2, H1, H2, d, hbar.fun,
lower.theta,upper.theta, extractor, give.info, phi, ...)
X
, in the form of a
two-element list. The first element is the mean (which should have
name mean
D1
D2
X
)
of h1(x,theta)
and h2(x)
as per section 4.2theta
(NB: a vector)theta
(NB: a
vector)extractor.toy()
for
an exampleFALSE
meaning to return
just the answer and TRUE
to return the answer along with all
output from both integrations as performed by adapt()
.length(theta)>1
), then the
arguments are passed to adapt()
; if one dimensional, they
are passed to integrate()
.Equation 10 integrates over the prior distribution of theta
. If
theta
is a vector, multidimensional integration is necessary.
In the case of multidimensional integration, the eponymous
adapt()
is used. Note that, as of version 1.0-3, this is
restricted to less than 20 dimensions---which is not checked for.
Evaluation is slow, as multidimensional integration is hard (spot the
understatement).
In the case of one dimensional integration---theta being a
scalar---function integrate()
of the stats package is used.
Note that equation 10 is conditional on the observed data and the hyperparameters.
1+1
# Not run because it takes R CMD check too long.
data(toys)
EK.eqn10.supp(X.dist=X.dist.toy, D1=D1.toy, D2=D2.toy, H1=H1.toy, H2=H2.toy, d=d.toy, hbar.fun=hbar.fun.toy, lower.theta=c(-3,-3,-3), upper.theta=c(3,3,3),extractor=extractor.toy, phi=phi.toy)
Run the code above in your browser using DataLab