productpartitionmodels.jl
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
✓DOI references
Found 3 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.6%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: mheiner
- License: mit
- Language: Julia
- Default Branch: master
- Size: 112 KB
Statistics
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
ProductPartitionModels.jl
Fit product partition (PPM; Hartigan, 1990) and covariate-dependent product partition (PPMx; Muller, Quintana, and Rosner, 2011) models using Markov chain Monte Carlo (MCMC). Covariates are currently assumed to be of continuous type. They may optionally contain missing values (Page, Quintana, and Muller, 2022; Heiner, Page, and Quintana, 2023).
Workflow
First create a model object with Model_PPMx. Then run MCMC with mcmc! on the model object. For example, using a vector of responses y and covariate matrix X, fit the model with
model = Model_PPMx(y, X, 0, similarity_type=:NN, sampling_model=:Reg)
sims = mcmc!(model, 1000)
The object sims is a vector of dictionaries, with each dictionary indexed by symbols. Access a list of dictionary keys with
keys(sims[1])
Posterior samples of parameter values or other quantities in the keys list can be extracted by collecting them into arrays
sims_llik = [ sims[i][:llik] for i in 1:length(sims) ]
Posterior draws can also be used for in-sample prediction
Ypred_is, Cpred_is, Mpred_is = postPred(model, sims)
or out-of-sample prediction
Ypred_oos, Cpred_oos, Mpred_oos = postPred(Xpred, model, sims)
Model objects can be initialized with user-defined priors and similarity functions. They can also be modified prior to running MCMC, for example
model.state.similarity = Similarity_NNiChisq_indep(0.0, 0.1, 10.0, 0.5^2)
model.prior.baseline.mu0_mean = 1.0
model.state.baseline.sig_upper = 1.5
See documentation on Model_PPMx, mcmc!, and postPred for additional options, or run
model |> typeof |> fieldnames
model.prior |> typeof |> fieldnames
model.state |> typeof |> fieldnames
to explore the fields in each object.
Citing this package
See CITATION.bib.
Owner
- Name: Matt Heiner
- Login: mheiner
- Kind: user
- Website: https://heiner.byu.edu/
- Repositories: 2
- Profile: https://github.com/mheiner
Citation (CITATION.bib)
@misc{ProductPartitionModels:package,
title = {{ProductPartitionModels.jl}: Models that Employ a Product Partition Distribution as a Prior on Partitions},
author = {Matthew J. Heiner},
note = {Julia package version 0.8.2},
year = {2023},
howpublished = {\url{https://github.com/mheiner/ProductPartitionModels.jl}}
}