Deprecated Features

This appendix lists currently deprecated functionality along with how to replace it.

Starting with Stan 2.29, minor (syntax-level) deprecations can be removed 3 versions after release; e.g., syntax deprecated in Stan 2.20 will be removed in Stan 2.23 and placed in Removed Features. The Stan compiler can automatically update many of these on the behalf of the user for at least one version after they are removed.

Any feature which changes semantic meaning (such as the upgraded ODE solver interface) will not be removed until a major version change (e.g., Stan 3.0).

lkj_cov distribution

Deprecated:The distribution lkj_cov is deprecated.

Replacement: Replace lkj_cov_lpdf(...) with an lkj_corr distribution on the correlation matrix and independent lognormal distributions on the scales. That is, replace

cov_matrix[K] Sigma;
// ...
Sigma ~ lkj_cov(mu, tau, eta);

with

corr_matrix[K] Omega;
vector<lower=0>[K] sigma;
// ...
Omega ~ lkj_corr(eta);
sigma ~ lognormal(mu, tau);
// ...
cov_matrix[K] Sigma;
Sigma <- quad_form_diag(Omega, sigma);

The variable Sigma may be defined as a local variable in the model block or as a transformed parameter. An even more efficient transform would use Cholesky factors rather than full correlation matrix types.

Scheduled Removal: Stan 3.0 or later.

Deprecated Functions

Several built-in Stan functions have been deprecated. Consult the functions reference for more information.

Back to top