Skip to main content

CircleCI Python License: LGPL v3

otHDRPlot

What is it?

This project implements the functional highest density region boxplot technique (Hyndman and Shang, 2009).

When you have functional data (i.e. a set of curves), you will want to answer some questions such as:

  • What is the mode curve?
  • Can I draw a confidence interval?
  • Or, is there any outlier curves?

This module allows you to do this:

import othdrplot
algo = othdrplot.ProcessHighDensityRegionAlgorithm(
    processSample, reducedComponents, reducedDistribution, [0.8, 0.5]
)
algo.run()
algo.drawOutlierTrajectories()
algo.draw()

The output is the following figure:

npfda-elnino

In the situation where a multivariate sample is given, the HighDensityRegionAlgorithm allows to plot the regions where the density is associated with a given fraction of the population.

import openturns
# Estimate the distribution
myks = ot.KernelSmoothing()
distribution = myks.build(sample)
# Create the HDR algorithm
algo = othdrplot.HighDensityRegionAlgorithm(sample, distribution)
algo.run()
algo.draw()

The output is the following figure:

gauss-mixture-OutlierPlot

How to install?

Requirements

The dependencies are:

Installation

Using the latest python version is prefered!

To install from pip:

pip install othdrplot

To install from github:

git clone git@github.com:mbaudin47/othdrplot.git
cd othdrplot
python setup.py install

Documentation

A short introduction to the algorithm is provided in the Introduction to high density region plots.

Examples

Several examples are available in the doc directory.

References

  • Rob J Hyndman and Han Lin Shang. Rainbow plots , bagplots and boxplots for functional data. Journal of Computational and Graphical Statistics, 19:29-45, 2009

Algorithms

Three classes are provided:

  • HighDensityRegionAlgorithm : An algorithm to draw the density of a multivariate sample.
  • ProcessHighDensityRegionAlgorithm : An algorithm to compute and draw the density of a multivariate process sample.
  • KarhunenLoeveDimensionReductionAlgorithm : Simplifies the dimension reduction with Karhunen-Loève decomposition.

The HighDensityRegionAlgorithm class

This is an algorithm to draw the density of a multivariate sample.

  • Compute the minimum levelset associated with the sample.
  • Plots the required minimum level sets and the outliers.
  • Compute and draw the inliers and the outliers, based on the MatrixPlot.
  • The main ingredient is distribution of the sample, which is required.

The basic method to estimate this distribution is kernel smoothing, but any other method can be used, such as a gaussian mixture for example.

The ProcessHighDensityRegionAlgorithm class

This is an algorithm to draw the density of a process sample.

  • Plots the trajectories in the physical space.
  • Plots the projection of the trajectories in the reduced space, based on the HighDensityRegionAlgorithm.
  • The main ingredients are the dimension reduction method and the method to estimate the density in the reduced space.

In the current implementation, the dimension reduction can be provided on the Karhunen-Loeve decomposition (but other methods can be used). The method to estimate the density in the reduced space can be the kernel smoothing estimator or any other density estimation method (e.g. a Gaussian mixture).

Metadata

Release files for othdrplot 2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for othdrplot 2.2
File Size Uploaded
othdrplot-2.2.tar.gz 5.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for othdrplot 2.2
File Interpreter ABI Platform
othdrplot-2.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 MB

Release files / othdrplot-2.2.tar.gz

Download URL othdrplot-2.2.tar.gz
Size 5.6 MB
Tags Source
SHA-256 checksum
How to use checksums
7ffa79643a85600ad1869dcb417fd990aeb91421cf096e773dfd1b33f76e02b9
BLAKE2b-256 checksum
How to use checksums
6db378332be67d1df4b54395ccca37cf318038b1f140c2a1390d3fd2d90ece3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release files / othdrplot-2.2-py3-none-any.whl

Download URL othdrplot-2.2-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
df5cf9cf73bdfe41fb19af5a01a15d55898020878b973a06f753026644b79b33
BLAKE2b-256 checksum
How to use checksums
3bc5420c6fc058150405262573be99a9d12d64be0399bd444a286b335bdf32d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

2.2 This release

2 release files

2.1

2 release files

2.0

2 release files

1.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page