Exponential#

class skfda.misc.covariances.Exponential(*, variance=1, length_scale=1)[source]#

Exponential covariance function.

The covariance function is

\[K(x, x') = \sigma^2 \exp\left(-\frac{\|x - x'\|}{l}\right)\]

where \(\sigma^2\) is the variance and \(l\) is the length scale.

Heatmap plot of the covariance function:

from skfda.misc.covariances import Exponential
import matplotlib.pyplot as plt

Exponential().heatmap(limits=(0, 1))
plt.show()
../../../_images/skfda.misc.covariances.Exponential_0_0.png

Example of Gaussian process trajectories using this covariance:

from skfda.misc.covariances import Exponential
from skfda.datasets import make_gaussian_process
import matplotlib.pyplot as plt

gp = make_gaussian_process(
        n_samples=10, cov=Exponential(), random_state=0)
gp.plot()
plt.show()
../../../_images/skfda.misc.covariances.Exponential_1_0.png

Default representation in a Jupyter notebook:

from skfda.misc.covariances import Exponential

Exponential()
\[K(x, x') = \sigma^2 \exp\left(-\frac{||x - x'||}{l}\right) \\\text{where:}\begin{aligned}\qquad\sigma^2 &= 1 \\l &= 1 \\\end{aligned}\]
2024-04-04T21:41:56.662827 image/svg+xml Matplotlib v3.8.4, https://matplotlib.org/
2024-04-04T21:41:56.479057 image/svg+xml Matplotlib v3.8.4, https://matplotlib.org/

Methods

heatmap([limits])

Return a heatmap plot of the covariance function.

to_sklearn()

Convert it to a sklearn kernel, if there is one.

Parameters:
heatmap(limits=(-1, 1))[source]#

Return a heatmap plot of the covariance function.

Parameters:

limits (Tuple[float, float]) –

Return type:

Figure

to_sklearn()[source]#

Convert it to a sklearn kernel, if there is one.

Return type:

Kernel

Examples using skfda.misc.covariances.Exponential#

Magnitude-Shape Plot synthetic example

Magnitude-Shape Plot synthetic example

Outlier detection with FPCA

Outlier detection with FPCA

Getting the data

Getting the data