News for hackers. Stuff that matters.
Re:Stan is a state-of-the-art platform for statistical modeling by pvitz on Wednesday December 23, 2020 @09:48AM (#25518086)
By looking at the user's guide, it seem that Stan has also other use cases than Bayesian inference. Examples are linear regression, mixture models and even ODEs. Does anybody here have experience with Stan and R and could comment on the strengths of Stan in non-Bayesian contexts?
Re:Stan is a state-of-the-art platform for statistical modeling by standevbob on Wednesday December 23, 2020 @10:54AM (#25518860)
Stan provides both frequentist inference (penalized maximum likelihood with bootstrapped confidence intervals) and Bayesian inference (MCMC sampling or approximate variational) inference.

As currymj says, the differential equations (same for all the linear algebra solvers like eigendecomposition) can be used in defining likelihoods for either Bayesian or frequentist estimation. Same for all of our linear algebra operations and special functions.

Not every model that can be programmed in Stan has a well-defined MLE or proper posterior. Standard hierarchical/multilevel models don't have MLEs, even with standard shrinkage. Bayesian models with improper priors and no data wind up with improper posteriors, etc.

Having said all that, almost all of the use of Stan is for Bayesian inference.

Re:Stan is a state-of-the-art platform for statistical modeling by ChrisRackauckas on Wednesday December 23, 2020 @11:28AM (#25519256)
DiffEqBayes.jl can transpile Julia ODE code to Stan. This is a nice interface to use Stan directly from Julia, and also makes it easy to benchmark the ODE inference in a bunch of PPLs. Some benchmarks:

https://benchmarks.sciml.ai/html/ParameterEstimation/DiffEqB...

https://benchmarks.sciml.ai/html/ParameterEstimation/DiffEqB...

Re:Stan is a state-of-the-art platform for statistical modeling by Crye on Wednesday December 23, 2020 @10:27AM (#25518524)
I don't know what your experience with Bayesian modeling is, and I'll admit mine is limited, but STAN can solve linear regression by defining up a linear model and then setting the dimension parameters as a normal distribution to solve. This is great because it gives you a measure of certainty for each of your parameters.
Re:Stan is a state-of-the-art platform for statistical modeling by currymj on Wednesday December 23, 2020 @10:38AM (#25518665)
I believe the main reason for including ODE solvers is basically to do Bayesian parameter estimation of ODEs from data.

likewise as far as I know, linear regression and mixture models are both done in a Bayesian style (a hierarchical model giving priors for parameters).

Re:Stan is a state-of-the-art platform for statistical modeling by elsherbini on Wednesday December 23, 2020 @10:33AM (#25518597)
Stan uses MCMC (specifically NUTS, which is a Hamiltonian Monte Carlo sampler) to optimize parameter fitting, so it can be used for things like ODEs.

Here is an example from a class taught last January that uses stan to fit a simple ODE (using the `integrate_ode_rk45` function in stan):

https://github.com/gregbritten/BayesianEcosystems_IAP/blob/m...

Re:Stan is a state-of-the-art platform for statistical modeling by nlpNick on Wednesday December 23, 2020 @10:56AM (#25518892)
You may find the `rstanarm` package interesting/useful. I've used it for linear regression and HLMs. https://mc-stan.org/rstanarm/articles/index.html