The Stan Math Library is a C++ template library for automatic differentiation of any order using forward, reverse, and mixed modes. It includes a range of built-in functions for probabilistic modeling, linear algebra, and equation solving.
multi_normal_cholesky
for non-autodiff covariance. (#2439)STAN_NO_RANGE_CHECKS
macro which turns off bounds and range checks.(#2423, #2437)gp_*_cov
functions, especially for large amount of data.(#2464)unsigned
and long
types with apply_scalar_unary
.(#2469)stanc.exe
did not work on Windows.(#2480)rep_*
utility functions for new matrix type(#2358)var<Matrix>
overloads for digamma, distance, Phi, inv_Phi, Phi_approx, sqrt, tail, tgamma, rows_dot_self, fma, offset_multiplier, bessel first and second kind, beta, binary log loss, ceil, erf, erfc, exp2, expm1, falling_factorial and floor (#2362, #2378, #2396, #2461)to_matrix
, to_vector
, to_row_vector
, to_array_1d
, to_array_2d
, append_array
, reverse
, symmetrize_from_lower_tri
, symmetrize_from_upper_tri
trace
.(#2377, #2383, #2388)rep_matrix
, rep_vector
, rep_row_vector
, rep_array
and identity_matrix
.(#2388).triangularTranspose()
member funtion from matrix_cl
and TriangularMapCL
enum. .triangularTranspose()
is replaced by symmetrize_from_lower_tri()
.(#2393)log_mix
, log_softmax
, log_sum_exp
, rank
, sd
, softmax
and ˙variance
.(#2426)ub_constrain
, lb_constrain
, lub_constrain
, offset_multiplier_constrain
and unit_vector_constrain
.(#2427)prod
function and kernel generator operation for rowwise, colwise and 2d product.(#2433)bernoulli_cdf
, bernoulli_lcdf
, bernoulli_lccdf
, cauchy_cdf
, cauchy_lcdf
, cauchy_lccdf
.(#2446)double_exponential_cdf
, double exponential_lcd
, double_exponential_lccdf
˙, exp_mod_normal_cdf
, exp_mod_normal_lcdf
and exp_mod_normal_lccdf
.(#2449)exponential_cdf
, exponential_lcdf
, exponential_lccdf
, frechet_cdf
, frechet_lcdf
and frechet_lccdf
.(#2450)gumbel_cdf
, gumbel_lcdf
, gumbel_lccdf
, logistic_cdf
, logistic_lcdf
and logistic_lccdf
.(#2451)pareto_cdf
, pareto_lccdf
, pareto_lcdf
, pareto_type_2_cdf
, pareto_type_2_lccdf
, and pareto_type_2_lcdf
.(#2456)rayleigh_cdf
, rayleigh_lccdf
, rayleigh_lcdf
, skew_double_exponential_cdf
, skew_double_exponential_lccdf
, skew_double_exponential_lcdf
and skew_double_exponential_lpdf
.(#2457)lognormal_cdf
, lognormal_lccdf
, lognormal_lcdf
, normal_cdf
, normal_lccdf
, normal_lcdf
.(#2458)std_normal_cdf
, std_normal_lccdf
, std_normal_lcdf
, uniform_cdf
, uniform_lccdf
and uniform_lcdf
.(#2459)weibull_cdf
, weibull_lccdf
and weibull_lcdf
.(#2460)gp_exponential_cov
, gp_matern32_cov
, matern_52_cov
and both prim and rev implementation for gp_dot_prod_cov
.(#2471)ref_type
) for kernel generator expressions.(#2404)cholesky_decompose
not propagating derivatives correctly .New functions:
symmetrize_from_lower_tri(matrix m)
function to stan::math
.(#2209)generalized_inverse
function.(#2225)svd_U
and svd_V
, add gradients to singular_values
.(#2286)Miscellaneous improvements and bugfixes:
reduce_sum
parallelism.(#2162)ordered_probit_lpmf
for increased numerical stability(#2229)mdivide_left
to avoid doing QR decomposition in reverse passes. (#2230)scalar_type_t
now decays references for var_value<T>
types(#2264)adjoint_of()
function that accesses .adj()
of var
s, but analogous to value_of()
also works on prim types (returning a dummy object).(#2270)Expressions:
#2093, #2131, #2133, #2136, #2138, #2139, #2150, #2151, #2186, #2190, #2205
OpenCL:
#2117, #2155, #2176, #2177, #2180, #2181, #2215, #2173, #2174, #2184, #2185, #2191, #2216, #2217, #2217, #2219, #2221, #2222, #2226, #2231, #2236, #2236, #2250, #2253, #2258, #2259, #2263, #2267, #2270, #2272, #2273, #2274, #2275, #2294, #2295, #2296, #2311, #2316
pinned_matrix
class is used. Depending on the OPenCL implementation, optimization for CPUs and Discrete GPUs may also require use of this class. (#2219)check_cl
, extended support for integer arguments, added support for kernel expressions returning a scalar, added compound assignment operators, made transpose kernel generator operation assignable.arena_matrix_cl
so it can be assigned a matrix_cl
.(#2270)Varmat:
var_value<Matrix>
overloads for array and column vector converters.(#2278)varmat
(#2284)var<matrix>
to make some of the distributions var matrix compatible(#2292)to_var_value
and from_var_value
now work with std::vector
types(#2299)varmart
(#2254)var<matrix>
along several other unary operators (#2256)var
and vari
so that autodiff can use multiple floating point types.(#1915)hmm_marginal
(#1994)reverse_pass_callback
, a simpler and faster alternative to adj_jac_apply
. dot_product
implementation that accepts pointers has been removed.(#2011)fmin
and fmax
with equal inputs equivalent across reverse- and forward-mode(#2063)<Eigen/*>
outside the main Eigen header file.(#2080)quad_form_sym
.(#2096)var_value:
vari
to hold an Eigen type(#1952)operands_and_partials
now supports var_value
operands.(#1970)var_value
and Eigen matrix of vars and a metaprogram that determines return type of a function that accepts a mixture of var_value
s and Eigen matrices and propagates var_value
if present.(#2047)vari_value<Matrix>
types that allow for compound slicing expressions.(#2064)var_value
.(#2065)Testing:
Building:
/bin/bash
with /usr/bin/env bash
in the makefiles.(#1998)OpenCL backend:
matrix_cl<var>
specialization.(#2021)normal_id_glm_lpdf
can also be used when derivatives of x
or y
are needed.(#2034)bernoulli_logit_glm_lpmf
and poisson_log_glm_lpmf
can also be used when derivatives of x
are needed.(#2035)neg_binomial_2_log_glm_lpmf
, ordered_logistic_glm_lpmf
and categorical_logit_glm_lpmf
can also be used when derivatives of x
are needed.(#2055)int add(int,int)
and real add(real,real)
.(#1858)is_valid_expression
to is_valid_kernel_expression
and require_all_valid_expressions*
to require_all_valid_kernel_expressions*
.(#1859)isfinite
, isnan
, isinf
) to kernel generator.(#1860)append_row
and append_col
) to kernel generator.(#1867)cpplint
to conform to pypi
(#1871)value_of
and value_of_rec
now can now return Eigen expressions.(#1872)stan::math::eigenvectors_sym
and stan::math::eigenvalues_sym
now returns symmetric matrix (previously lower triangular).(#1878)value_of
, value_of_rec
, as_column_vector_or_scalar
and as_array_or_scalar
now work with rvalue inputs.(#1914)matrix_cl
from row-major matrix or expression.(#1919)bernoulli_logit_glm_lpmf
and poisson_log_glm_lpmf
with kernel generator implementations.(#1929)test_repeat_as_vector
in distribution tests.(#1933)operands_and_partials
by making broadcast_array
sum the argument when assigned to.(#1934)mix
tests for pow
on Windows with g++ 4.9.3(#1951)real
and int
containers as inputs(#1966)ode_bdf
, ode_adams
, ode_rk45
and ode_bdf_tol
,ode_adams_tol
,
ode_rk45_tol
) and deprecated the old interfaces (integrate_ode_rk45
, integrate_ode_bdf
, integrate_ode_adams
). It is important to switch to the new interfaces because the deprecated interfaces are much slower (we've seen up to 30%) than they previously were (#1641)reduce_sum
utility for parallelizing calculations over multiple cores of one computerThere were also extensive work in various parts of the Math library adding docs, cleaning up distribution functions, adding tests, generalizing functions to work with special Eigen temporary types, working with new template functions (return_type_t
, etc.), and otherwise making quality of life improvements.
Thanks to everyone who submitted and reviewed pull requests! The list of pull request submitters for this release are (in no particular order): @t4c1, @mcol, @martinmodrak, @rok-cesnovar, @serban-nicusor-toptal, @SteveBronder, @kedartal, @wds15, @bob-carpenter, @peterwicksstringfield, @andrjohns, @pgree, @IvanYashchuk, and @bbbales2.
Contributor | Title |
---|---|
t4c1 : (#1824) | Add unary operations minus and logical negation to kernel generator |
wds15 : (#1819) | Feature/issue 1818 upgrade sundials 520 |
SteveBronder : (#1813) | adds reduce_sum and tests |
t4c1 : (#1802) | Add extended kernel generator docs |
t4c1 : (#1801) | Add support for device functions to kernel generator |
SteveBronder : (#1800) | Adds auxilary functions needed for reduce_sum |
t4c1 : (#1797) | Add broadcasting to kernel generator |
SteveBronder : (#1791) | adds an apply function and cleans adj_jac_apply to use it |
peterwicksstringfield : (#1780) | Feature/elementwise check |
bob-carpenter : (#1774) | Feature/0123 complex funs |
t4c1 : (#1769) | Add transposition to kernel generator |
t4c1 : (#1767) | avoid redundant buffer allocations in kernel generator |
t4c1 : (#1751) | Allow kernel generator to calculate multiple outputs in single kernel |
t4c1 : (#1740) | Add colwise reductions to kernel generator |
bob-carpenter : (#1736) | Feature/1734 return scalar meta |
andrjohns : (#1727) | Eigen::Map and elementwise functions |
t4c1 : (#1726) | Bugfix common subexpression elimination in kernel generator |
bob-carpenter : (#1720) | Feature/0123 complex spec |
mcol : (#1716) | Add discrete_range_cdf, discrete_range_lcdf and discrete_range_lccdf |
martinmodrak : (#1706) | Using local_nested_autodiff for all instances of nested autodiff |
mcol : (#1680) | Add discrete_range_rng(lower, upper) and discrete_range_lpmf |
wds15 : (#1675) | avoid vari on chain-stack if var is constructed from an arithmetic type |
martinmodrak : (#1657) | Improved behavior of expect_near_rel |
mcol : (#1650) | Add reverse |
mcol : (#1636) | Add row vector, array and int_array construction utilities |
t4c1 : (#1623) | Add rowwise reductions to kernel generator |
martinmodrak : (#1575) | Additional tests for distributions |
martinmodrak : (#1830) | More stable implementation of neg_binomial_2_log_lpmf |
Contributor | Title |
---|---|
mitzimorris : (#1842) | Bugfix/1839 make shell linux |
bob-carpenter : (#1837) | return value type for complex abs; fixes #1836 |
bbbales2 : (#1834) | Fix ode gradients with respect to t0 (Issue #1833) |
rok-cesnovar : (#1825) | Add licensing info to log_modified_bessel_first_kind |
bbbales2 : (#1810) | Added arithmetic version of pow (Fixes: #1809) |
t4c1 : (#1807) | fixed normal_id_glm for const sigma |
rok-cesnovar : (#1795) | Makefiles: Add $(strip) to findfiles function |
SteveBronder : (#1794) | Cleanup requires with macros |
rok-cesnovar : (#1789) | Reorganize Jenkins test stages |
rok-cesnovar : (#1786) | Add a release notes section in the pull request template |
rok-cesnovar : (#1784) | Makefiles: strip newlines in findiles and fix runChecks call |
serban-nicusor-toptal : (#1777) | Moved verify changes Jenkins step to shared libraries. |
pgree : (#1772) | Changed calculation of log_sum_exp(x1, x2) |
peterwicksstringfield : (#1771) | More documentation fixups. |
SteveBronder : (#1768) | [WIP][WIP] Add docs and generic value type signatures for reduce_sum |
rok-cesnovar : (#1765) | Cleanup duplicated overloads of scalar std:: functions |
mcol : (#1762) | Remove fwd versions of qr_Q and qr_R |
mcol : (#1761) | Move size_zero() calls after other consistency checks (L-Z) |
mcol : (#1758) | Move size_zero() calls after other consistency checks (A-I) |
peterwicksstringfield : (#1756) | Documentation fixups |
t4c1 : (#1754) | Generalize */fun starting with cr-d |
t4c1 : (#1747) | Generalize */fun startimg with chole-cov |
mcol : (#1744) | Reuse intermediate computations in distributions part 1 |
rok-cesnovar : (#1743) | Update license.md year to 2020 |
t4c1 : (#1732) | Generalize */fun starting with a-chol2 |
mcol : (#1730) | Avoid 'Blocked loading mixed active content' errors |
mcol : (#1728) | Keep computations in log space and simplify expressions in beta binomial_*cdf |
serban-nicusor-toptal : (#1724) | Run CI/CD only on Source Code |
pgree : (#1722) | remove discontinuity in lub_constrain; fixes #1441 |
mcol : (#1718) | Remove size zero checks from check_multiplicable |
mcol : (#1717) | Remove promote_common and common_type |
mcol : (#1715) | Cleanup mdivide_* and tests |
rok-cesnovar : (#1712) | fix develop |
rok-cesnovar : (#1711) | Bugfix/include what you use in /prim/fun |
rok-cesnovar : (#1707) | Add namespace qualifiers to size() |
mcol : (#1705) | Check for positive definiteness only after computing the LLT factors |
mcol : (#1701) | Don't throw when computing the inverse of a size zero matrix |
mcol : (#1698) | Improve tests and documentation for quad_form and quad_form_sym |
mcol : (#1688) | Add positive definite checks to mdivide_left_spd |
mcol : (#1685) | Allow multiply for size 0 inputs |
kedartal : (#1684) | Explicitly call stan::math::size (fix ambiguous call versus std::size) |
mcol : (#1682) | Check for consistent sizes before comparing arguments |
mcol : (#1678) | Reorganize files after flatten |
mcol : (#1673) | Remove Boost deprecation warning |
mcol : (#1665) | make develop build again |
mcol : (#1663) | correctness fixes in neg_binomial_* functions |
mcol : (#1661) | Move vectorize files to meta folder |
t4c1 : (#1660) | Generalize view and size functions |
mcol : (#1655) | Cleanup in poisson_cdf, poisson_lccdf and poisson_lcdf |
serban-nicusor-toptal : (#1653) | Fix permission denied in Jenkins pipeline |
mcol : (#1649) | Clean up code to use index_type_t, return_type_t and partials_return_t |
t4c1 : (#1628) | Generalize operator-like functions |
martinmodrak : (#1614) | Improved numerical stability of binomial_coefficient_log |
rok-cesnovar : (#1567) | Cleanup the use of find in makefile |
SteveBronder : (#1525) | Generic var templates for operators and std::iterator_trait var/fvar specialization |
martinmodrak : (#1497) | Fixing negative binomial phi cutoff |
t4c1 : (#1796) | Bugfix: make kernel generator wait for events on matrices |
mcol : (#1674) | Document template parameters in /prim |
mcol : (#1668) | Rename spaced_* to linspaced_* |
wds15 : (#1821) | clarify README.md |