I thought I'd just share a few ideas for Stan. I'm still fairly new to the software, so I may misunderstand some of the features. Some of those ideas are likely to have been floated before, and I appreciate that the development team doesn't have unlimited resources.
That said, perhaps this can be the start of a useful conversation.
General
------------
- Support for sparse covariance matrices / band diagonal Cholesky matrices would be swell for implementing some Gaussian processes, such as AR(p). Alternatively, supporting vector and array slicing could confer the same benefit.
- Support for Daubechies wavelets and FFT is also useful to model large arrays with few coefficients.
- Some functions such as sqrt aren't yet vectorized.
Sampling
---------------
- l-bfgs-hmc looks quite promising and seems much cheaper than Riemannian HMC.
- parallel tempering is big in molecular dynamics where finding where the mass of the distribution lies is half the battle. Any thoughts on it?
Modeling language
-------------------------------
- Why not use name mangling to limit accidental collisions with C++ keywords?
- Parameters and generated quantities could be annotated to specify the sampler's behavior
(@all: keep track of variable / @m[k]: keep track of the first k moments only / @category: keep track of the marginal categorical distribution of the parameter / @ignore: ignore)
- If I'm not mistaken, upper and lower bounds only seem to apply during initialization and aren't enforced later on, unless T[] is used. The semantic is a little bit confusing as the bound is applied to the parameter's type, suggesting it's an intrinsic property. If it is only used for initialization, it should appear on the right hand side.
Python specific
-------------------------
- It would be very useful to be able to build a python representation of the model, before compilation, for debugging purposes. Beats "print".
- Is there a way to pass a logger to the sampling method instead of having it write to stdout by default?
Best,
Arthur
> - Support for Daubechies wavelets and FFT is also useful to model large arrays with few coefficients.
No idea what this is, but it probably explains why someone
was asking us if we had an FFT function in Stan itself.
Discrete FFT's are pretty easy to compute and Eigen's library is
solid. We're using it to compute autocorrelations in order to
estimate effective sample sizes.
I don't know how well auto-diffing Eigen's FFT algorithm would work.
Are there analytic gradients?
> - Some functions such as sqrt aren't yet vectorized.
Most functions aren't generalized to apply to vectors. That's a
convenience issue as it won't be any faster in Stan to vectorize.
> Sampling
> ---------------
>
> - l-bfgs-hmc looks quite promising and seems much cheaper than Riemannian HMC.
See other response.
Thanks for posting to the group. I'll respond again for everyone.
On Sep 9, 2014, at 12:28 AM, Arthur Breitman <arthur....@gmail.com> wrote:
> - Support for Daubechies wavelets and FFT is also useful to model large arrays with few coefficients.
No idea what this is, but it probably explains why someone
was asking us if we had an FFT function in Stan itself.
Discrete FFT's are pretty easy to compute and Eigen's library is
solid. We're using it to compute autocorrelations in order to
estimate effective sample sizes.
I don't know how well auto-diffing Eigen's FFT algorithm would work.
Are there analytic gradients?
> - Some functions such as sqrt aren't yet vectorized.
Most functions aren't generalized to apply to vectors. That's a
convenience issue as it won't be any faster in Stan to vectorize.
> - Parameters and generated quantities could be annotated to specify the sampler's behavior
> (@all: keep track of variable / @m[k]: keep track of the first k moments only / @category: keep track of the marginal categorical distribution of the parameter / @ignore: ignore)
We don't keep track of any moments directly (if by that you mean storing
X^2 as well as X --- they're easy to compute after the fact).
I'm not sure what you mean here. If there are upper and lower bounds
declared on a parameter:
> Python specific
> -------------------------
>
> - It would be very useful to be able to build a python representation of the model, before compilation, for debugging purposes. Beats "print".
You mean of the Stan program? Stan isn't restricted
to graphical models like BUGS or JAGS.
Agreed. Vectorizing everything's on our to-do list.
While we're at it, there's also the crossentropy method.
If you have a good analytical approximation of your posterior for which maximum likelihood is tractable, you can alternate between importance sampling, and fitting it to the drawn samples.
It has the advantage that it's a global approach, it has the disadvantage that, well, the posterior is probably not well approximated by anything tractable.
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/Dfa_mV3MyXA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
If the model is a simple expression, the irrelevant parameters for a subset could be detected by making a fast dummy pass though the likelihood function and tainting the parameters as we go.
With if statements, recursion, etc, a real pass can be made without AD, followed by an AD pass that knows the support of the gradient.
After the parameters are updated (for a given batch), the support is unlikely to have changed, and it can be used as a guess for the next evaluation, refining it with more (or less) parameters if inadequate.
It gets murkier when working with matrices though.
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/Dfa_mV3MyXA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
I'm replying to on old thread, which may provide more context.
The idea is that some techniques allow one to sample by computing the likelihood function on random subsets of the data. For this to be efficient however, one needs to know how parameters relate to these subsets.
One approach is to explicitly index some parameters (typically some hidden variables) along with the observations. However, I was pointing out that such a relationship could be detected automatically.