ArviZ: مكتبة مرنة وقابلة للتعديل للتحليل الاستكشافي للنماذج البايزية
ArviZ: a modular and flexible library for exploratory analysis of Bayesian models

شارك:
المجلة: The Journal of Open Source Software، المجلد: 11، العدد: 119
DOI: https://doi.org/10.21105/joss.09889
تاريخ النشر: 2026-03-06
المؤلف: Osvaldo A. Martin وآخرون
الموضوع الرئيسي: النمذجة البايزية والاستدلال السببي

نظرة عامة

تقدم هذه القسم نظرة عامة على نسخة معاد تصميمها من ArviZ، وهي حزمة بايثون تهدف إلى التحليل الاستكشافي لنماذج بايزي (EABM). تسلط الضوء على ضرورة معالجة مهام متنوعة تتجاوز الاستدلال في النمذجة البايزية، مثل تشخيص عينات سلسلة ماركوف مونت كارلو (MCMC)، ونقد النموذج، ومقارنة النماذج. يركز التصميم الجديد على تعزيز التحكم من قبل المستخدم والمرونة، مما يؤدي إلى مجموعة أدوات أكثر مرونة وكفاءة تهدف إلى خدمة الباحثين والممارسين بشكل فعال.

تؤكد بيان الحاجة على الأهمية المتزايدة للبرمجة الاحتمالية والطلب على أدوات قوية تدعم تصور عدم اليقين، وتشخيص العينات، وتقييم النماذج. يلبي ArviZ هذه الحاجة من خلال توفير مكتبة موحدة وغير مرتبطة بالخلفية التي تطورت منذ تصورها الأصلي في عام 2019. يتناول التصميم الجديد التحديات المتعلقة بتعقيد الأساليب البايزية الحديثة من خلال تقسيم قاعدة الشيفرة، مما يسمح بتحديثات وصيانة أسهل. لا تعمل هذه المرونة على تبسيط دمج ميزات جديدة—مثل حجم العينة الفعالة (ESS)، و$\hat{R}$، والتحقق المتقاطع بترك واحد (LOO)، ومقارنة النماذج—فحسب، بل تعزز أيضًا مساهمات المجتمع من خلال تمكين المطورين من العمل على مكونات محددة بشكل مستقل.

نقاش

في نظام بايثون البيزي، يلعب ArviZ دورًا حاسمًا مشابهًا للأدوات المعروفة في مجتمع R/Stan، مثل `posterior`، و`loo`، و`bayesplot`. منذ إطلاقه في عام 2019، حقق ArviZ جذبًا كبيرًا، كما يتضح من أكثر من 700 اقتباس و75 مليون تنزيل، ويهدف إلى تسهيل التحليل الاستكشافي لنماذج بايزي مع التكامل مع لغات البرمجة الاحتمالية المختلفة مثل PyMC وStan وPyro. لقد حفز تطور الحزمة مبادرات مثل ArviZ.jl لجوليا وPreliZ لجمع المعلومات السابقة، إلى جانب موارد تعليمية لتعزيز تفاعل المستخدمين.

لقد انتقل التصميم الجديد لـ ArviZ من هيكل أحادي إلى بنية معيارية، مما يسمح للمستخدمين بمزيد من التخصيص في التثبيت والوظائف. تشمل التحسينات الرئيسية اعتماد فئة `DataTree` من xarray لتحسين تنظيم البيانات ومرونة الإدخال والإخراج، إلى جانب تقديم واجهتين متميزتين للوظائف الإحصائية: واجهة مصفوفة منخفضة المستوى للمستخدمين المتقدمين وواجهة xarray عالية المستوى للمستخدمين العامين. كما تم تجديد قدرات الرسم لدعم عدة خلفيات، بما في ذلك matplotlib وBokeh وPlotly، مما أدى إلى تصميم أكثر كفاءة وقابلية للتوسع. لقد زادت البنية الجديدة من عدد الرسوم المضمنة إلى 37، مما يحسن بشكل كبير من قابلية الاستخدام مع الحفاظ على التركيز على المرونة وتجربة المستخدم.

Journal: The Journal of Open Source Software, Volume: 11, Issue: 119
DOI: https://doi.org/10.21105/joss.09889
Publication Date: 2026-03-06
Author(s): Osvaldo A. Martin et al.
Primary Topic: Bayesian Modeling and Causal Inference

Overview

The section presents an overview of a redesigned version of ArviZ, a Python package aimed at exploratory analysis of Bayesian models (EABM). It highlights the necessity of addressing various tasks beyond inference in Bayesian modeling, such as diagnosing Markov chain Monte Carlo (MCMC) samples, model criticism, and model comparison. The redesign focuses on enhancing user control and modularity, resulting in a more flexible and efficient toolkit that is positioned to serve both researchers and practitioners effectively.

The statement of need emphasizes the growing importance of probabilistic programming and the demand for robust tools that support uncertainty visualization, sampling diagnostics, and model evaluation. ArviZ fulfills this need by providing a unified, backend-agnostic library that has evolved since its original conception in 2019. The redesign addresses challenges related to the complexity of modern Bayesian methods by modularizing the codebase, allowing for easier updates and maintenance. This modularity not only streamlines the integration of new features—such as effective sample size (ESS), $\hat{R}$, leave-one-out cross-validation (LOO), and model comparison—but also fosters community contributions by enabling developers to work on specific components independently.

Discussion

In the Python Bayesian ecosystem, ArviZ serves a critical role akin to established tools in the R/Stan community, such as `posterior`, `loo`, and `bayesplot`. Since its launch in 2019, ArviZ has gained significant traction, evidenced by over 700 citations and 75 million downloads, and aims to facilitate exploratory analysis of Bayesian models while integrating with various probabilistic programming languages like PyMC, Stan, and Pyro. The package’s evolution has spurred initiatives like ArviZ.jl for Julia and PreliZ for prior elicitation, alongside educational resources to enhance user engagement.

The recent redesign of ArviZ has transitioned from a monolithic structure to a modular architecture, allowing users greater customization in installation and functionality. Key enhancements include the adoption of the `DataTree` class from xarray for improved data organization and I/O flexibility, alongside the introduction of two distinct interfaces for statistical functions: a low-level array interface for advanced users and a higher-level xarray interface for general users. The plotting capabilities have also been revamped to support multiple backends, including matplotlib, Bokeh, and Plotly, resulting in a more efficient and extensible design. The new architecture has increased the number of built-in plots to 37, significantly improving usability while maintaining a focus on modularity and user experience.

شارك: