Jump to content

File:P-value vs SN.gif

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

P-value_vs_SN.gif (576 × 229 pixels, file size: 1.35 MB, MIME type: image/gif, looped, 101 frames)

Summary

Description
English: If one wants to decide if there is a signal hidden in the noise, the p-value will drop sharply around S/N=1, and then keep decreasing exponentially. In this example p=0.05 happens just before the curve tails to zero.
Date
Source https://twitter.com/j_bertolotti/status/1183715504185397248
Author Jacopo Bertolotti
Permission
(Reusing this file)
https://twitter.com/j_bertolotti/status/1030470604418428929

Mathematica 11.0 code

n = 5 10^3;
noise = RandomVariate[NormalDistribution[0, 1], {n}];
signal = Table[E^(-((x - n/2)^2/(2 (n/100)^2))), {x, 1, n}];
pvssn = Reap[For[a = 0, a <= 5, a = a + 0.05,
     data = a signal + noise;
     \[Chi]2 = Total[data^2];
     p = NIntegrate[PDF[ChiSquareDistribution[n], x], {x, \[Chi]2, \[Infinity]}];
     Sow[{a, p}];
     ];][[2, 1]]
p1 = Table[
   GraphicsRow[{
     ListPlot[pvssn[[j, 1]]*signal + noise, PlotRange -> All, Joined -> True, PlotStyle -> {Thick, Black}, LabelStyle -> {Black, Bold}, Axes -> False]
     ,
     ListPlot[pvssn[[1 ;; j]], Joined -> True, PlotStyle -> {Thick, Black}, LabelStyle -> {Black, Bold}, AxesLabel -> {"S/N", "p-value"}, PlotRange -> {{0, 5}, {0, 1}}]
     }, ImageSize -> Large, PlotLabel -> Style[StringForm["\!\(\*SubscriptBox[\(H\), \(0\)]\): the data is just Gaussian random noise.\nNull hypothesis rejected with p=``", ScientificForm[pvssn[[j, 2]], 3] ]], 
    LabelStyle -> {Black, Bold}]
   , {j, 1, Dimensions[pvssn][[1]], 1}];
ListAnimate[p1]

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Captions

P-value vs S/N

Items portrayed in this file

depicts

14 October 2019

image/gif

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current12:18, 16 October 2019Thumbnail for version as of 12:18, 16 October 2019576 × 229 (1.35 MB)BertoUser created page with UploadWizard
No pages on the English Wikipedia use this file (pages on other projects are not listed).

Metadata