stan-dev/stan — pull request #663 by randommm (2014-05-22 05:12:59+00:00)
Title: Feature/issue 644 inv wishart rng

#### Summary:

Fix the problems pointed out in #644 inv_wishart_rng (which was actually coming from wishart_rng) for and also some additional improvements and fixes to (inv_)wishart_rng and (inv_)wishart_log:

- Make (inv_)wishart_log consider only the lower portion of the scale and outcome matrices. Notice that the current behaviour is to consider in some part of the code only the lower portion and in other parts of the code all the matrix.

- Add two special tests for (inv_)wishart_rng: one that comes from equation 1 here http://www.gwu.edu/~forcpgm/YuChengKu-030510final-WishartYu-ChengKu.pdf and another that checks the property pointed by the user who reported the bug.

#### Intended Effect:

Note that this pull request does not change the current behaviour of all these 4 function not checking if the scale and outcome matrix is symmetric, I prefer to leave this for other issue which would allow for some tolerance in asymmetric matrix as Bob Carpenter suggested.

#### How to Verify:

For, (inv_)wishart_log, looking a the changes and the fact that the existing tests still passes. For (inv_)wishart_rng, checking the correctness of the new tests added.

#### Side Effects:

None.

#### Documentation:

I made it a little more explicit that the scale and outcome matrices should be symmetric and positive-definite

#### Reviewer Suggestions: