Repository navigation
Conversation
| raise ValueError('only t and normal for now' ) | ||
|
|
||
| center = endog.mean(0) | ||
| std = endog.std(0, ddof=1) |
There was a problem hiding this comment.
center and std computation need to handle weights and use options, e.g. for robust estimators
| raise ValueError('only t and normal for now' ) | ||
|
|
||
| self.center = self.endog.mean(0) | ||
| self.std = self.endog.std(0, ddof=1) |
There was a problem hiding this comment.
same as above
center and std computation need to handle weights and use options, e.g. for robust estimators
| if ax is None: | ||
| fig = plt.figure() | ||
| ax = fig.add_subplot(111) | ||
| if np.isscalar(self.upp) or True: |
| return fig | ||
|
|
||
| class ControlChartEWMAMvMean(ControlChartMean): | ||
| """T2 control chart for multivariate mean |
|
I think the vectorized ControlChartMean should have an option to plot the t-statistic instead of raw values, so that the mean and control limits are the same (similar to T2 chart). heteroscedasticity: e.g. different number of observations in x-bar chart t-values should be standardized "effect" size, i.e. related parameter uncertainty: The usual control charts and the current implementation ignore parameter uncertainty, i.e. mean and std are assumed known or estimated from a large sample during phase 2 evaluation. |
|
thought about robust estimation:
related aside: do we get e.g. control chart using OLS: OLS with just a constant as exog and using get_prediction should be pretty much equivalent to the basic mean chart, and will be extendable to explanatory variables e.g. calender effects. phase 2 evaluation would be OLS out-of-sample prediction error and prediction ( |
|
related: connection to GLM interesting aside https://en.wikipedia.org/wiki/Control_chart#Alternative_bases |
|
What are the required methods to modularize this and let subclasses overwrite for the specific case? e.g. How can we have a class that doesn't use data, i.e. only phase 2 for fixed given parameters. plot_chart in ControlChartMvMean and ControlChartEWMAMvMean use in analogy to model/results classes, we would have
|
|
ASIDE: "If all you have are nails, then everything looks like a hammer" What do we do about pandas integration? e.g. currently I use and index in plot that is just np.arange. pandas support would provide the user index. x, xbar, p, c, u and similar charts follow the same assumptions as OLS, WLS, GLM, Poisson, ... aside in the aside: In ETS (efficient trimmed squares) #452 we do something similar. Estimate a candidate model on a subset, then "test" which other observations in the remaining sample are inliers given the estimates based on the subsample. Can we define CUSUM and EMWA for out of sample observations, similarly to the corresponding control charts? CUSUM and EMWA assume an ordering in the observations, which we don't have or use in the models outside of tsa (with some exceptions like autocorrelation in OLS diagnostic or HAC cov_type). OLS outlier_test is insample, i.e. uses data from the model. GLM influence and outliers is also all designed for insample data. another aside in the aside: out of sample evaluation criteria would also be useful for cross-validation, e.g. we don't have loglike/loglike_obs in general for out-of sample data. i.e. they always use the endog, exog attached to the model. Nevertheless, we still want to get explicit control charts in the same way as I would like to get the 1, 2 and k-sample hypothesis tests and confidence intervals into statsmodels (those are largely special cases of GLM, but with extras like power calculation and more methods for small samples, and more convenient to use when a full model is overkill.) (We need a collection of hammers for nails with different sizes. :) |
|
default for alpha alpha / 2 average run for two sided test |
adding by getting started with control charts script from #4191 to stats.control_charts
example converted to notebook is at https://gist.github.com/josef-pkt/f97874ca89237e78a505392803f6b40a