statsmodels
Что он делает
Этот инструмент помогает анализировать данные с помощью статистических моделей. Он может предсказывать результаты, проверять гипотезы и оценивать, насколько хорошо модель подходит к вашим данным.
Когда использовать
- ✓Когда нужно понять взаимосвязь между переменными.
- ✓Когда нужно предсказать будущее значение на основе исторических данных.
- ✓Когда хотите проверить, верна ли гипотеза о ваших данных.
Ссылка на скилл
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/statsmodels/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Проанализируй этот набор данных о продажах и спрогнозируй продажи на следующий месяц.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Вы передаете данные и выбираете тип статистической модели. Инструмент рассчитывает результаты модели и выдает подробную сводку.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Statsmodels: Statistical Modeling and Econometrics
Overview
Statsmodels provides estimation, inference and diagnostics for regression, time series and econometric models. A successful fit establishes numerical execution; causal identification, calibrated uncertainty and model adequacy require a defensible study design and assumptions.
Current Compatibility
Reviewed against statsmodels 0.15.0 (released August 27, 2026). Native checks used Python 3.13, NumPy 2.5.3, SciPy 1.18.1, pandas 3.0.6, matplotlib 3.11.2 and scikit-learn 1.9.1. Install in a dedicated environment:
uv pip install statsmodels==0.15.0 numpy==2.5.3 scipy==1.18.1 pandas==3.0.6 matplotlib==3.11.2 scikit-learn==1.9.1
Use statsmodels.api and statsmodels.formula.api for stable high-level imports, and direct module imports when examples require newer or specialized classes such as HurdleCountModel.
The review and source ledger records API coverage and verification limits. The quick start is executable; topic references are contextual fragments requiring the named data and a matching model result. In 0.15, use result_object=True and named fields for ADF/KPSS and other transitioning tests; prefer rng= where statsmodels formerly accepted seed or random_state.
When to Use This Skill
This skill should be used when:
- Fitting regression models (OLS, WLS, GLS, quantile regression)
- Performing generalized linear modeling (logistic, Poisson, Gamma, etc.)
- Analyzing discrete outcomes (binary, multinomial, count, ordinal)
- Conducting time series analysis (ARIMA, SARIMAX, VAR, forecasting)
- Running statistical tests and diagnostics
- Testing model assumptions (heteroskedasticity, autocorrelation, normality)
- Detecting outliers and influential observations
- Comparing models (AIC/BIC, likelihood ratio tests)
- Estimating causal effects
- Producing publication-ready statistical tables and inference
Quick Start, Capabilities, and Model Selection
- references/quick_start_guide.md: minimal worked examples for OLS, logistic regression, ARIMA, and GLM, and how to read the summary.
- references/modeling_capabilities.md: linear models, GLMs, discrete choice, time series, and the statistical tests and diagnostics.
- references/model_selection.md: the R-style formula API and model comparison.
- Per-topic detail: references/linear_models.md, references/glm.md, references/discrete_choice.md, references/time_series.md, and references/stats_diagnostics.md.
statsmodels supports inference and prediction, including forecasting. Match validation to the sampling design: grouped splits for repeated units, chronological splits for time series, and preprocessing learned on training data only.
Best Practices
Data Preparation
- Specify the intercept: Array OLS/GLM/Logit need an explicit constant; formula models include one by default. OrderedModel and ConditionalLogit must not receive a constant.
- Check for missing values: For array-based models, use
missing="raise"during construction to catch unexpected NaNs; the defaultmissing="none"does not check and can yield all-NaN estimates. If dropping rows is justified, record retained row IDs and compare models on the same observations. Fit any imputation on training data only. - Scale if needed: Can improve conditioning and convergence; record units and estimate scaling on training data
- Encode categoricals: Use formula API or manual dummy coding
Model Building
- Start simple: Begin with basic model, add complexity as needed
- Check assumptions: Test residuals, heteroskedasticity, autocorrelation
- Use appropriate model: Match model to outcome type (binary→Logit, count→Poisson)
- Consider alternatives: If assumptions violated, use robust methods or different model
Inference
- Report effect sizes: Not just p-values
- Use robust SEs: When heteroskedasticity or clustering present
- Multiple comparisons: Correct when testing many hypotheses
- Confidence intervals: Always report alongside point estimates
Model Evaluation
- Check residuals: Plot residuals vs fitted, Q-Q plot
…
Частые вопросы
Что такое статистическая модель?
Это способ описать взаимосвязь между разными частями данных с помощью математики.
Что означает 'диагностика'?
Это проверка того, насколько выбранная модель действительно подходит к вашим данным и выполняются ли её допущения.
Что такое 'вывод' (inference)?
Это заключения, которые можно сделать на основе данных и результатов модели, например оценки эффектов или степени неопределенности.
Подробности
Оригинальное описание автора
Fits and diagnoses Python statistical models including OLS, GLM, discrete and mixed models, ARIMA and SARIMAX. Supports coefficient inference, marginal effects, model comparison and time series forecasting with explicit design and uncertainty checks. Used for econometrics and statistical modeling; for guided test selection with APA reporting, see statistical-analysis.
Популярность
- Звёзды на GitHub
- 51k
- Место в рейтинге
- #3578
- Лицензия
- MIT
- Обновлён
- 15.10.2026
Комментарии
- …
Другие скиллы из этого репозитория
13c-metabolic-flux
51kОценивает метаболические потоки по данным изотопной метки углерода-13 для анализа клеточного метаболизма.
adaptyv
51kПланирует эксперименты по характеристике белков через API Adaptyv: стоимость, отправка последовательностей и результаты.
aeon
51kРешает задачи машинного обучения на временных рядах: классификация, прогноз, аномалии и паттерны.
alphagenome
51kНаходит заранее рассчитанные эффекты генетических вариантов с оценками и объяснениями.
Похожие скиллы
pytorch-patterns
280kПомогает агенту использовать PyTorch для моделей машинного обучения: эффективное обучение и воспроизводимые результаты.
evm-token-decimals
280kПомогает агенту избегать ошибок с десятичными знаками в разных блокчейн-сетях, чтобы суммы токенов были точными.
ito-inference
280kАгент проверяет доступность моделей ИИ и связывает запрос на вычисления с готовым сервисом модели.