Skip to main content

cubmods

Statistical package: CUB models for ordinal responses.

This package is a first Python implementation of statistical methods for the models of the class CUB, proposed by Professor Domenico Piccolo, 2003.

It contains inferential methods for each family of the class CUB (with or without covariates), basic graphical tools, and methods to draw random samples from given models.

It has been implemented by Massimo Pierini in 2024. It is mainly based upon the CUB package in R, maintened by Prof.ssa Rosaria Simone.


Requirements

The package requires numpy, pandas, scipy and statsmodels.

Notice that these requirements are automatically installed using pip (read Installation section).

Installation

The latest stable version of the package can be installed via pip with

pip install cubmods

Alternatively, you can install/update to the latest build directly from GitHub main branch, but this could be unnstable. First, you need to have git installed (see Install Git for detailed instructions for Windows, macOS and Linux). After installing git you'll need to restart your computer (to update the PATHs) and then you can install cubmods from GitHub with

pip install -U git+https://github.com/maxdevblock/cubmods.git@main

All these pip commands, can also be run in a Spyder 6.x IPython console. A conda environment is strongly suggested.

Basic usage

# import libraries
import matplotlib.pyplot as plt
from cubmods.gem import draw, estimate

# draw a sample
drawn = draw(formula="ordinal ~ 0 | 0",
             m=10, pi=.7, xi=.2,
             n=500, seed=1)
print(drawn.summary())
drawn.plot()
plt.show()

# inferential method on drawn sample
mod = estimate(
    df=drawn.df,
    formula="ordinal~0|0",
    m=10,
    ass_pars={"pi": .7, "xi":.2}
)
print(mod.summary())
mod.plot()
plt.show()

Read the Documentation for further details.

Documentation

The following is a preliminary Manual and Reference Sheet.

References

  • Piccolo D. (2003). On the moments of a mixture of uniform and shifted binomial random variables. Quaderni di Statistica, 5(1):85–104
  • D'Elia A. and Piccolo D. (2005). A mixture model for preferences data analysis. Computational Statistics & Data Analysis, 49(3):917–934
  • Capecchi S. and Piccolo D. (2017). Dealing with heterogeneity in ordinal responses, Quality and Quantity, 51(5), 2375--2393
  • Iannario M. and Piccolo D. (2016a). A comprehensive framework for regression models of ordinal data. Metron, 74(2), 233--252
  • Iannario M. and Piccolo D. (2016b). A generalized framework for modelling ordinal data. Statistical Methods and Applications, 25, 163--189
  • Manisera M, Zuccolotto P (2014a). Modeling “don’t know” responses in rating scales. Pattern Recognit Lett, 45:226–234
  • Piccolo D., Simone R. and Iannario M. (2019). Cumulative and CUB models for rating data: a comparative analysis. International Statistical Review, 87(2), 207-236
  • Piccolo D. and Simone R. (2019). The class of CUB models: statistical foundations, inferential issues and empirical evidence. Statistical Methods & Applications, 28, 389-435
  • Pierini M. (2024). Modelli della classe CUB in python. Bachelor's thesis L-41. Universitas Mercatorum, Rome, IT, 1–-79

Credits

@Author: Massimo Pierini

@Date: 2023-24

@ThanksTo: Domenico Piccolo, Rosaria Simone

@Contacts: cub@maxpierini.it

Release files for cubmods 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cubmods 0.0.3
File Size Uploaded
cubmods-0.0.3.tar.gz 5.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for cubmods 0.0.3
File Interpreter ABI Platform
cubmods-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 MB

Release files / cubmods-0.0.3.tar.gz

Download URL cubmods-0.0.3.tar.gz
Size 5.6 MB
Tags Source
SHA-256 checksum
How to use checksums
94976d78646aa26a00cea5723c33327f887330602f8dc912efd35066d81ab61c
BLAKE2b-256 checksum
How to use checksums
40c31ba80b973039327d5b76632446f2a2308283a05998780e97b351f326e302
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 9, 2025.

Transparency log

Release files / cubmods-0.0.3-py3-none-any.whl

Download URL cubmods-0.0.3-py3-none-any.whl
Size 130.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28e471e6faa29aa844a1a8eb8b2e7f61329e813216c7749138361627722f77e3
BLAKE2b-256 checksum
How to use checksums
4791def75782003bfada62d61298ea6226927ff5c9bc6914494fdf04a17ad2a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 9, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page