Description Usage Arguments Value Author(s) Examples
Function to call OpenCL for rejection sampling.
1 | oclSampling(kernel, smat, alpha, beta = beta, D, By, k)
|
kernel |
OpenCL kernel to be run |
smat |
|
alpha |
|
beta |
|
D |
|
By |
|
k |
matrix; first column is log of marginalized posterior density of each candidate vector, and second column is beta parameter for generating a corresponding value of tausqtot from a gamma density
Kate Cowles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function( smat, alpha, beta=beta, D, By, k)
{
N1 <- length(By)
F1 <- ncol(smat) + 1
nsamp1 <- nrow(smat)
logpostdens <- newbetaret <- rep(0,nsamp1 )
out <- .C("doSamplingD", smat=as.double(as.vector(t(smat))),
D = as.double(as.vector(t(D))),
By = as.double(By),
alpha = as.double(alpha),
beta = as.double(beta), logpostdens = as.double(logpostdens),
newbetaret = as.double(newbetaret),
nsamp1 = as.integer(nsamp1), N1 = as.integer(N1),
F1 = as.integer(F1), nk1 = as.integer(k), PACKAGE="CARramps")
return( cbind( out$logpostdens, out$newbetaret) )
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.