freealg.AlgebraicForm.support#
- AlgebraicForm.support(scan_range=None, n_scan=1024, refine=True, resplit_density=16, merge_threshold=0.0, thr_rel=0.0001, min_log_width_mult=1.0, return_info=False, **kwargs)#
Estimate the spectral edges of the density.
- Parameters:
- scan_rangetuple, default=None
A range
(x_min, x_max)on the real axis to scan for the spectral edge points. If None, an interval is considered is used based on an initial broad support guess from the minimum and maximum of the eigenvalues.- n_scanint, default=1024
Number of points to scan along the
scan_rangeinterval.- refinebool, default=True
Refine each detected edge by a safeguarded Newton solve of the local threshold-crossing equation.
- resplit_densityint, default=16
Densification factor used to re-check each coarse run for touching bulks that may be missed by the coarse scan.
- merge_thresholdfloat, default=0.0
Merge adjacent detected bulks if the gap is smaller than this value. In log mode it is measured in log-x.
- thr_relfloat, default=1e-4
Linear-mode relative threshold. In log mode the threshold is selected automatically from the data.
- min_log_width_multfloat, default=1.0
Minimum accepted run width in units of log-grid spacing.
- return_infobool, default=False
If True, debug info is also returned.
- Returns:
- supportlist of tuples
A list
[(a1, b1), ..., (ak, bk)].
See also
Notes
Support is a list of tuples
[(a_1, b_1), ..., (a_k, b_k)]where each represent a bulk interval \(I_j = (a_j, b_j)\). The support of the absolutely-continuous part of the density is then\[I = \bigcup_{j=1}^k I_j\]The points \(a_j\) and \(b_j\) are the spectral edges. Spectral edges are part of the branch points of the spectral curve (see
branch_points()).There are two support variables used in the
freealg.AlgebraicFormclass:The
self.suppattribute which is given by the user throughsupportargument when creating the class object.The
self.est_supp, which is estimated from the fitted polynomial through this function (support()). All downstream computations such as decompression, deformation, etc, uses this variable.
Examples
>>> # Create a distribution with two bulks >>> from freealg.distributions import CompoundFreePoisson >>> cfp = CompoundFreePoisson(t=[2.0, 5.5], w=[0.75, 0.25], ... lam=0.1) >>> # Find the exact support using the distribution (no fitting) >>> supp = cfp.support() >>> print(supp) [(0.9984996249062267, 3.13165791447862), (4.157389347336835, 7.597674418604652)] >>> # Create AlgebraicForm and fit the distribution >>> from freealg import AlgebraicForm >>> af = AlgebraicForm(cfp) >>> af.fit(deg_m=3, deg_z=1) >>> # Estimate the support (using the fitted polynomial) >>> est_supp = af.support() >>> print(est_supp) [(1.0055181596689498, 3.1256892314391664), (4.162723779878648, 7.595354543299085)]