rampedpyrox.calc_L_curve¶
-
rampedpyrox.
calc_L_curve
(model, timedata, ax=None, plot=False, nOm=150, om_max=100.0, om_min=0.001)[source]¶ Function to calculate the L-curve for a given model and timedata instance in order to choose the best-fit smoothing parameter, omega.
Parameters: - model (rp.Model) –
rp.Model
instance containing the A matrix to use for L curve calculation. - timedata (rp.TimeData) –
rp.TimeData
instance containing the time and fraction remaining arrays to use in L curve calculation.
Keyword Arguments: - ax (None or matplotlib.axis) –
Axis to plot on. If None and
plot = True
, automatically creates amatplotlip.axis
instance to return. Defaults to None. - plot (Boolean) – Tells the method to plot the resulting L curve or not.
- om_min (int) – Minimum omega value to search. Defaults to 1e-3.
- om_max (int) – Maximum omega value to search. Defaults to 1e2.
- nOm (int) – Number of omega values to consider. Defaults to 150.
Returns: - om_best (float) – The calculated best-fit omega value.
- axis (None or matplotlib.axis) –
If
plot = True
, returns an updated axis handle with plot.
Raises: ScalarError
– If om_max or om_min are not int or float.ScalarError
– If nOm is not int.
See also
Daem.calc_L_curve()
- Instance method for
calc_L_curve
.
References
- [1] D.C. Forney and D.H. Rothman (2012) Inverse method for calculating
- respiration rates from decay time series. Biogeosciences, 9, 3601-3612.
- [2] P.C. Hansen (1987) Rank-deficient and discrete ill-posed problems:
- Numerical aspects of linear inversion (monographs on mathematical modeling and computation). Society for Industrial and Applied Mathematics.
- [3] P.C. Hansen (1994) Regularization tools: A Matlab package for analysis
- and solution of discrete ill-posed problems. Numerical Algorithms, 6, 1-35.
- model (rp.Model) –