Skip to content

Function: splitScale() ​

ts
function splitScale(
   x, 
   fac, 
   center?, 
   scale?): 
  | NeuroVec<TypedArray>
  | SparseNeuroVec;

Defined in: src/stats/stats.ts:557

Scale a NeuroVec within factor levels.

Centers and/or scales the data within each level of a factor, returning a new NeuroVec with the transformed data.

Parameters ​

x ​

| NeuroVec<TypedArray> | SparseNeuroVec

The 4D data to scale

fac ​

| Float32Array<ArrayBufferLike> | Int32Array<ArrayBufferLike>

Factor array with length equal to number of volumes

center? ​

boolean = true

Whether to center (subtract mean) within each level

scale? ​

boolean = true

Whether to scale (divide by SD) within each level

Returns ​

| NeuroVec<TypedArray> | SparseNeuroVec

Scaled NeuroVec

Released under the MIT License.