log(sigma) twice in weibull_log

0 views
Skip to first unread message

Jiqiang Guo

unread,
Dec 2, 2011, 11:28:59 AM12/2/11
to stan development mailing list
Looking at the code to figure out the parameterization for Weibull
distribution, can't help thinking it might be a little bit better to
just do it once.

--
Jiqiang

Bob Carpenter

unread,
Dec 2, 2011, 12:14:47 PM12/2/11
to stan...@googlegroups.com

You're absolutely right -- we can set a local
variable and reuse. It'll save not only the log
evals, but also a bunch of steps and some memory
in the gradient calculations.

There are probably more optimizations of this
kind.

One big one we've looked at is the matrix
inverse and determinant in the multivariate
normal. Matt unfolded one to use the solver
from Eigen for more efficiency. We should also
add a version with an inverse-covariance matrix
parameter so that if it's constant, we don't
have to keep computing inverses every evaluation.

And of course, we're working on the propto
versions that don't normalize -- you can drop
lots of terms then

The parameterizations are the ones in Andrew's
"Bayesian Data Analysis" with type names and
greek letters matching the names and symbols in
the book, too.

- Bob


>
> --
> Jiqiang
>

Matt Hoffman

unread,
Dec 2, 2011, 3:06:40 PM12/2/11
to stan...@googlegroups.com
This is probably Ben or Malecki's doing, not mine, although I
wholeheartedly support it!

Matt

Reply all
Reply to author
Forward
0 new messages