Skip to content

Commit f38d2e3

Browse files
author
Paul Pavlidis
committed
fixes problem with studentized residuals
and a typo in RandomChooser
1 parent ddbb1d5 commit f38d2e3

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/ubic/basecode/math/RandomChooser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public static int[] chooserandomWrep( int max, int n ) {
154154
}
155155

156156
/**
157-
* Initialized the random number generator witha given seed.
157+
* Initialized the random number generator with a given seed.
158158
*
159159
* @param seed
160160
*/

src/ubic/basecode/math/linearmodels/LeastSquaresFit.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ public DoubleMatrix2D getResiduals() {
446446
}
447447

448448
/**
449-
* @return externally studentized residuals.
449+
* @return externally studentized residuals (assumes we have only one QR)
450450
*/
451451
public DoubleMatrix2D getStudentizedResiduals() {
452452
int dof = this.residualDof - 1; // MINUS for external studentizing!!
@@ -462,7 +462,8 @@ public DoubleMatrix2D getStudentizedResiduals() {
462462
/*
463463
* Diagnonal of the hat matrix at i (hi) is the squared norm of the ith row of Q
464464
*/
465-
DoubleMatrix2D q = qr.getQ();
465+
DoubleMatrix2D q = this.getQR( 0 ).getQ();
466+
466467
DoubleMatrix1D hatdiag = new DenseDoubleMatrix1D( residuals.columns() );
467468
for ( int j = 0; j < residuals.columns(); j++ ) {
468469
double hj = q.viewRow( j ).aggregate( Functions.plus, Functions.square );

0 commit comments

Comments
 (0)