freealg.AlgebraicForm.decompress#

AlgebraicForm.decompress(size, x=None, kind='free', method='moc', atom_eps=None, return_atoms=False, min_n_times=10, newton_opt={'armijo': 0.0001, 'max_iter': 50, 'min_lam': 1e-06, 'tol': 1e-12, 'w_min': 1e-14}, plot=False, latex=False, save=False, verbose=False)#

Free decompression of spectral density.

Parameters:
sizeint or array_like

Size(s) of the decompressed matrix. This can be a scalar or an array of sizes. For each matrix size in size array, a density is produced.

xnumpy.array, default=None

Positions where density to be evaluated at.

kind{'free', 'deformed'}, default= 'free'

The type of operation:

  • 'free': evolve the spectral curve using free decompression

  • 'deformed': evolve the spectral curve using deformed deformation.

method{'moc', 'coeffs'}, default= 'moc'

Method of decompression:

  • 'moc': Method of characteristics with Newton iterations.

  • 'coeffs': Evolving polynomial coefficients directly.

min_n_timesint, default=10

Minimum number of inner sizes to evolve.

newton_optdict

A dictionary of settings to pass to Newton iteration solver.

plotbool, default=False

If True, density is plotted.

latexbool, default=False

If True, the plot is rendered using LaTeX. This option is relevant only if plot=True.

savebool, default=False

If not False, the plot is saved. If a string is given, it is assumed to the save filename (with the file extension). This option is relevant only if plot=True.

verbosebool, default=False

If True, it prints verbose be bugging information.

Returns:
rhonumpy.array or numpy.ndarray

Estimated spectral density at locations x. rho can be a 1D or 2D array output:

  • If size is a scalar, rho is a 1D array of the same size as x.

  • If size is an array of size n, rho is a 2D array with n rows, where each row corresponds to decompression to a size. Number of columns of rho is the same as the size of x.

See also

density
edge
cusp

Notes

Free or deformed Decompression.

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)

>>> # Create AlgebraicForm and fit the distribution
>>> from freealg import AlgebraicForm
>>> af = AlgebraicForm(cfp)
>>> af.fit(deg_m=3, deg_z=1)

>>> # Plot the density of the fitted spectral curve
>>> import numpy
>>> x = numpy.linspace(0, 8, 500)
>>> y = numpy.linspace(-2, 2, 300)
>>> m = af.stieltjes(x, y, plot=True)