src.lin_reg#
Linear regression module
Functions
|
Does the linear regression |
|
Assembles the Fourier coefficients from the sine and cosine terms generated in the |
- src.lin_reg.get_coeffs(fobj)#
Assembles the Fourier coefficients from the sine and cosine terms generated in the
Fourier transformer class
.Parameters#
- fobj
src.fourier.f_trans
instance instance of the Fourier transformer class.
Returns#
- array-like
2D array corresponding to the
M
matrix.
- fobj
- src.lin_reg.do(fobj, cell, lmbda=0.0, iter_solve=True, save_coeffs=False)#
Does the linear regression
Parameters#
- fobj
src.fourier.f_trans
instance instance of the Fourier transformer class.
- cell
src.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
- fobj