stan-dev / stan

Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.
https://mc-stan.org
BSD 3-Clause "New" or "Revised" License
2.6k stars 370 forks source link

vectorize Jacobians in transforms #524

Open bob-carpenter opened 10 years ago

bob-carpenter commented 10 years ago

Vectorize all the Jacobians. They should already be analytic, but if they're not, do that, too.

syclik commented 7 years ago

@bob-carpenter, do we need to:

bob-carpenter commented 7 years ago

@bob-carpenter, do we need to:

• add vectorized function signatures for Jacobians in the math library?

Yes. Vectorized versions of the transform function that take a single Jacobian to increment. It's the autodiff variable for that result that matters. E.g.,

real sigma[K];

We'd want to create a vari object to add to the log Jacobian, but we need to return K transformed variables.

• add precomputed gradients for Jacobians in the math library?

Yes. So this is going to need an issue there, too.

• have code generator generate vectorized Jacobian calls? or do the two things above take care of it?

Yes. That's mainly what needs to happen in this repo.