Mathematica Asked on February 7, 2021
Does anyone know if its possible to plot a confidence band in QuantilePlot
? I haven’t been able to find any documentation for this, or a previous example on here.
At the moment the only way I can think of doing this is via simulation or bootstrapping, which I’d like to avoid.
I’ve made an attempt based in some of the resources posted in the comments. This give a simultaneous confidence band:
n = 64;
X = RandomVariate[NormalDistribution[0, 1], n];
μ = Mean[X];
σ = StandardDeviation[X];
α = 0.05 (* For a 100(1-α)% simultaneous confidence band *)
k = Sqrt[Log[2/α]/(2 n)] (* Good when n > 35 *)
Show[
{
QuantilePlot[X, NormalDistribution[Mean[X], StandardDeviation[X]],ImageSize->Automatic->200, LabelStyle->12, PlotStyle->Red],
ListPlot[Table[{x, InverseCDF[NormalDistribution[μ, σ], 1/Length[X] Length[Select[X, # <= x &]] - k]}, {x, X}], PlotRange->All],
ListPlot[Table[{x, InverseCDF[NormalDistribution[μ, σ], 1/Length[X] Length[Select[X, # <= x &]] + k]}, {x, X}], PlotRange->All]
}, PlotRange->All
]
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP