Open syclik opened 8 years ago
A score() function would be good --- to calculate the derivative of the log-likelihood, usually on a per observation basis --- but it would also be good to have a gradient() function to calculate the derivative of an expression to feed into the log-likelihood. But I'm not sure how high a priority this would be relative to other things because in 2.13.0 you can get to the gradient(), jacobian(), etc. functions in Stan Math by writing your own C++.
You have to be careful to use nested autodiff properly. The gradient() function is set up to do that, but you have to work in a purely nested fashion as we do in the Jacobian calcs for the ODE solver.
Also, I don't know how we could return the value of the derivative of the log density until it's been completely defined. Then we can't use it for anything in the density, or the density will change. Where do you need this function and for what?
I have been waiting for this function request and hoping to get to use it for Design of Experiment via Information matrix.
We don't even have a technical spec for how this could work, so it's not going to be done soon unless someone figures out how to do it.
On Jan 27, 2017, at 8:14 AM, jvaara notifications@github.com wrote:
I have been watching this function request and hoping to use it for Design of Experiment via Information matrix.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Summary:
This is from @bgoodri on stan-dev/stan#605.
Add a
score()
function to the language. It would require nested autodiff.Description:
Add the score function.
See: https://en.wikipedia.org/wiki/Score_(statistics)
Additional Information:
I'm not sure exactly how this would work. @bgoodri, might need some help.
Current Version:
v2.13.0