You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mainly an idea while thinking of k-sample goodness of fit tests and plots:
can we plot several data series on the same qq or pp plot?
one application would be if we have several series, by category for example
another application would be a k sample comparison where the reference distribution is the edf of the pooled sample.
If it doesn't I screwed up that PR. At the very least, you've exposed a major documentation deficiency where the plotkwargs aren't actually the standards kwargs a typical matplotlib user might expect to be passed to ax.plot(...).
There is something wrong with getting ppplot with fit=False
In the above plot, the data is individually loc scale corrected, so we don't see samples that are location or scale shifted.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/1297#issuecomment-31739474
.
I only made two changes to the source, fixing quantiles typo and adding step option
@@ -185,11 +185,11 @@ class ProbPlot(object):
@cache_readonly
def sample_percentiles(self):
quantiles = \
(self.sorted_data - self.fit_params[-2])/self.fit_params[-1]
- return self.dist.cdf(qntls)
+ return self.dist.cdf(quantiles)
def ppplot(self, xlabel=None, ylabel=None, line=None, other=None,
ax=None, **plotkwargs):
"""
P-P plot of the percentiles (probabilities) of x versus the
@@ -702,11 +702,11 @@ def _fmt_probplot_axis(ax, dist, nobs):
rotation_mode='anchor',
horizontalalignment='right',
verticalalignment='center')
ax.set_xlim([axis_qntls.min(), axis_qntls.max()])
-def _do_plot(x, y, dist=None, line=False, ax=None, fmt='bo'):
+def _do_plot(x, y, dist=None, line=False, ax=None, fmt='bo', step=False):
"""
Boiler plate plotting function for the `ppplot`, `qqplot`, and
`probplot` methods of the `ProbPlot` class
Parameteters
@@ -729,11 +729,14 @@ def _do_plot(x, y, dist=None, line=False, ax=None, fmt='bo'):
ax : Matplotlib AxesSubplot instance (see Parameters)
"""
fig, ax = utils.create_mpl_ax(ax)
ax.set_xmargin(0.02)
- ax.plot(x, y, fmt)
+ if not step:
+ ax.plot(x, y, fmt)
+ else:
+ ax.step(x, y, fmt, where='post')
if line:
if line not in ['r','q','45','s']:
msg = "%s option for line not understood" % line
raise ValueError(msg)
Activity
josef-pkt commentedon Jan 6, 2014
@phobson Any idea how difficult this would be to implement?
phobson commentedon Jan 6, 2014
In the current master, you can do something like this:
Does that cover your use cases or do I misunderstand?
josef-pkt commentedon Jan 6, 2014
Thanks, yes that does it - except it doesn't work (using master)
Did you run it?
Did we forget to merge something?
The ppplot below is exactly what I had in mind:
phobson commentedon Jan 6, 2014
I didn't get a chance to run it. I'm not at a machine where I can run master at the moment.
The following should work:
If it doesn't I screwed up that PR. At the very least, you've exposed a major documentation deficiency where the
plotkwargsaren't actually the standards kwargs a typical matplotlib user might expect to be passed toax.plot(...).So I owe you a PR to fix that.
josef-pkt commentedon Jan 6, 2014
Ok,
**plotkwargsare**unpacked. I would prefer them packed as in your exampletypo on line 190
self.dist.cdf(quantiles)is misspelled in masterrelated: I'm using now `fmt='s-' which adds a line, but maybe a step function would be interesting.
maybe it gets too close to ECDF plots.
I was again looking for references to add confidence intervals to the plots, but it's still not yet clear to me what needs to be done.
The articles I'm looking at use step plots, similar to kaplan-meier plots.
josef-pkt commentedon Jan 6, 2014
actually we got test failures on the merge
https://launchpadlibrarian.net/161734555/buildlog_ubuntu-raring-amd64.statsmodels_0.6.0~ppa18~revno-1520~ubuntu13.04.1_UPLOADING.txt.gz
I need to enable one TravisCI test that has matplotlib.
josef-pkt commentedon Jan 6, 2014
a quick try just adding
stepas additional keyword to_do_plothttps://picasaweb.google.com/106983885143680349926/Joepy#5965921015956964514
edit 2015-01-13
updated link https://picasaweb.google.com/106983885143680349926/Joepy?noredirect=1#5965921015956964514
I haven't looked at the correct
stepoptions yet, to get the symbols on the upper edge of the stepjosef-pkt commentedon Jan 6, 2014
There is something wrong with getting ppplot with fit=False
In the above plot, the data is individually loc scale corrected, so we don't see samples that are location or scale shifted.
forcing fit_params = (0, 1) gives me this plot, which shows clear differences and that they are not from the parameterized distribution N(0, 1)
https://picasaweb.google.com/106983885143680349926/Joepy#5965930448408216082
edit 2015-01-13
updated link https://picasaweb.google.com/106983885143680349926/Joepy?noredirect=1#5965930448408216082
josef-pkt commentedon Jan 7, 2014
line 136 fit is called even if fit=False
line 189: quantiles use fit_params, which are not the default (0, 1) because of above
josef-pkt commentedon Jan 7, 2014
two more variations, with pointwise confidence intervals
https://picasaweb.google.com/106983885143680349926/Joepy#5966152154485158946
https://picasaweb.google.com/106983885143680349926/Joepy#5966152154437212114
phobson commentedon Jan 7, 2014
any chance you can post nbviewer links for the code that you're using to
make these plots?
On Tue, Jan 7, 2014 at 6:06 AM, Josef Perktold [email protected]:
josef-pkt commentedon Jan 7, 2014
oops, I'm using IDLE right now :)
I still need to look more into the confidence interval question.
here is my dirty script, based on your code:
I only made two changes to the source, fixing quantiles typo and adding
stepoptionjosef-pkt commentedon Jan 9, 2014
#1307 includes another addition to probplots
josef-pkt commentedon Jun 28, 2018
question on confint for ECDF:
https://stats.stackexchange.com/questions/353475/confidence-bounds-for-an-ecdf
https://stats.stackexchange.com/questions/298290/plotting-non-parametric-ecdef-confidence-envelopes-for-comparison
the second refers to a R package and function that might be useful for unit tests