Difference between revisions of "Lcurve.m"
m (Rename Arguments section heading to Parameters) |
(sync with Spinach main f053e432: argument constraints, lam_opt output, corner-criterion notes; canonical section layout) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:lcurve.m}} __NOTOC__ | {{DISPLAYTITLE:lcurve.m}} __NOTOC__ | ||
| + | L-curve analysis function. Returns the regularisation parameter at the point of the maximum curvature of the L-curve. | ||
| − | + | ==Syntax== | |
lam_opt=lcurve(lam,err,reg,mode) | lam_opt=lcurve(lam,err,reg,mode) | ||
| − | Parameters | + | ==Parameters== |
| − | lam - row vector of regularisation parameters | + | lam - row vector of regularisation parameters, must |
| + | be positive and in ascending order | ||
| − | err - row vector of least squares errors | + | err - row vector of least squares errors, must be |
| + | positive and increasing with lam | ||
| − | reg - row vector of regularisation functional values | + | reg - row vector of regularisation functional values, |
| + | must be positive and decreasing with lam. This | ||
| + | is the regularisation functional itself, not the | ||
| + | penalty term of the error functional: when the | ||
| + | optimiser reports lam*||L*x||^2, divide it by lam | ||
| + | once before calling this function | ||
mode - 'log' for logarithmic coordinates and 'linear' | mode - 'log' for logarithmic coordinates and 'linear' | ||
for linear ones; 'log' is recommended | for linear ones; 'log' is recommended | ||
| − | + | ==Outputs== | |
| + | lam_opt - the regularisation parameter at the point | ||
| + | of the maximum curvature of the L-curve | ||
| − | == | + | ==Notes== |
| − | + | The corner is the point of the greatest curvature, which for a smooth asymmetric bend is not the intersection of the asymptotes; the criterion locates the regularisation parameter to within a factor of a few and is not convergent in the zero noise limit (Vogel, SIAM J. Numer. Anal. 34, 1996). Treat the answer as an order of magnitude estimate and inspect the plotted curve. | |
| − | |||
| − | + | The curvature maximum must fall inside the sampled interval; if it falls on either end, the corner is outside the range and this function refuses to return the endpoint as an answer. | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| + | This function requires the Curve Fitting Toolbox. | ||
==See also== | ==See also== | ||
| − | [[tikhonov.m]], [[tikhoind.m]], [[ipcs.m]], [[Pseudocontact_shift_analysis | + | [[tikhonov.m]], [[tikhoind.m]], [[ipcs.m]], [[autoexec.m]], [[bos_product_table.m]], [[fft_freq_axis.m]], [[fwhm2rlx.m]], [[icm2hz.m]], [[ifft_time_axis.m]], [[intrep.m]], [[istraceless.m]], [[kq2lin.m]], [[kronm.m]], [[lin2kq.m]], [[min_int_type.m]], [[prune_subgraphs.m]], [[redfield_integral_async.m]], [[redfield_integral_serial.m]], [[repcols.m]], [[reprows.m]], [[serpentine.m]], [[st_product_table.m]], [[tikhol1n.m]], [[unihash.m]], [[which_subst.m]], [[xyz2hfc.m]], [[Kernel_utilities]], [[Pseudocontact_shift_analysis]] |
''Version 1.9, authors: [[Ilya Kuprov]]'' | ''Version 1.9, authors: [[Ilya Kuprov]]'' | ||
Latest revision as of 07:03, 30 August 2026
L-curve analysis function. Returns the regularisation parameter at the point of the maximum curvature of the L-curve.
Syntax
lam_opt=lcurve(lam,err,reg,mode)
Parameters
lam - row vector of regularisation parameters, must
be positive and in ascending order
err - row vector of least squares errors, must be
positive and increasing with lam
reg - row vector of regularisation functional values,
must be positive and decreasing with lam. This
is the regularisation functional itself, not the
penalty term of the error functional: when the
optimiser reports lam*||L*x||^2, divide it by lam
once before calling this function
mode - 'log' for logarithmic coordinates and 'linear'
for linear ones; 'log' is recommended
Outputs
lam_opt - the regularisation parameter at the point
of the maximum curvature of the L-curve
Notes
The corner is the point of the greatest curvature, which for a smooth asymmetric bend is not the intersection of the asymptotes; the criterion locates the regularisation parameter to within a factor of a few and is not convergent in the zero noise limit (Vogel, SIAM J. Numer. Anal. 34, 1996). Treat the answer as an order of magnitude estimate and inspect the plotted curve.
The curvature maximum must fall inside the sampled interval; if it falls on either end, the corner is outside the range and this function refuses to return the endpoint as an answer.
This function requires the Curve Fitting Toolbox.
See also
tikhonov.m, tikhoind.m, ipcs.m, autoexec.m, bos_product_table.m, fft_freq_axis.m, fwhm2rlx.m, icm2hz.m, ifft_time_axis.m, intrep.m, istraceless.m, kq2lin.m, kronm.m, lin2kq.m, min_int_type.m, prune_subgraphs.m, redfield_integral_async.m, redfield_integral_serial.m, repcols.m, reprows.m, serpentine.m, st_product_table.m, tikhol1n.m, unihash.m, which_subst.m, xyz2hfc.m, Kernel_utilities, Pseudocontact_shift_analysis
Version 1.9, authors: Ilya Kuprov