src.lin_reg#

Linear regression module

Functions

do(fobj, cell[, lmbda, iter_solve, save_coeffs])

Does the linear regression

get_coeffs(fobj)

Assembles the Fourier coefficients from the sine and cosine terms generated in the Fourier transformer class.

src.lin_reg.get_coeffs(fobj)#

Assembles the Fourier coefficients from the sine and cosine terms generated in the Fourier transformer class.

Parameters#

fobjsrc.fourier.f_trans instance

instance of the Fourier transformer class.

Returns#

array-like

2D array corresponding to the M matrix.

src.lin_reg.do(fobj, cell, lmbda=0.0, iter_solve=True, save_coeffs=False)#

Does the linear regression

Parameters#

fobjsrc.fourier.f_trans instance

instance of the Fourier transformer class.

cellsrc.var.topo_cell instance

cell object instance

lmbdafloat, optional

regularisation parameter, by default 0.0

iter_solvebool, optional

toggles between using direct or iterative solver, by default True

save_coeffsbool, optional

skips the linear regression and just saves the generated M matrix for diagnostics and debugging, by default False

Returns#

a_mlist

list of Fourier amplitudes corresponding to the unknown vector in the linear problem

data_reconslike

vector-like topography reconstructed from a_m