py4sci

Table Of Contents

Previous topic

backend Package

Next topic

eegtopo

This Page

builtin Package

builtin Package

binica Module

scot.builtin.binica.binica(data)

Simple wrapper for the binica program.

BINICA is bundled with EEGLAB, or can be downloaded from here:
http://sccn.ucsd.edu/eeglab/binica/
scot.builtin.binica.check_binary(binary)

check if binary is available, and try to obtain it if not

pca Module

principal component analysis (PCA) implementation

scot.builtin.pca.pca(x, subtract_mean=False, normalize=False, sort_components=True, reducedim=None, algorithm=<function pca_eig at 0x7fd35c0d8d40>)
pca( x, subtract_mean=False,
normalize=False, sort_components=True, retain_variance=None, algorithm=pcaEIG ):

calculate principal component analysis (PCA).

scot.builtin.pca.pca_eig(x)

calculate PCA as eigenvalues of the covariance (observations in rows)

scot.builtin.pca.pca_svd(data)

calculate PCA from SVD (observations in rows)

utils Module

scot.builtin.utils.cartesian(arrays, out=None)

Generate a cartesian product of input arrays.

Parameters:

arrays : list of array-like

1-D arrays to form the cartesian product of.

out : ndarray

Array to place the cartesian product in.

Returns:

out : ndarray

2-D array of shape (M, len(arrays)) containing cartesian products formed of input arrays.

References

http://stackoverflow.com/a/1235363/3005167

Examples

>>> cartesian(([1, 2, 3], [4, 5], [6, 7]))
array([[1, 4, 6],
       [1, 4, 7],
       [1, 5, 6],
       [1, 5, 7],
       [2, 4, 6],
       [2, 4, 7],
       [2, 5, 6],
       [2, 5, 7],
       [3, 4, 6],
       [3, 4, 7],
       [3, 5, 6],
       [3, 5, 7]])

var Module

vector autoregressive (VAR) model implementation

class scot.builtin.var.VAR(model_order, delta=0, xvschema=<function multitrial at 0x7fd35c0cc5f0>)

Bases: scot.var.VARBase

Represents a vector autoregressive (VAR) model.

Note on the arrangement of model coefficients:
b is of shape m, m*p, with sub matrices arranged as follows:
b_00 b_01 ... b_0m b_10 b_11 ... b_1m .... .... .... b_m0 b_m1 ... b_mm

Each sub matrix b_ij is a column vector of length p that contains the filter coefficients from channel j (source) to channel i (sink).

fit(data)

Fit the model to data.

optimize(data)

Optimize the var model’s hyperparameters (such as regularization).

optimize_delta_bisection(data, skipstep=1)

Use the bisection method to find optimal regularization parameter delta.

Behavior of this function depends on the xvschema attribute.