Releases: cibotech/scalastan
Releases · cibotech/scalastan
v0.11.0
Sonatype
v0.10.0
v0.8.3
v0.8.2
New Features:
- Support for Stan 2.18 functions.
- Improved Stan result parsing performance.
- Initial value support for locals.
Fixes:
- Fixed a null pointer exception that could happen when running multiple ScalaStan instances on the same box.
- ScalaStan now parses NaN, -Inf, and Inf from the Stan results correctly.
numElements
has been deprecated in favor ofnum_elements
to match the Stan documentation.
See #109.
v0.8.1
v0.8.0
API Changes
- There is now a
StanModel
trait which takes the place of theScalaStan
andModel
traits. See PR #106. The goal is to make it easier to combine models. TheScalaStan
trait is now deprecated. For the most part, the only change necessary will be to replaceModel
withStanModel
, and then move parameters and data items into theStanModel
section. For example:
The old way:
object MyApp extends App with ScalaStan {
val n = data(int(lower = 0))
val x = data(vector(n))
val y = data(vector(n))
val b = parameter(real())
val m = parameter(real())
val sigma = parameter(real(lower = 0.0))
val model = new Model {
sigma ~ stan.cauchy(0, 1)
y ~ stan.normal(m * x + b, sigma)
}
val xs: Seq[Double] = ???
val ys: Seq[Double] = ???
val results = model
.withData(x, xs)
.withData(y, ys)
.run(chains = 5)
results.summary(System.out)
}
The new way (note that the location of the data and parameters has moved):
object MyApp extends App {
object MyModel extends StanModel {
val n = data(int(lower = 0))
val x = data(vector(n))
val y = data(vector(n))
val b = parameter(real())
val m = parameter(real())
val sigma = parameter(real(lower = 0.0))
sigma ~ stan.cauchy(0, 1)
y ~ stan.normal(m * x + b, sigma)
}
val xs: Seq[Double] = ???
val ys: Seq[Double] = ???
val results = MyModel
.withData(MyModel.x, xs)
.withData(MyModel.y, ys)
.run(chains = 5)
results.summary(System.out)
}
Fixes
- ScalaStan now supports loading mass matrices when run with the
DenseE
option (previously onlyDiagE
worked).