{ } Raw JSON

bundles / scipy 1.18.0 / scipy / special / _orthogonal / hermitenorm

function

scipy.special._orthogonal:hermitenorm

source: /scipy/special/_orthogonal.py:1468

Signature

def hermitenorm(n, monic = False)

Summary

Probabilist's Hermite polynomial.

Extended Summary

Defined by

is a polynomial of degree .

Parameters

n : int

Degree of the polynomial.

monic : bool, optional

If True, scale the leading coefficient to be 1. Default is False.

Returns

He : orthopoly1d

Probabilist's Hermite polynomial.

Notes

The polynomials are orthogonal over with weight function .

Examples

import numpy as np
import matplotlib.pyplot as plt
from scipy.special import hermitenorm
✓
p_monic = hermitenorm(3)
p_monic
✓
poly1d([ 1.,  0., -3.,  0.])
Evaluate the probabilist's Hermite polynomial of degree 3 at x = 1:
p_monic(1)
✓
np.float64(-2.0)
Plot probabilist's Hermite polynomials of degree 0 to 4:
x = np.linspace(-3, 3, 100)
fig, ax = plt.subplots()
✓
for i in range(5):
    ax.plot(x, hermitenorm(i)(x), label=f"n={i}")
plt.title(f"Probabilist's Hermite polynomials $He_n$")
plt.xlabel("x")
plt.ylabel(rf"$He_n(x)$")
plt.legend(loc="best")
✗
<matplotlib.legend.Legend object at 0x7fa8f4057770>
plt.show()
✓
fig-d51a0a88159acadd.png

Aliases

  • scipy.special.hermitenorm