.. only:: html
.. note::
:class: sphx-glr-download-link-note
Click :ref:`here ` to download the full example code
.. rst-class:: sphx-glr-example-title
.. _sphx_glr_auto_data_analysis_statistical_hypothesis_testing_plot_cramer_vonmises_test.py:
Cramer-Von Mises normality test
===============================
In this example we are going to evaluate whether a sample follows a normal distribution.
.. code-block:: default
from __future__ import print_function
import openturns as ot
import openturns.viewer as viewer
from matplotlib import pylab as plt
ot.Log.Show(ot.Log.NONE)
Generate a sample
.. code-block:: default
sample = ot.Normal().getSample(200)
Test normality
.. code-block:: default
test_result = ot.NormalityTest.CramerVonMisesNormal(sample)
print('Component is normal?', test_result.getBinaryQualityMeasure(),
'p-value=%.6g' % test_result.getPValue(),
'threshold=%.6g' % test_result.getThreshold())
.. rst-class:: sphx-glr-script-out
Out:
.. code-block:: none
Component is normal? True p-value=0.778876 threshold=0.05
.. rst-class:: sphx-glr-timing
**Total running time of the script:** ( 0 minutes 0.001 seconds)
.. _sphx_glr_download_auto_data_analysis_statistical_hypothesis_testing_plot_cramer_vonmises_test.py:
.. only :: html
.. container:: sphx-glr-footer
:class: sphx-glr-footer-example
.. container:: sphx-glr-download sphx-glr-download-python
:download:`Download Python source code: plot_cramer_vonmises_test.py `
.. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download Jupyter notebook: plot_cramer_vonmises_test.ipynb `
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery `_