Skip to content

Commit 4290e7d

Browse files
committed
dimension issues
1 parent a5fcfaa commit 4290e7d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

nimbleQuad/R/Laplace.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,8 @@ buildOneAGHQuad1D <- nimbleFunction(
797797
gr_rehatwrtp <<- hesslogLikwrtpre/negHessian
798798
if(quadTransform_ == "center"){
799799
## If not scaling then the gr wrt to sigma = 0.
800-
gr_sigmahatwrtp <<- nimNumeric(value = 0, length = p_indices)
801-
gr_sigmahatwrtre <<- 0
800+
gr_sigmahatwrtp <<- grlogdetNegHesswrtp*0
801+
gr_sigmahatwrtre <<- grlogdetNegHesswrtre*0
802802
}else{
803803
## dsigma_hat/dp (needed at real scale)
804804
sigma_hat <- 1/sqrt(negHessian)
@@ -2233,7 +2233,8 @@ buildAGHQ <- nimbleFunction(
22332233
## stop("updateSettings: `computeMethod` must be 1, 2, or 3")
22342234
## }
22352235
if(quadTransform != "NULL") {
2236-
if(quadTransform != "spectral" & quadTransform != "cholesky")
2236+
if(quadTransform == "centre") quadTransform <- "center" ## British spelling okay.
2237+
if(!any(quadTransform == c("spectral", "cholesky", "identity", "center")))
22372238
stop("`quadTransform` must be either cholesky or spectral.")
22382239
}
22392240
# actions

0 commit comments

Comments
 (0)