Skip to content

Commit

Permalink
fix Gamma simulation (#782, still needs test)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbolker committed Apr 26, 2024
1 parent e0071b7 commit 2ab7cc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/predict.R
Expand Up @@ -935,7 +935,7 @@ Gamma_simfun <- function(object, nsim, ftd=fitted(object),
if (any(wts != 1)) message("using weights to scale shape parameter")
## used to use gamma.shape(), but sigma() is more general
## (wouldn't work *outside* of the merMod context though)
shape <- sigma(object)*wts
shape <- 1/sigma(object)^2*wts
rgamma(nsim*length(ftd), shape = shape, rate = shape/ftd)
}

Expand Down
3 changes: 2 additions & 1 deletion inst/NEWS.Rd
Expand Up @@ -9,9 +9,10 @@
\itemize{
\item \code{predict(., re.form=...)} works in a wider range of
cases (GH #691)
\item Gamma simulation now uses correct shape parameter (GH #782)
}
} % bug fixes
} % 1.1-35.3
} % 1.1-35.9000

\section{CHANGES IN VERSION 1.1-35.3 (2024-04-16)}{
\subsection{BUG FIXES}{
Expand Down

0 comments on commit 2ab7cc3

Please sign in to comment.