CUB models for ordinal responses.
Project description
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.
- CUBmods’s documentation on ReadTheDocs
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cubmods-0.0.3.tar.gz
.
File metadata
- Download URL: cubmods-0.0.3.tar.gz
- Upload date:
- Size: 5.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94976d78646aa26a00cea5723c33327f887330602f8dc912efd35066d81ab61c |
|
MD5 | 32a5b9c03d8b3cea042387de452e87b1 |
|
BLAKE2b-256 | 40c31ba80b973039327d5b76632446f2a2308283a05998780e97b351f326e302 |
Provenance
The following attestation bundles were made for cubmods-0.0.3.tar.gz
:
Publisher:
python-publish.yml
on maxdevblock/cubmods
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
cubmods-0.0.3.tar.gz
- Subject digest:
94976d78646aa26a00cea5723c33327f887330602f8dc912efd35066d81ab61c
- Sigstore transparency entry: 179444730
- Sigstore integration time:
- Permalink:
maxdevblock/cubmods@3babbcedb6629b376a69661cca1233f086d2818d
- Branch / Tag:
refs/tags/v0.0.3
- Owner: https://github.com/maxdevblock
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
python-publish.yml@3babbcedb6629b376a69661cca1233f086d2818d
- Trigger Event:
release
- Statement type:
File details
Details for the file cubmods-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: cubmods-0.0.3-py3-none-any.whl
- Upload date:
- Size: 130.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28e471e6faa29aa844a1a8eb8b2e7f61329e813216c7749138361627722f77e3 |
|
MD5 | b4a4e005a2556e437d449d678e343f9b |
|
BLAKE2b-256 | 4791def75782003bfada62d61298ea6226927ff5c9bc6914494fdf04a17ad2a3 |
Provenance
The following attestation bundles were made for cubmods-0.0.3-py3-none-any.whl
:
Publisher:
python-publish.yml
on maxdevblock/cubmods
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
cubmods-0.0.3-py3-none-any.whl
- Subject digest:
28e471e6faa29aa844a1a8eb8b2e7f61329e813216c7749138361627722f77e3
- Sigstore transparency entry: 179444731
- Sigstore integration time:
- Permalink:
maxdevblock/cubmods@3babbcedb6629b376a69661cca1233f086d2818d
- Branch / Tag:
refs/tags/v0.0.3
- Owner: https://github.com/maxdevblock
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
python-publish.yml@3babbcedb6629b376a69661cca1233f086d2818d
- Trigger Event:
release
- Statement type: