dcegm.numerical_integration¶
Functions¶
|
Return the Hermite quadrature points and weights. |
|
Return the Gauss-Legendre quadrature points and weights. |
Module Contents¶
- dcegm.numerical_integration.quadrature_hermite(n_quad_points: int, income_shock_std: float) Tuple[numpy.ndarray, numpy.ndarray]¶
Return the Hermite quadrature points and weights.
It is the specific quadrature rule for the normal distribution. As it produces different numeric results than in the original dcegm paper, we leave it out for now.
- Parameters:
n_quad_points (int) – Number of quadrature points.
income_shock_std (float) – Standard deviation of the normal distribution.
- Returns:
- quad_points_scaled (np.ndarray): 1d array of shape (n_quad_points,)
containing the Hermite quadrature points.
- quad_weights (np.ndarray): 1d array of shape (n_quad_points,)
containing the associated Hermite quadrature weights.
- Return type:
tuple
- dcegm.numerical_integration.quadrature_legendre(n_quad_points: int) Tuple[jax.numpy.ndarray, jax.numpy.ndarray]¶
Return the Gauss-Legendre quadrature points and weights.
The stochastic Gauss-Legendre quadrature points are shifted points drawn from the [0, 1] interval.
- Parameters:
n_quad_points (int) – Number of quadrature points.
income_shock_std (float) – Standard deviation of the normal distribution.
- Returns:
- quad_points_normal (np.ndarray): 1d array of shape (n_quad_points,)
containing the Hermite quadrature points.
- quad_weights (np.ndarray): 1d array of shape (n_quad_points,)
containing the associated stochastic quadrature weights.
- Return type:
tuple