freealg.distributions.FreeLevy.density#
- FreeLevy.density(x=None, eta=0.0002, max_iter=100, tol=1e-12, return_atoms=False, plot=False, latex=False, save=False, eig=None)#
Density of distribution.
- Parameters:
- xnumpy.array, default=None
The locations where density is evaluated at. If None, an interval slightly larger than the support interval of the spectral density is used.
- etafloat, default=2e-4
The offset \(\eta\) from the real axis where the density is evaluated using Plemelj formula at \(z = x + i \eta\).
- max_iterint, default=100
Maximum number of Newton iterations to solve for the Stieltjes root.
- tolfloat, default=1e-12
Tolerance for Newton iterations to solve for the Stieltjes root.
- return_atomsbool, default=False
If True, the atoms (if any) of the distribution will also be returned.
- 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.- eignumpy.array, default=None
A collection of eigenvalues to compare to via histogram. This option is relevant only if
plot=True.
- Returns:
- rhonumpy.array
Absolutely-continuous part of the spectral density.
- if return_atoms is True:
- atomslist
A list of tuples
(loc, wight)containing the location and the weight of the atom.
Examples
>>> import numpy >>> from freealg.distributions import FreeLevy >>> # Create an object of the class >>> fl = FreeLevy(t=[2.0, 5.5], w=[0.75, 1-0.75], lam=0.1, a=0, ... sigma=0.9) >>> # Plot density >>> x = numpy.linspace(0, 2, 100) >>> rho, atoms = fl.density(x, return_atoms=True, plot=True)