This is an old version, view current version.

13.10 Brackets array syntax

Before Stan 2.26, arrays were declared by writing syntax after the variable. As of version 2.26, the old syntax has been deprecated and replaced with a keyword-based syntax.

Deprecated: The use of array declarations like

int n[5];
real a[3, 4];
real<lower=0> z[5, 4, 2];
vector[7] mu[3];
matrix[7, 2] mu[15, 12];
cholesky_factor_cov[5, 6] mu[2, 3, 4];

Replacement: The use of the array keyword, which replaces the above examples with

array[5] int n;
array[3, 4] real a;
array[5, 4, 2] real<lower=0> z;
array[3] vector[7] mu;
array[15, 12] matrix[7, 2] mu;
array[2, 3, 4] cholesky_factor_cov[5, 6] mu;

Scheduled Removal: Stan 2.32