Repository navigation
ENH: qqplot - #4
ENH: qqplot #4chrisjordansquire wants to merge 8 commits into
Conversation
|
I think after correcting the change in args kwargs in the function body, this should be good to be merged Thanks Chris |
|
Ok. I think I've made all the changes you mentioned. Other than the axes one. (Which I think I still don't quite understand. I don't think I'm familiar enough with matplotlib, and I couldn't figure it out even after spending a bit of time on their man pages.) |
|
I looked at the examples in the doc strings again and realized the x-margins weren't always large enough. I fixed that, but now they're sometimes a little too large. I'm not sure how to find a good medium, short of scaling the x-limits manually. |
|
Unless there are other requests, though, I don't think I'm going to make any further changes. |
|
Sorry, I thought I was getting notifications on comments. Apparently not. If you want to get my attention, I think you need to do @jseabold. Don't hit the merge button. From what I understand it almost never does what you'd expect. See |
|
Um....I don't think I follow your comment skipper. Who was it directed to? |
|
Josef. He asked if he could just hit the merge button. |
|
I'm going to go ahead and apply this. I recall now where I left off with my version. It is recommended to use something like (i - a)/(nobs - 2a + 1) for the plotting positions of the theoretical quantiles where a = .5, .375 or 0 (attributed to Hazen, Blom and Gumbel and Weibull, respectively) rather than linspace. R has the function ppoints. This is so that the median gets a percentile rank of 50% and the tails are treated symmetrically I believe. I will make this change. I'm not sure I understand why we don't want to plot a reference line. I agree that it doesn't have to be a 45-degree line, but the whole point, IIUC, of a diagnostic plot is to compare against the reference line and see where the deviations occur. This could be achieved generically by scaling your end_pts I think. We can keep it optional, but we need to scale end_pts for it to work correctly in all cases I think. I'll post a patch for this too. Other than that looks good. Thanks for the patch. |
|
The main reason I don't want to automatically draw a reference line is that I don't know of a particularly good way to draw one that applies in all cases. The two immediate ones I can think of, drawing a line between the 25% and 75% points and fitting an OLS lines to it, both have their merits. And I've wanted each of them in different cases. |
|
Skipper, I think, if you add plotting positions, then we should make them a keyword choice, and fix scipy.stats probability plot in the same way (at least one ticket in scipy trac asks for it). Plotting positions should be in the sandbox, based on Pierre's version in scipy.stats.mstats and his climate/hydrology scikit. |
|
Either way, if you do line without fit, that surely isn't what you want. Ie., fig = sm.qqplot(res, line=True) I was thinking of changing end_pts in this case to something like end_pts = np.array(end_pts) Just so there is a sensible default. Thoughts? On Thu, Aug 25, 2011 at 1:27 PM, chrisjordansquire
|
|
In this case, the plotting positions are from np.linspace. Ie., the On Thu, Aug 25, 2011 at 1:38 PM, josef-pkt
|
|
Ah, yes, Pierre's is the same. On Thu, Aug 25, 2011 at 1:46 PM, Skipper Seabold [email protected] wrote:
|
|
I am going to close this and commit the pull request and then make my proposed patches. We can continue the discussion there on the commits. |
Fixes / typos / small improvements for PR-408.
* qqplot: BUG: Made x-margins larger ENH/BUGS: Added line, removed *args and *kwargs BUGS: removed *args and *kwargs Changed args; tests only run with matplotlib BUGS: Corrected a couple of minor bugs Added fit to qqplot DOC: Added a bit of docs ENH:qqplot against scipy.stats dist
Jarvis m branch
A qqplot function. It plots the quantiles of a data vector against the theoretical quantiles of a specified distribution. The user can either give specific parameters for this distribution or let python fit them automatically.