Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Plots a continuous distribution
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. func : Sympy expression, function, or str Univariate density function or a String for the scipy dist name. args : floats (optional) Arguments of the distribution if func was a String.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
else: elif callable(func): f = func else: assert len(func.free_symbols) <= 1, 'Must have exactly 1 variable' if len(func.free_symbols) == 0: new_symbol = symbols('x') replace_variables = [new_symbol] else: replace_variables = list(func.free_symbols) f = lambdify(replace_variables, func)
else:
""" Plots a 3d graph.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound of the x-axis. y_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound of the x-axis. f : bivariate function Joint density interactive : boolean (optional) If True, creates a widget to adjust elevation and azimuth. (default: False) kwargs Optional named arguments for `plot_surface`.
Returns ------- None
"""
elevation_slider = widgets.FloatSlider( value=20, min=0, max=90, step=1, description='elevation' ) azimuth_slider = widgets.FloatSlider( value=-100, min=-180, max=180, step=1, description='azimuth' )
@interact(elev=elevation_slider, azim=azimuth_slider) def wrapper(elev, azim): plot(elev, azim) else:
""" Plots an exponential distribution
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. lamb : float Rate.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a gaussian distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. mu : float Mean. sigma : float Standard Deviation.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots an arcsine distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a beta distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. a : float Shape. b : float Shape.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a cauchy distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a chi-squared distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. df : Integer Number of degrees of freedom.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots an erlang distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. r : int Shape. lamb : float Rate.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots an F distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. dfn : int Degree of freedom 1. dfd : int Degree of freedom 2.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a gamma distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. r : int Shape. lamb : float Rate.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a log-normal distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. mu : float Mean. sigma : float Standard Deviation.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots an alpha distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. a : float Shape.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a powerlaw distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. a : float Shape.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a rayleigh distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. sigma : float Scale.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a t distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. df : int Degree of freedom
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a triangular distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. a : float Minimum value. b : float Maximum value. c : float Intermediate value
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """
""" Plots a uniform distribution.
Parameters ---------- x_limits : iterable Array, list, or tuple of size 2, containing the lower and upper bound to be plotted. a : float Minimum value. b : float Maximum value.
Optional Named Parameters ------------------------- tails : boolean (optional) If True, left_end will shade from the lower bound up to left_end, and right_end will shade from right_end up to the upper bound. If False, left_end will shade to right_end. (Default: False) left_end : float (optional) Left side of event to be shaded. (Default: None) right_end : float (optional) Right side of event to be shaded. (Default: None) cdf : boolean (optional) If True and func was string, the cdf will be plotted (Default: False)
All pyplot named arguments (such as color) should work as well. See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Returns ------- None """ |