Description Usage Arguments Value Author(s) Examples
Function to call OpenCL program to calculate posterior means and standard deviations of random effects in models with 2 structure matrices.
1 | oclCombo1col(a, b, D, tausqy, tausqphi, By)
|
a |
Eigenvector matrix of 1st Q matrix. |
b |
Eigenvector matrix of 2nd Q matrix. |
D |
Matrix of eigenvalues from the 2 structure matrices. |
tausqy |
Vector of samples of measurement error precision. |
tausqphi |
Matrix sampled values of spatial precisions. |
By |
Vector resulting from premultiplication of data vector y b transpose of kronecker sum of eigenvector matrices. |
phimean |
Vector of means of posterior densities of random effects |
phisd |
Vector of standard deviations of marginal posterior |
Kate Cowles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ##---- 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(a,b,D, tausqy, tausqphi, By)
{
if(!is.numeric(a) | !is.numeric(b) )
stop("a and b must be numeric matrices")
na1 <- nrow(a)
nb1 <- nrow(b)
nc1 <- length(tausqy)
F1 <- ncol(tausqphi) + 1
nab <- na1 * nb1
mmean <- rep(0, nab)
ssd <- rep(0,nab)
out <- .C("doCombo1colD", a=as.double(as.vector(t(a))),
b = as.double(as.vector(t(b))),
D = as.double(as.vector(t(D))),
tausqy = as.double(tausqy) ,
tausqphi = as.double( as.vector( t(tausqphi) )) ,
By = as.double(By), mean = as.double(mmean), sd = as.double(ssd),
na1 = as.integer(na1),
nb1 = as.integer(nb1), nc1 = as.integer(nc1), F1 =
as.integer(F1), PACKAGE="CARramps" )
return(list( phimean = out$mean, phisd = sqrt(out$sd/(nc1-1) )))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.