uf3.regression.regularize.get_penalty_matrix_3D¶
- get_penalty_matrix_3D(L: int, M: int, N: int, ridge: float = 0.0, curvature: float = 1.0, periodic=(False, False, True)) numpy.ndarray[source]¶
- Generates additive regularization matrix for linear regression
using curvature penalty and/or L2 (ridge) penalty. Curvature penalty here applies to coefficients that are spatially related in three dimensions that may not be adjacent after flattening for linear least-squares
- Parameters
L (int) – length of coefficient matrix before flattening.
M (int) – width of coefficient matrix before flattening.
N (int) – depth of coefficient matrix before flattening.
ridge (float) – L2 (ridge) regularization strength.
curvature (float) – Local curvature regularization strength.
periodic (list) – periodicity in regularization for three dimensions. Default (False, False, True) for periodicity in angular space.
- Returns
- square penalty matrix for linear
least-squares of shape (L*M*N , L*M*N).
- Return type
matrix_3d (numpy.ndarray)