On Jul 7, 2014, at 6:17 PM, Tymoteusz Wołodźko <
t.wol...@ibe.edu.pl> wrote:
> OK, I thought so, but didn't find clear confirmation of that in manual and was a little bit confused. In the manual there are also some mentions on that "not everything" is yet vectorized, so it can add up to confusion.
>
Sorry it's confusing.
The manual says after presenting the vectorized form:
"The main difference is that the vectorized form is much faster."
I guess I need to more clear about what the other differences are. The
example is complicated due to matrix arithmetic, which is only defined
for vector and matrix types.
But we're going to change the presentation eventually so at least this issue
shouldn't be a problem, starting with the vectorized version then presenting
the unvectorized one as an equivalent semantically but slower alternative.
In the lists of functions and distributions in the manual, the pseudo-types
"reals" and "ints" indicate what can be vectorized. There's a discussion of
the notation before the functions --- maybe we should point to it on every
function definition (hundreds of references), because it's come up before,
because obviously not everyone's going to read our manual cover-to-cover.
reals: real, 1D array of real, vector, row vector
ints: int, 1D array of int
There's also a discussion in the chapter on vectors and arrays as to what
the advantages are. For instance, using the vectorized exp() is no faster
than just using a loop, whereas vectorized sum() [and all the distributions]
are much faster in vectorized form for vectors with more than a few entries.
The point is whether we can speed things up with analytic derivatives.
- Bob