Create vector from a number range


Operating System: Mac
Interface Version: cmdstan-2.17.1
Compiler/Toolkit: g++

Hi, is there a built-in function in stan for creating a vector/array where you specify the minimum, maximum, and number of elements? I’m trying to achieve something similar to MATLAB’s linspace, or Python’s range functions.

Thank you


Only for consecutive integers (with the : operator) and you cannot yet assign it to a symbol.


Nope, but I created a stan-dev/math issue.

This is slightly different than the one Ben mentioned.