On 7/29/13 2:47 PM, Ben Goodrich wrote:
> On Monday, July 29, 2013 2:41:16 PM UTC-4, Bob Carpenter wrote:
>
> A lot of code gets touched by the declared data types and I
> haven't added one in ages, so needed to refresh myself on
> the layout anyway.
>
>
> In which case, we probably need a wiki page on adding data types.
:-) It'll have to get in line behind the other doc projects
in the works (like the Stan paper, RStan paper and auto-diff doc,
all of which I'd rather do first). None of the relevant code is
documented conceptually, so this would require
documenting the readers, writers and transforms as a basis.
It's probably a higher priority to document how to write a distribution,
too. That's a lot more complicated with the vectorization.
You can find the places where code needs to go by grepping for
cov_matrix.
First I have to finish testing the square case. Then I'll try
to get the non-square case working.
> Another thing that we need is the Cholesky factor such that
>
> |
> L * L'
> |
>
> is a correlation matrix. Attached is a R function that does so in the square case so that it doesn't get lost.
We'll need to work out the Jacobian.
And the non-square case if you want that.
We'll also need a name for the correlation matrix case when I get
around to coding it. Should we anticipate this type and adopt
a suitable naming convention to begin with for the cov case?
cholesky_factor_rectangular_cov[M,N]
cholesky_factor_cov[M]
cholesky_factor_rectangular_corr[M,N]
cholesky_factor_corr[M]
I'm still not sure about overloading the syntax for square and
rectangular versions --- I'm worried it'll be confusing.
This might all have to wait until after 2.0 --- it's turning
into a huger project than the couple of days I anticipated.
I was hoping to also get to the lp__ replacement, but maybe that
and correlation matrices Cholesky factors can wait until after 2.0.
I was also hoping to get forward-mode auto-diff done for 2.0,
but that's probably also going to have to wait.
- Bob