# Greeners Roadmap: Paridade com statsmodels
Este documento mapeia todas as funcionalidades do statsmodels (v0.14) e compara com o estado atual do Greeners. Serve como guia permanente para implementacoes futuras โ consulte-o no inicio de cada sessao.
**Ultima atualizacao:** 2026-02-02
---
## 1. Regression (statsmodels.regression)
| OLS | `sm.OLS` | `OLS` | โ
| HC1-HC4, NeweyWest, Clustered, TwoWay |
| WLS | `sm.WLS` | `WLS` | โ
| Interface dedicada com pesos explicitos |
| GLS | `sm.GLS` | `FGLS` | โ
| |
| GLSAR | `sm.GLSAR` | `GLSAR` | โ
| GLS com erros AR |
| RecursiveLS | `RecursiveLS` | `RecursiveLS` | โ
| Minimos quadrados recursivos |
| RollingOLS | `RollingOLS` | `RollingOLS` | โ
| OLS com janela movel |
| RollingWLS | `RollingWLS` | `RollingWLS` | โ
| WLS com janela movel |
| QuantReg | `QuantReg` | `QuantileReg` | โ
| |
## 2. Generalized Linear Models (statsmodels.genmod)
| GLM | `sm.GLM` | `GLM` | โ
| Gaussian, Binomial, Poisson, Gamma, InvGaussian, Tweedie, NegBin |
| Links | 10+ | 10 | โ
| Identity, Log, Logit, Probit, InvPower, InvSq, CLogLog, Power, NegBin, Cauchy |
| GEE | `GEE` | `GEE` | โ
| Exchangeable, AR(1), unstructured, independence |
| NominalGEE | `NominalGEE` | `NominalGEE` | โ
| Baseline-category logit |
| OrdinalGEE | `OrdinalGEE` | `OrdinalGEE` | โ
| Cumulative logit |
| GLMGam | `GLMGam` | `GLMGam` | โ
| GAM via penalized B-splines |
| BayesMixedGLM | `BinomialBayesMixedGLM` | `BayesMixedGLM` | โ
| Laplace approximation |
## 3. Discrete Choice (statsmodels.discrete)
| Logit | `Logit` | `Logit` | โ
| AME + MEM |
| Probit | `Probit` | `Probit` | โ
| AME + MEM |
| MNLogit | `MNLogit` | `MNLogit` | โ
| Softmax, RRR, predict_proba |
| OrderedModel | `OrderedModel` | `OrderedLogit`/`OrderedProbit` | โ
| Threshold reparametrization |
| Poisson (dedicado) | `Poisson` | `Poisson` | โ
| Overdispersion test, exposure, AME |
| NegativeBinomial | `NegativeBinomial` | `NegBin` | โ
| Profile likelihood alpha, LR test |
| NegativeBinomialP | `NegativeBinomialP` | `NegBinP` | โ
| NB1 (p=1), NB2 (p=2), flexible p |
| GeneralizedPoisson | `GeneralizedPoisson` | `GenPoisson` | โ
| Newton-Raphson MLE |
| ZeroInflatedPoisson | `ZeroInflatedPoisson` | `ZIP` | โ
| EM algorithm |
| ZeroInflatedNB | `ZeroInflatedNegativeBinomialP` | `ZINB` | โ
| EM algorithm |
| ConditionalLogit | `ConditionalLogit` | `ConditionalLogit` | โ
| Chamberlain conditional MLE |
| ConditionalPoisson | `ConditionalPoisson` | `ConditionalPoisson` | โ
| Hausman-Hall-Griliches |
| ConditionalMNLogit | `ConditionalMNLogit` | `ConditionalMNLogit` | โ
| Softmax conditional likelihood |
## 4. Time Series (statsmodels.tsa)
### 4.1 Modelos
| ARIMA/SARIMAX | `ARIMA`, `SARIMAX` | `ARIMA` | ๐ถ | Basico com seasonal; faltam exog completo, simulate, predict com IC |
| AutoReg | `AutoReg` | `AutoReg` | โ
| |
| ARDL | `ARDL` | `ARDL` | โ
| |
| ExponentialSmoothing | `ExponentialSmoothing` | `ExponentialSmoothing` | โ
| Holt-Winters (SES, Holt, HW additive/multiplicative) |
| ETSModel | `ETSModel` | โ | โ | Error-Trend-Seasonality framework completo |
| VAR | `VAR` | `VAR` | โ
| IRF, FEVD |
| VARMAX | `VARMAX` | `VARMA` | ๐ถ | Falta exog (o X do VARMAX) |
| VECM | `VECM` | `VECM` | โ
| |
| SVAR | `SVAR` | `SVAR` | โ
| VAR Estrutural |
| DynamicFactor | `DynamicFactor` | `DynamicFactorModel` | โ
| DFM / dynamic factor |
| UnobservedComponents | `UnobservedComponents` | `UnobservedComponents` | โ
| Local level, trend, seasonal |
| MarkovRegression | `MarkovRegression` | `MarkovSwitching` | โ
| Regime switching |
| MarkovAutoregression | `MarkovAutoregression` | `MarkovAutoregression` | โ
| Markov com componente AR |
### 4.2 Volatility Models (arch package)
| GARCH(p,q) | `arch_model(vol='GARCH')` | `GARCH` | โ
| Normal + Student-t, BFGS optimizer |
| ARCH(q) | `arch_model(vol='ARCH')` | `GARCH` (p=0) | โ
| Caso especial de GARCH(0,q) |
| EGARCH | `arch_model(vol='EGARCH')` | `EGARCH` | โ
| Normal + Student-t, log-variance |
| GJR-GARCH | `arch_model(vol='GARCH', o=1)` | `GJRGARCH` | โ
| Normal + Student-t, leverage effect |
| FIGARCH | `arch_model(vol='FIGARCH')` | โ | โ | Fractionally integrated GARCH |
| APARCH | `arch_model(vol='APARCH')` | โ | โ | Asymmetric Power ARCH |
| HARCH | `arch_model(vol='HARCH')` | โ | โ | Heterogeneous ARCH |
| ConstantVariance | `ConstantVariance` | โ | โ | Baseline/benchmark |
| SkewStudent | `SkewStudent` | โ | โ | Distribuicao skew-t |
| GED | `GeneralizedError` | โ | โ | Distribuicao generalizada de erros |
### 4.3 State Space Framework
| MLEModel | `MLEModel` | โ | โ | Framework generico (Kalman filter) โ base para DynamicFactor, UC |
| KalmanFilter | `KalmanFilter` | `KalmanFilter` | โ
| Filtro de Kalman basico |
| KalmanSmoother | `KalmanSmoother` | `KalmanSmoother` | โ
| RTS smoother |
| StateSpaceModel | `MLEModel` | `StateSpaceModel` | โ
| Estimacao via MLE |
| Simulation smoother | `SimulationSmoother` | โ | โ | |
### 4.4 Testes e Ferramentas de Series Temporais
| ADF | `adfuller` | `TimeSeries::adf` | โ
| |
| KPSS | `kpss` | `TimeSeries::kpss` | โ
| |
| Phillips-Perron | `PhillipsPerron` | `TimeSeries::phillips_perron` | โ
| Z(alpha), Z(t) with Newey-West |
| Zivot-Andrews | `zivot_andrews` | `TimeSeries::zivot_andrews` | โ
| Structural break unit root |
| Engle-Granger coint | `coint` | `TimeSeries::engle_granger` | โ
| |
| Johansen coint | `coint_johansen` | `TimeSeries::johansen` | โ
| |
| Granger causality | `grangercausalitytests` | `TimeSeries::granger_causality` | โ
| |
| Ljung-Box | `acorr_ljungbox` | `TimeSeries::ljung_box` | โ
| |
| ACF | `acf` | `TimeSeries::acf` | โ
| |
| PACF | `pacf` | `TimeSeries::pacf` | โ
| |
| seasonal_decompose | `seasonal_decompose` | `Decomposition` | โ
| Additive + multiplicative |
| STL | `STL` | `TimeSeries::stl` | โ
| LOESS-based decomposition |
| MSTL | `MSTL` | `MSTL` | โ
| Multi-seasonal STL |
| HP filter | `hpfilter` | `TimeSeries::hp_filter` | โ
| Hodrick-Prescott |
| BK filter | `bkfilter` | `TimeSeries::bk_filter` | โ
| Baxter-King |
| CF filter | `cffilter` | `TimeSeries::cf_filter` | โ
| Christiano-Fitzgerald |
| IRF | `irf` (no VAR result) | `VarResult::irf` | โ
| Impulse Response Functions |
| FEVD | `fevd` (no VAR result) | `VarResult::fevd` | โ
| Forecast Error Variance Decomposition |
| DeterministicProcess | `DeterministicProcess` | `TimeSeries::deterministic_process` | โ
| Const, trend, seasonal, fourier |
| lagmat | `lagmat` | `TimeSeries::lagmat` | โ
| Lag matrix construction |
## 5. Robust Regression (statsmodels.robust)
| RLM | `sm.RLM` | `RLM` | โ
| Huber, Bisquare, Andrews, Hampel |
| Norms (Huber, Tukey, etc.) | `norms` | `RobustNorm` | โ
| 4 norms implemented |
## 6. Mixed/Multilevel Models
| MixedLM | `MixedLM` | `MixedLM` | โ
| Random intercepts, REML |
| BayesMixedGLM | `BayesMixedGLM` | `BayesMixedGLM` | โ
| Laplace approximation |
| BetaModel | `BetaModel` | `BetaModel` | โ
| Beta regression |
## 7. Multivariate (statsmodels.multivariate)
| PCA | `PCA` | `PCA` | โ
| Eigendecomposition, scree, loadings |
| Factor Analysis | `Factor` | `FactorAnalysis` | โ
| Principal axis factoring, rotation |
| MANOVA | `MANOVA` | `MANOVA` | โ
| Wilks, Pillai, Hotelling, Roy |
| Canonical Correlation | `CanCorr` | `CanCorr` | โ
| SVD-based, Wilks' Lambda, F-test |
## 8. Nonparametric (statsmodels.nonparametric)
| KDEUnivariate | `KDEUnivariate` | `KDEUnivariate` | โ
| Gaussian, Epanechnikov, Silverman/Scott |
| KDEMultivariate | `KDEMultivariate` | `KDEMultivariate` | โ
| Product kernel, Silverman per-dim |
| KernelReg | `KernelReg` | `KernelReg` | โ
| Nadaraya-Watson |
| Lowess | `lowess` | `Lowess` | โ
| Local weighted regression |
## 9. Duration/Survival (statsmodels.duration)
| Kaplan-Meier | `SurvfuncRight` | `KaplanMeier` | โ
| Survival function, CI |
| Cox PH | `PHReg` | `CoxPH` | โ
| Proportional hazards |
## 10. Imputation (statsmodels.imputation)
| MICE | `MICE` | `MICE` | โ
| Chained equations with OLS |
| BayesGaussMI | `BayesGaussMI` | `BayesGaussMI` | โ
| Conditional normal imputation |
## 11. Diagnostics & Specification Tests
| Jarque-Bera | `jarque_bera` | `Diagnostics::jarque_bera` | โ
|
| Breusch-Pagan | `het_breuschpagan` | `Diagnostics::breusch_pagan` | โ
|
| Durbin-Watson | `durbin_watson` | `Diagnostics::durbin_watson` | โ
|
| VIF | `variance_inflation_factor` | `Diagnostics::vif` | โ
|
| Condition Number | `np.linalg.cond` | `Diagnostics::condition_number` | โ
|
| Leverage | `OLSInfluence` | `Diagnostics::leverage` | โ
|
| Cook's D | `OLSInfluence` | `Diagnostics::cooks_distance` | โ
|
| White test | `het_white` | `SpecificationTests::white_test` | โ
|
| RESET | `linear_reset` | `SpecificationTests::reset_test` | โ
|
| Breusch-Godfrey | `acorr_breusch_godfrey` | `SpecificationTests::breusch_godfrey` | โ
|
| Goldfeld-Quandt | `het_goldfeldquandt` | `SpecificationTests::goldfeld_quandt` | โ
|
| AIC/BIC | `.aic`, `.bic` | `ModelSelection` | โ
|
| Ljung-Box | `acorr_ljungbox` | `TimeSeries::ljung_box` | โ
|
| ARCH test | `het_arch` | `TimeSeries::arch_test` | โ
|
| Omnibus | `omni_normtest` | `Diagnostics::omnibus` | โ
|
| Harvey-Collier | `linear_harvey_collier` | `Diagnostics::harvey_collier` | โ
| t-test on recursive residuals |
| DFBetas | `OLSInfluence` | `Influence::dfbetas` | โ
| Per-observation influence |
| DFFITS | `OLSInfluence` | `Influence::dffits` | โ
| Per-observation influence |
| CUSUM | `OLSInfluence` | `CUSUMTest` | โ
| Recursive CUSUM + bounds |
| Wald test | `.wald_test()` | `OlsResult::wald_test` | โ
|
| F test | `.f_test()` | `OlsResult::f_test` | โ
|
| t test (restricoes) | `.t_test()` | `OlsResult::t_test` | โ
|
## 12. Results & Output
| `.summary()` | completo | `Display` trait | ๐ถ | Falta summary2, LaTeX, HTML |
| `.predict()` | com CI | `predict()` | โ
| IC via get_prediction |
| `.get_prediction()` | com SE e IC | `get_prediction()` | โ
| OLS, GLM, Poisson, NegBin |
| `.conf_int()` | em todos os modelos | `conf_int()` | โ
| OLS, GLM, ARIMA, Poisson, NegBin |
| `summary_col` | tabela comparativa | `SummaryCol` | โ
| Side-by-side model comparison |
| Export LaTeX | `summary().as_latex()` | โ | โ | |
| Export HTML | `summary().as_html()` | โ | โ | |
| Export CSV | `summary().as_csv()` | โ | โ | |
## 13. Formula System
| `y ~ x1 + x2` | patsy | `Formula` | โ
|
| `C(var)` categoricals | patsy | `C()` | โ
|
| `I(x^2)` transforms | patsy | `I()` | โ
|
| Interactions `x1*x2` | patsy | `*` | โ
|
| `x1:x2` (sem main) | patsy | โ | โ |
| `poly(x, 3)` | patsy | โ | โ |
| `bs(x)` B-splines | patsy | โ | โ |
| `np.log(x)` transforms | patsy | โ | โ |
## 14. Stats & Distributions (statsmodels.stats)
| `DescrStatsW` | descriptive stats com pesos | `DescrStatsW` | โ
| Weighted mean, var, std, CI, t-test |
| `CompareMeans` | testes de medias | `Stats::compare_means` | โ
| Welch t-test, Cohen's d, CI |
| `anova_lm` | ANOVA | `Stats::anova_oneway` | โ
| One-way ANOVA + regression ANOVA |
| `multipletests` | correcao de multiplos testes | `MultipleTests` | โ
| Bonferroni, FDR, Holm |
| `diagnostic` (varios) | Anderson-Darling, Lilliefors, etc. | `Diagnostics` | โ
| Anderson-Darling, Lilliefors |
| `proportion` | testes de proporcao | `Proportion` | โ
| One-sample and two-sample tests |
| `weightstats` | estatisticas ponderadas | `DescrStatsW` | โ
| Via descrstatsw module |
| `moment_helpers` | skew, kurtosis | โ | โ |
| `sandwich_covariance` | HAC, kernel covariance | parcial | ๐ถ | NeweyWest existe em CovarianceType |
| `stattools` | varios testes | parcial | ๐ถ | ADF, KPSS, PP, ZA |
## 15. Datasets (statsmodels.datasets)
| Datasets embutidos | ~30 datasets | `Datasets` | โ
| Longley, Macrodata, Sunspots, etc. |
---
## Funcionalidades do Greeners SEM equivalente no statsmodels
Estas sao vantagens competitivas do Greeners (via linearmodels ou proprias):
| Panel Fixed Effects | `FixedEffects` | โ (usa linearmodels) |
| Panel Random Effects | `RandomEffects` | โ |
| Between Estimator | `BetweenEstimator` | โ |
| Arellano-Bond | `ArellanoBond` | โ |
| Panel Threshold | `PanelThreshold` | โ |
| Hausman Test | `HausmanTest` | โ |
| SUR | `SUR` | โ (parcial em statsmodels) |
| 3SLS | `ThreeSLS` | โ |
| IV/2SLS | `IV` | โ (usa linearmodels) |
| DiD | `DiffInDiff` | โ |
| GMM | `GMM` | โ (usa gmm package) |
| Bootstrap | `Bootstrap` | โ (manual) |
| Binary auto-detection | `Column` | โ |
| Type safety (Rust) | nativo | โ |
---
## O que falta (โ) โ Prioridades
### Alta prioridade
1. **ARIMA melhorias** โ exog completo, simulate, predict com IC (๐ถ โ โ
)
2. **VARMAX** โ adicionar exog ao VARMA (๐ถ โ โ
)
3. **Export** LaTeX / HTML / CSV de resultados
4. **Formulas avancadas** โ `x1:x2`, `poly()`, `bs()`, `log()`
### Media prioridade
5. **ETSModel** โ Error-Trend-Seasonality framework (nota: `ExponentialSmoothing` jรก cobre SES, Holt e Holt-Winters)
6. ~~**DynamicFactor** โ Dynamic Factor models~~ โ
7. ~~**UnobservedComponents** โ Local level, trend, seasonal~~ โ
8. ~~**MarkovAutoregression** โ Markov com AR~~ โ
9. ~~**MSTL** โ Multi-seasonal STL~~ โ
10. ~~**multipletests** โ Bonferroni, FDR, Holm~~ โ
11. ~~**proportion** โ testes de proporcao~~ โ
### Baixa prioridade (nice-to-have)
12. **MLEModel generico** โ Framework state space unificado
13. **SimulationSmoother**
14. **moment_helpers** โ skew, kurtosis centralizados
15. **FIGARCH, APARCH, HARCH** โ variantes GARCH adicionais
16. **SkewStudent, GED** โ distribuicoes adicionais para GARCH
17. **summary2** โ LaTeX/HTML summaries avancados