glmdenoise.utils.make_poly_matrix module

glmdenoise.utils.make_poly_matrix.make_poly_matrix(n, degrees)[source]

Calculates a matrix of polynomials used to regress them out of your data

Parameters:
  • n (int) – number of points
  • degrees (array) – vector of polynomial degrees
Returns:

array of n x len(degrees)

Return type:

array

glmdenoise.utils.make_poly_matrix.make_project_matrix(X)[source]

Calculates a projection matrix

Parameters:X (array) – design matrix
Returns:Projection matrix size of X.shape[0] x X.shape[0]
Return type:array
glmdenoise.utils.make_poly_matrix.select_noise_regressors(r2_nrs, pcstop=1.05)[source]

How many components to include

Parameters:
  • r2_nrs (ndarray) – Model fit value per solution
  • pcstop (float, optional) – Defaults to 1.05.
Returns:

Number of noise regressors to include

Return type:

int