This thread is for collecting various hindrances that people have encountered when trying to contribute to Stan for the first time in order to motivate better introductory materials. These can include, but are not limited to, undocumented or poorly-documented patterns, confusing style choices, and the like.
As an example, here are some comments that @Lu.Zhang made after working through the code for the first time.
I think there are three important skills for one to be a good coder for Stan:
The first is to know where I can find the function I need in Stan math library;
How it is coded in Stan; and How to use it in oneās own code. (Q1 & Q2)
The second is to understand functions specifically defined in Stan and learn how
to use them. (Q3 & Q4)
The third is to have a profound knowledge about programming in C++. (Q5 & Q6)
I made a small test out of the questions I had in the process of learning Stan code.
Hope this could help you to prepare for the interview.
- Whatās the difference and relationship between the following codes:
lib/eigen_3.2.9/Eigen/src/Cholesky/LLT.h
lib/eigen_3.2.9/Eigen/src/Cholesky/LDLT.h
lib/eigen_3.2.9/Eigen/src/Cholesky/LLT_MKL.h
stan/math/prim/mat/fun/cholesky_decompose.hpp
stan/math/prim/mat/fun/LDLT_factor.hpp
2.a) What is the most efficient way to calculate a multiplication of a lower-
triangular Cholesky factor with a vector? (No need to calculate determinant);
b)Try to list the least functions needed for checking error.
- When to use āVectorViewMvtā and āVectorViewā?
- When to use ātypedefs.hppā? What is the usage of āpartials_type.hppā?
stan_math/fwd/mat/fun/typedefs.hpp
stan_math/fwd/scal/meta/partials_type.hpp
5.What is the function of ādynamicā in the following definition of Matrix?
using Eigen::Dynamic;
Matrix<double,Dynamic,2> coord2(1000, 2)
6.Try to input two 1000 by 4 matrics A and B, and a 4 by 4 matrix C from a text file,
then use functions in stan library or any other available library to calculate: A + B *C^-1.