@@ -197,22 +197,95 @@ public static ComplexMatrixF centerInplace(ComplexMatrixF A) {
197
197
return A ;
198
198
}
199
199
200
+ /**
201
+ * Creates a standard-scored copy of matrix {@code A}, i.e., the values in
202
+ * each column of the copy have the mean of the corresponding column in
203
+ * {@code A} subtracted and are then scaled to the unit variance of this
204
+ * column by dividing the differences by the standard deviation of the
205
+ * column values. The result is the signed number of standard deviations
206
+ * (z-score) by which the value is above (below) the mean value of what is
207
+ * being measured in the corresponding column. Matrix {@code A} doesn't get
208
+ * mutated by this computation.
209
+ *
210
+ * @param A
211
+ * the matrix whose columns contain the observations to be
212
+ * z-scored
213
+ * @return a copy of A that has been z-scored
214
+ */
200
215
public static MatrixD zscore (MatrixD A ) {
201
216
return zscoreInplace (A .copy ());
202
217
}
203
218
219
+ /**
220
+ * Creates a standard-scored copy of matrix {@code A}, i.e., the values in
221
+ * each column of the copy have the mean of the corresponding column in
222
+ * {@code A} subtracted and are then scaled to the unit variance of this
223
+ * column by dividing the differences by the standard deviation of the
224
+ * column values. The result is the signed number of standard deviations
225
+ * (z-score) by which the value is above (below) the mean value of what is
226
+ * being measured in the corresponding column. Matrix {@code A} doesn't get
227
+ * mutated by this computation.
228
+ *
229
+ * @param A
230
+ * the matrix whose columns contain the observations to be
231
+ * z-scored
232
+ * @return a copy of A that has been z-scored
233
+ */
204
234
public static MatrixF zscore (MatrixF A ) {
205
235
return zscoreInplace (A .copy ());
206
236
}
207
237
238
+ /**
239
+ * Creates a standard-scored copy of matrix {@code A}, i.e., the values in
240
+ * each column of the copy have the mean of the corresponding column in
241
+ * {@code A} subtracted and are then scaled to the unit variance of this
242
+ * column by dividing the differences by the standard deviation of the
243
+ * column values. The result is the signed number of standard deviations
244
+ * (z-score) by which the value is above (below) the mean value of what is
245
+ * being measured in the corresponding column. Matrix {@code A} doesn't get
246
+ * mutated by this computation.
247
+ *
248
+ * @param A
249
+ * the matrix whose columns contain the observations to be
250
+ * z-scored
251
+ * @return a copy of A that has been z-scored
252
+ */
208
253
public static ComplexMatrixD zscore (ComplexMatrixD A ) {
209
254
return zscoreInplace (A .copy ());
210
255
}
211
256
257
+ /**
258
+ * Creates a standard-scored copy of matrix {@code A}, i.e., the values in
259
+ * each column of the copy have the mean of the corresponding column in
260
+ * {@code A} subtracted and are then scaled to the unit variance of this
261
+ * column by dividing the differences by the standard deviation of the
262
+ * column values. The result is the signed number of standard deviations
263
+ * (z-score) by which the value is above (below) the mean value of what is
264
+ * being measured in the corresponding column. Matrix {@code A} doesn't get
265
+ * mutated by this computation.
266
+ *
267
+ * @param A
268
+ * the matrix whose columns contain the observations to be
269
+ * z-scored
270
+ * @return a copy of A that has been z-scored
271
+ */
212
272
public static ComplexMatrixF zscore (ComplexMatrixF A ) {
213
273
return zscoreInplace (A .copy ());
214
274
}
215
275
276
+ /**
277
+ * Subtracts the mean of each column {@code j} from each value in that
278
+ * column {@code j} and then divides the difference by the standard
279
+ * deviation of the values in column {@code j}, effectively expressing the
280
+ * values in each column as the signed number of standard deviations
281
+ * (z-score) by which they are above or below the column's mean value. This
282
+ * is a destructive operation that changes matrix {@code A} inplace.
283
+ *
284
+ * @param A
285
+ * the matrix whose columns contain the observations to be
286
+ * z-scored
287
+ * @return the matrix {@code A} z-scored inplace
288
+ */
216
289
public static MatrixD zscoreInplace (MatrixD A ) {
217
290
int rows_ = checkNotRowVector (A );
218
291
int cols_ = A .numColumns ();
@@ -252,6 +325,19 @@ public static MatrixD zscoreInplace(MatrixD A) {
252
325
return A ;
253
326
}
254
327
328
+ /**
329
+ * Subtracts the mean of each column {@code j} from each value in that
330
+ * column {@code j} and then divides the difference by the standard
331
+ * deviation of the values in column {@code j}, effectively expressing the
332
+ * values in each column as the signed number of standard deviations
333
+ * (z-score) by which they are above or below the column's mean value. This
334
+ * is a destructive operation that changes matrix {@code A} inplace.
335
+ *
336
+ * @param A
337
+ * the matrix whose columns contain the observations to be
338
+ * z-scored
339
+ * @return the matrix {@code A} z-scored inplace
340
+ */
255
341
public static MatrixF zscoreInplace (MatrixF A ) {
256
342
int rows_ = checkNotRowVector (A );
257
343
int cols_ = A .numColumns ();
@@ -291,6 +377,19 @@ public static MatrixF zscoreInplace(MatrixF A) {
291
377
return A ;
292
378
}
293
379
380
+ /**
381
+ * Subtracts the mean of each column {@code j} from each value in that
382
+ * column {@code j} and then divides the difference by the standard
383
+ * deviation of the values in column {@code j}, effectively expressing the
384
+ * values in each column as the signed number of standard deviations
385
+ * (z-score) by which they are above or below the column's mean value. This
386
+ * is a destructive operation that changes matrix {@code A} inplace.
387
+ *
388
+ * @param A
389
+ * the matrix whose columns contain the observations to be
390
+ * z-scored
391
+ * @return the matrix {@code A} z-scored inplace
392
+ */
294
393
public static ComplexMatrixD zscoreInplace (ComplexMatrixD A ) {
295
394
int rows_ = checkNotRowVector (A );
296
395
int cols_ = A .numColumns ();
@@ -351,6 +450,19 @@ public static ComplexMatrixD zscoreInplace(ComplexMatrixD A) {
351
450
return A ;
352
451
}
353
452
453
+ /**
454
+ * Subtracts the mean of each column {@code j} from each value in that
455
+ * column {@code j} and then divides the difference by the standard
456
+ * deviation of the values in column {@code j}, effectively expressing the
457
+ * values in each column as the signed number of standard deviations
458
+ * (z-score) by which they are above or below the column's mean value. This
459
+ * is a destructive operation that changes matrix {@code A} inplace.
460
+ *
461
+ * @param A
462
+ * the matrix whose columns contain the observations to be
463
+ * z-scored
464
+ * @return the matrix {@code A} z-scored inplace
465
+ */
354
466
public static ComplexMatrixF zscoreInplace (ComplexMatrixF A ) {
355
467
int rows_ = checkNotRowVector (A );
356
468
int cols_ = A .numColumns ();
0 commit comments