GithubHelp home page GithubHelp logo

hdr-boxplot's Introduction

https://circleci.com/gh/tupui/HDR-Boxplot.svg?style=svg

HDR-Boxplot

What is it?

This project implements the Functional highest density region boxplot technique [Hyndman2009]. When you have functional data, which is to say: a curve, you will want to answer some questions such as:

  • What is the median curve?
  • Can I draw a confidence interval?
  • Or, is there any outliers?

This module allows you to do exactly this:

data = np.loadtxt('data/elnino.dat')
print('Data shape: ', data.shape)

hdr_boxplot(data)

The output is the following figure:

data/hdr-boxplot.png

How does it work?

Behind the scene, the dataset is represented as a matrix. Each line corresponding to a 1D curve. This matrix is then decomposed using Principal Components Analysis (PCA). This allows to represent the data using a finit number of modes, or components. This compression process allows to turn the functional representation into a scalar representation of the matrix. In other words, you can visualize each curve from its components. This is called a bivariate plot:

data/bivariate_pca_scatter.png

This visualization exhibit a cluster of points. It indicate that a lot of curve lead to a common components. The center of the cluster is the mediane curve. An the more you get away from the cluster, the more the curve is unlikely to be similar to the other curves.

Using a kernel smoothing technique, the probability density function (PDF) of the 2D space can be recover. From this PDF, it is possible to compute the density probability linked to the cluster and plot its contours.

data/bivariate_pca.png

Finally, using these contours, the different quantiles are extracted allong with the mediane curve and the outliers.

Requirements

The dependencies are:

Acknowledgement

I am gratefull to the help and support on OpenTURNS Michaël Baudin has provided.

References

[Hyndman2009]Rob J Hyndman and Han Lin Shang. Rainb ow plots , bagplots and b oxplots for functional data. Journal of Computational and Graphical Statistics, 19:29-45, 2009

hdr-boxplot's People

Contributors

tupui avatar

Watchers

 avatar  avatar

Forkers

sofianehaddad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.