flâneur — a map of the web's best reading

Matrices, Vectors, Arrays, and Tuples

mc-stan.org · 2,507 words · saved by 1 readers

This chapter provides pointers as to how to choose among the various container types (matrix, vector, array, and tuple) provided by Stan. Stan provides three basic scalar types, int, real, and complex, as well as three basic linear algebra types, vector, row_vector, and matrix. Stan allows arrays of any dimensionality, containing any type of element (though that type must be declared and must be the same for all elements). This leaves us in the awkward situation of having three one-dimensional containers, as exemplified by the following declarations. These distinctions matter. Matrix types, like vector and row vector, are required for linear algebra operations. There is no automatic promotion of arrays to vectors because the target, row vector or column vector, is ambiguous. Similarly, row vectors are separated from column vectors because multiplying a row vector by a column vector produces a scalar, whereas multiplying in the opposite order produces a matrix. The following code fragme

Matrices, Vectors, Arrays, and Tuples Matrices, Vectors, Arrays, and Tuples This chapter provides pointers as to how to choose among the various container types (matrix, vector, array, and tuple) provided by Stan. Basic motivation Stan provides three basic scalar types, int , real , and complex , as well as three basic linear algebra types, vector , row_vector , and matrix . Stan allows arrays of any dimensionality, containing any type of element (though that type must be declared and must be the same for all elements). This leaves us in the awkward situation of having three one-dimensional co

Explore this link on the map →

related reading