Skip to content

Commit

Permalink
Corrects equation display in plot_pce_sparsity_lars.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dimtsap committed Jul 27, 2023
1 parent 174d578 commit 7a5bd24
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/code/surrogates/pce/plot_pce_sparsity_lars.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
# %%

import numpy as np
import math
import numpy as np

from UQpy.distributions import Uniform, JointIndependent
from UQpy.surrogates import *


# %% md
#
# We then define the Ishigami function, which reads:
# :math:` f(x_1, x_2, x_3) = \sin(x_1) + a \sin^2(x_2) + b x_3^4 \sin(x_1)`
#
# .. math:: f(x_1, x_2, x_3) = \sin(x_1) + a \sin^2(x_2) + b x_3^4 \sin(x_1)

# %%

Expand All @@ -41,7 +41,7 @@ def ishigami(xx):

# %% md
#
# The Ishigami function has three indepdent random inputs, which are uniformly distributed in
# The Ishigami function has three independent random inputs, which are uniformly distributed in
# interval :math:`[-\pi, \pi]`.

# %%
Expand Down Expand Up @@ -70,7 +70,7 @@ def ishigami(xx):
#
# where :math:`N` is the number of random inputs (here, :math:`N=3`).
#
# Note that the size of the basis is highly dependent both on :math:`N` and :math:`P:math:`. It is generally advisable
# Note that the size of the basis is highly dependent both on :math:`N` and :math:`P`. It is generally advisable
# that the experimental design has :math:`2-10` times more data points than the number of PCE polynomials. This might
# lead to curse of dimensionality and thus we will utilize the best model selection algorithm based on
# Least Angle Regression.
Expand Down Expand Up @@ -102,8 +102,8 @@ def ishigami(xx):

# %% md
#
# We now fit the PCE coefficients by solving a regression problem. Here we opt for the _np.linalg.lstsq_ method,
# which is based on the _dgelsd_ solver of LAPACK. This original PCE class will be used for further selection of
# We now fit the PCE coefficients by solving a regression problem. Here we opt for the :code:`_np.linalg.lstsq_` method,
# which is based on the :code:`_dgelsd_` solver of LAPACK. This original PCE class will be used for further selection of
# the best basis functions.

# %%
Expand Down Expand Up @@ -238,7 +238,7 @@ def ishigami(xx):
# %% md
#
# In case of high-dimensional input and/or high :math:P` it is also beneficial to reduce the TD basis set by hyperbolic
# trunction. The hyperbolic truncation reduces higher-order interaction terms in dependence to parameter :math:`q` in
# truncation. The hyperbolic truncation reduces higher-order interaction terms in dependence to parameter :math:`q` in
# interval :math:`(0,1)`. The set of multi indices :math:`\alpha` is reduced as follows:
#
# :math:`\alpha\in \mathbb{N}^{N}: || \boldsymbol{\alpha}||_q \equiv \Big( \sum_{i=1}^{N} \alpha_i^q \Big)^{1/q} \leq P`
Expand Down

0 comments on commit 7a5bd24

Please sign in to comment.