phys2cvr.stats.regression

phys2cvr.stats.regression(data, regr, denoise_mat=None, ortho_mat=None, extra_mat=None, mask=None, r2model='full', debug=False, x1D='mat.1D')[source]

Estimate regression parameters.

Parameters:
datanp.ndarray

4D dependent variable (Y).

regrnp.ndarray

Regressor of interest.

denoise_matnp.ndarray or None, optional

Confounding effects (regressors)

ortho_matnp.ndarray or None, optional

Confounding effects (regressors) which will be orthogonalised with respect to regr, denoise_mat, and extra_mat

extra_matnp.ndarray or None, optional

Extra factors (regressors) that will be used to orthogonalise ortho_mat

masknp.ndarray or None, optional

A 3D mask to reduce the number of voxels to run the regression for.

r2model{full, partial, intercept, adj_full, adj_partial, adj_intercept}, optional

R^2 model the regression should return (and hence used for lag selection). Potentially invariant if no orthogonalisation is introduced, will change results with orthogonalisations. See stats.ols help for more details. Default: full

debugbool, optional

If True, save regressor matrices. Default is False.

x1Dstr, optional

Filename for debug export. Default is ‘mat.1D’.

Returns:
np.ndarray

Beta map

np.ndarray

T-stat map

np.ndarray

R^2 map

Raises:
ValueError

If denoise_mat and regr do not have at least one common dimension.