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 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تزوّد المهارة ببياناتك وتختار نوعاً من النماذج الإحصائية. ثم تحسب المهارة نتائج النموذج وتعطيك ملخصاً مفصلاً.
المحتوى التقني (ملف 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
…
الأسئلة الشائعة
ما هو النموذج الإحصائي؟
هو طريقة لتمثيل العلاقة بين أجزاء مختلفة من بياناتك باستخدام الرياضيات.
ماذا تعني «التشخيصات» (diagnostics)؟
تعني التحقق من أن النموذج الذي اخترته يناسب بياناتك فعلاً، وأن افتراضاته صحيحة.
ما هو «الاستدلال» (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يصمم تجارب توصيف البروتينات باستخدام Adaptyv API. يساعد في تقدير التكاليف وإرسال التسلسلات ومتابعة نتائج المختبر.
aeon
51kينفذ مهام تعلم الآلة على بيانات السلاسل الزمنية. وهو مفيد للتصنيف والتنبؤ وكشف الشذوذ وإيجاد الأنماط في البيانات المتسلسلة.
alphagenome
51kيبحث عن التأثيرات الجينومية المحسوبة مسبقًا للمتغيرات الوراثية. يقدم درجات وشروحات لفهم تأثير هذه المتغيرات على الجينوم.
مهارات مشابهة
pytorch-patterns
280kيساعد وكيلك على استخدام PyTorch في نماذج تعلم الآلة. يطبّق أفضل الممارسات لتدريب النماذج بكفاءة ويضمن نتائج قابلة للتكرار.
evm-token-decimals
280kيساعد وكيلك على تجنب أخطاء الأعداد العشرية عبر شبكات البلوكتشين المختلفة. يضمن دقة قيم الرموز في المعاملات والحسابات.
ito-inference
280kيتيح لوكيلك التحقق من توفر نماذج الذكاء الاصطناعي للاستخدام. يربط طلب الحوسبة بخدمة النموذج الجاهزة.