# bug #55860: [octave forge] (statistics) possible bug in wishrnd.m

 Submitted by: None Submitted on: Fri 08 Mar 2019 03:24:00 AM UTC Category: Octave Forge Package Severity: 3 - Normal Priority: 5 - Normal Item Group: Incorrect Result Status: Fixed Assigned to: None Originator Name: Originator Email: -email is unavailable- Open/Closed: Closed Release: 4.4.1 Operating System: Any

## Post a Comment

Add a New Comment

You are not logged in

Please log in, so followups can be emailed to you.

## Discussion

Sun 14 Apr 2019 11:01:04 AM UTC, comment #4:

Closing as fixed

John Donoghue <lostbard>
Fri 12 Apr 2019 07:24:38 PM UTC, comment #3:

statictics 1.4.1 has been released with changes in wishrnd

John Donoghue <lostbard>
Tue 12 Mar 2019 04:34:06 PM UTC, comment #2:

I edited wishrnd in the repository in response to this bug, please see if that fixes the issue.

Nir Krakauer <nir_krakauer>
Tue 12 Mar 2019 04:13:30 PM UTC, comment #1:

Do you have any examples that illustrate the wrong result ?

John Donoghue <lostbard>
Fri 08 Mar 2019 03:24:00 AM UTC, original submission:

For a non-integer df, the current code is:

Z = diag(sqrt(chi2rnd(df - (0:(p-1))))); #fill diagonal
Z(ii > jj) = randn(p*(p-1)/2, 1); #fill lower triangle with normally distributed variates
Z = D * Z;
W(:, :, i) = Z*Z';

However, D is provided by chol(), which by default produces upper triangular matrices. So, the order of multiplications should be:
Z = Z * D;
W(:, :, i) = Z' * Z;

To take into account the changed order, the Z matrix should have its upper triangle filled with normally distributed variates, instead of the lower triangle:
Z(ii < jj) = randn(p*(p-1)/2, 1);

Anonymous

## Attached Files

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Comment:

No files currently attached

## Dependencies

Depends on the following items: None found

Items that depend on this one: None found

## Mail Notification Carbon-Copy List

Carbon-Copy List
• -email is unavailable- added by nir_krakauer (Posted a comment)
• -email is unavailable- added by lostbard (Posted a comment)
•

## Votes

Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only project members can vote.

## History

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2019-04-14 lostbard StatusReady For Test Fixed
Open/ClosedOpen Closed
2019-04-12 lostbard StatusNone Ready For Test
2019-03-08 mtmiller Summarypossible bug in wishrnd.m (statistics package) [octave forge] (statistics) possible bug in wishrnd.m

Powered by Savane 3.4