Learn R Programming

bbricks (version 0.1.4)

Bayesian Methods and Graphical Model Structures for Statistical Modeling

Description

A set of frequently used Bayesian parametric and nonparametric model structures, as well as a set of tools for common analytical tasks. Structures include linear Gaussian systems, Gaussian and Normal-Inverse-Wishart conjugate structure, Gaussian and Normal-Inverse-Gamma conjugate structure, Categorical and Dirichlet conjugate structure, Dirichlet Process on positive integers, Dirichlet Process in general, Hierarchical Dirichlet Process ... Tasks include updating posteriors, sampling from posteriors, calculating marginal likelihood, calculating posterior predictive densities, sampling from posterior predictive distributions, calculating "Maximum A Posteriori" (MAP) estimates ... See to get started.

Copy Link

Version

Install

install.packages('bbricks')

Monthly Downloads

57

Version

0.1.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Haotian Chen

Last Published

May 7th, 2020

Functions in bbricks (0.1.4)

CatDirichlet

Create objects of type "CatDirichlet".
GaussianInvWishart

Create objects of type "GaussianInvWishart".
GaussianGaussian

Create objects of type "GaussianGaussian".
HDP2

Create objects of type "HDP2".
dAllIndicators

Get the probabilities of all possible values of the hidden indicator variables from the DP family objects.
HDP

Create objects of type "HDP".
CatHDP

Create objects of type "CatHDP".
MPE.CatDirichlet

MPE of a "CatDirichlet" object
MPE.LinearGaussianGaussian

Mean Posterior Estimate (MPE) of a "LinearGaussianGaussian" object
GaussianNIG

Create objects of type "GaussianNIG".
DP

Create objects of type "DP".
dAllIndicators.HDP

Get the probabilities of all possible values of the hidden indicator variables of an "HDP" object.
dPosteriorPredictive.GaussianNIW

Posterior predictive density function of a "GaussianNIW" object
dPosterior.GaussianInvWishart

Density function of the posterior distribution of a "GaussianInvWishart" object
dPosterior.GaussianNIG

Density function of the posterior distribution of a "GaussianNIG" object
MPE.GaussianGaussian

Mean Posterior Estimate (MPE) of a "GaussianGaussian" object
dPosteriorPredictive.GaussianNIG

Posterior predictive density function of a "GaussianNIG" object
CatHDP2

Create objects of type "CatHDP2".
lrData

Samples from a simple linear model
MPE.GaussianInvWishart

Mean Posterior Estimate (MPE) of a "GaussianInvWishart" object
MPE.GaussianNIG

Mean Posterior Estimate (MPE) of a "GaussianNIG" object
dPosterior.CatDirichlet

Density function of the posterior distribution of a "CatDirichlet" object
MAP.CatDP

Maximum A Posteriori(MAP) estimate of a "CatDP" object
MAP.GaussianNIW

Maximum A Posteriori (MAP) estimate of a "GaussianNIW" object
dPosterior.GaussianNIW

Density function of the posterior distribution of a "GaussianNIW" object
marginalLikelihood.CatDP

Marginal likelihood of a "CatDP" object
farmadsData

farm ads data
bbricks-package

bbricks: Bayesian Methods and Graphical Model Structures for Statistical Modeling
GaussianNIW

Create objects of type "GaussianNIW".
dPosteriorPredictive.GaussianInvWishart

Posterior predictive density function of a "GaussianInvWishart" object
cancerData

Cancer mortality of 20 cities
posteriorDiscard.CatDP

Update a "CatDP" object with sample sufficient statistics
marginalLikelihood_bySufficientStatistics.GaussianGaussian

Marginal likelihood of a "GaussianGaussian" object, using sufficient statistics
marginalLikelihood.HDP

Marginal likelihood for HDP
marginalLikelihood.HDP2

Marginal likelihood for HDP2
marginalLikelihood.CatDirichlet

Marginal likelihood of a "CatDirichlet" object
dPosteriorPredictive.GaussianGaussian

Posterior predictive density function of a "GaussianGaussian" object
dPosterior.GaussianGaussian

Density function of the posterior distribution of a "GaussianGaussian" object
%plus%

a plus b with NA values
dGaussian

Density function of Gaussian distribution
MAP.LinearGaussianGaussian

Maximum A Posteriori (MAP) estimate of a "LinearGaussianGaussian" object
dCategorical

Probability mass function for Categorical distribution
MPE.CatDP

Mean Posterior Estimate(MPE) of a "CatDP" object
marginalLikelihood_bySufficientStatistics.LinearGaussianGaussian

Marginal likelihood of a "LinearGaussianGaussian" object, using sufficient statistics
dDir

Density function for Dirichelt distribution
MAP

Get the Maximum A Posteriori(MAP) estimate of a "BayesianBrick" object
posterior.LinearGaussianGaussian

Update a "LinearGaussianGaussian" object with sample sufficient statistics
marginalLikelihood.GaussianGaussian

Marginal likelihood of a "GaussianGaussian" object
rNIW

Random number generation for Normal-Inverse-Wishart (NIW) distribution.
marginalLikelihood.GaussianInvWishart

Marginal likelihood of a "GaussianInvWishart" object
marginalLikelihood_bySufficientStatistics.CatDirichlet

Marginal likelihood of a "CatDirichlet" object, using sufficient statistics
marginalLikelihood.DP

Marginal likelihood for Dirichlet Process(DP)
marginalLikelihood_bySufficientStatistics.CatDP

Marginal likelihood of a "CatDP" object, using sufficient statistics
marginalLikelihood_bySufficientStatistics.GaussianInvWishart

Marginal likelihood of a "GaussianInvWishart" object, using sufficient statistics
MAP.GaussianInvWishart

Maximum A Posteriori (MAP) estimate of a "GaussianInvWishart" object
MPE.GaussianNIW

Mean Posterior Estimate (MPE) of a "GaussianNIW" object
MAP.GaussianNIG

Maximum A Posteriori (MAP) estimate of a "GaussianNIG" object
dPosteriorPredictive

Get the density value of the posterior predictive distribution
posterior_bySufficientStatistics

update the prior distribution with sufficient statistics
dPosterior.LinearGaussianGaussian

Posterior density function of a "LinearGaussianGaussian" object
dPosteriorPredictive.LinearGaussianGaussian

Posterior predictive density function of a "LinearGaussianGaussian" object
dInvGamma

Density function of Inverse-Gamma distribution
dPosteriorPredictive.CatDirichlet

Posterior predictive density function of a "CatDirichlet" object
print.DP

print the content of a "DP" object
BasicBayesian

Create objects of type '"BasicBayesian"'.
dPosteriorPredictive.HDP

Posterior predictive density function of a "HDP" object
dT

Density function for (multivariate) t distribution
dPosteriorPredictive.HDP2

Posterior predictive density function of a "HDP2" object
print.HDP2

print the content of a "HDP2" object
dWishart

Density function of Wishart distribution
posterior.DP

Update a "DP" object with sample sufficient statistics
MetropolisHastings

Metropolis-Hastings sampler
rPosteriorPredictive.GaussianNIW

Generate random samples from the posterior predictive distribution of a "GaussianNIW" object
rPosterior.GaussianInvWishart

Generate one ramdom sample from the posterior distribution of a "GaussianInvWishart" object
posterior.GaussianInvWishart

Update a "GaussianInvWishart" object with sample sufficient statistics
rPosteriorPredictive.LinearGaussianGaussian

Generate random samples from the posterior predictive distribution of a "LinearGaussianGaussian" object
posterior.GaussianGaussian

Update a "GaussianGaussian" object with sample sufficient statistics
posteriorDiscard.CatDirichlet

Update a "CatDirichlet" object with sample sufficient statistics
posteriorDiscard.GaussianGaussian

Update a "GaussianGaussian" object with sample sufficient statistics
posteriorDiscard.DP

Update a "DP" object with sample sufficient statistics
marginalLikelihood_bySufficientStatistics

Get the marginal likelihood of a "BayesianBrick" object
CatDP

Create objects of type "CatDP".
sufficientStatistics.CatDP

Sufficient statistics of a "CatDP" object
posteriorDiscard

update the prior distribution with sufficient statistics
posteriorDiscard.GaussianInvWishart

Update a "GaussianInvWishart" object with sample sufficient statistics
MAP.CatDirichlet

MAP estimate of a "CatDirichlet" object
dInvWishart

Density function of Inverse-Wishart distribution
MPE

Get the Mean Posterior Estimate(MPE) of a "BayesianBrick" object
dNIW

Density function for Normal-Inverse-Wishart (NIW) distribution.
MAP.GaussianGaussian

Maximum A Posteriori (MAP) estimate of a "GaussianGaussian" object
dPosteriorPredictive.CatHDP

Posterior predictive density function of a "CatHDP" object
hlrData

Samples from a hierarchical linear model
sufficientStatistics.DP

Sufficient statistics of a "DP" object
posterior.CatHDP2

Update a "CatHDP2" object with sample sufficient statistics
hmmData

Samples from a hidden Markov model
posterior

update the prior distribution with sufficient statistics
print.BasicBayesian

Print the content of an BasicBayesian object
rPosteriorPredictive.HDP2

Generate random samples from the posterior predictive distribution of a "HDP2" object
rPosteriorPredictive.CatHDP2

Generate random samples from the posterior predictive distribution of a "CatHDP2" object
sufficientStatistics_Weighted.GaussianGaussian

Weighted sufficient statistics of a "GaussianGaussian" object
rPosteriorPredictive.CatHDP

Generate random samples from the posterior predictive distribution of a "CatHDP" object
sufficientStatistics_Weighted

Get weighted sample sufficient statistics
rPosterior.CatDirichlet

Generate ramdom samples from the posterior distribution of a "CatDirichlet" object
marginalLikelihood.GaussianNIG

Marginal likelihood of a "GaussianNIG" object
sufficientStatistics.CatDirichlet

Sufficient statistics of a "CatDirichlet" object
sufficientStatistics_Weighted.LinearGaussianGaussian

Weighted sufficient statistics of a "LinearGaussianGaussian" object
rPosteriorPredictive.GaussianNIG

Generate random samples from the posterior predictive distribution of a "GaussianNIG" object
posterior.CatDirichlet

Update a "CatDirichlet" object with sample sufficient statistics
sufficientStatistics_Weighted.GaussianInvWishart

Weighted sufficient statistics of a "GaussianInvWishart" object
posterior_bySufficientStatistics.CatDP

Update a "CatDP" object with sample sufficient statistics
posterior.CatHDP

Update a "CatHDP" object with sample sufficient statistics
marginalLikelihood.LinearGaussianGaussian

Marginal likelihood of a "LinearGaussianGaussian" object
posterior.HDP

Update a "HDP" object with sample sufficient statistics
marginalLikelihood_bySufficientStatistics.GaussianNIG

Marginal likelihood of a "GaussianNIG" object, using sufficient statistics
dPosteriorPredictive.DP

Posterior predictive density function of a Dirichlet Process object
rPosteriorPredictive.DP

Generate random samples from the posterior predictive distribution of a "DP" object
posteriorDiscard.GaussianNIG

Update a "GaussianNIG" object with sample sufficient statistics
rPosterior.LinearGaussianGaussian

Posterior random generation of a "LinearGaussianGaussian" object
marginalLikelihood

Get the marginal likelihood of a "BayesianBrick" object
posteriorDiscard_bySufficientStatistics

update the prior distribution with sufficient statistics
rPosterior

Generate random samples from the posterior distribution
rInvGamma

Random number generation of Inverse-Gamma distribution
rPosteriorPredictive.GaussianInvWishart

Generate random samples from the posterior predictive distribution of a "GaussianInvWishart" object
posteriorDiscard_bySufficientStatistics.CatDirichlet

Update the prior Dirichlet distribution with sample sufficient statistics
rInvWishart

Random generation for Inverse-Wishart distribution
dPosterior

Get the density from the posterior distribution.
dPosteriorPredictive.CatHDP2

Posterior predictive density function of a "CatHDP" object
dPosteriorPredictive.CatDP

Posterior predictive density function of a "CatDP" object
inferenceJointGaussian

Inference in joint Gaussian distribution
posteriorDiscard.CatHDP

Update a "CatHDP" object with sample sufficient statistics
sufficientStatistics

Get sample sufficient statistics
sufficientStatistics.GaussianNIW

Sufficient statistics of a "GaussianNIW" object
sufficientStatistics_Weighted.CatDP

Weighted sufficient statistics of a "CatDP" object
mmhhData

Samples from a hierarchical mixture model with two layers of hierarchies
sufficientStatistics.HDP

Sufficient statistics of a "HDP" object
rPosteriorPredictive.CatDP

Generate random samples from the posterior predictive distribution of a "CatDP" object
posteriorDiscard_bySufficientStatistics.CatDP

Update a "CatDP" object with sample sufficient statistics
posteriorDiscard.CatHDP2

Update a "CatHDP2" object with sample sufficient statistics
posterior_bySufficientStatistics.CatDirichlet

Update a "CatDirichlet" object with sample sufficient statistics
posteriorDiscard.HDP2

Update a "HDP2" object with sample sufficient statistics
logsumexp

log sum exp
print.CatHDP

Print the content of an CatHDP object
posterior.GaussianNIG

Update a "GaussianNIG" object with sample sufficient statistics
marginalLikelihood.GaussianNIW

Marginal likelihood of a "GaussianNIW" object
mmhData

Samples from a hierarchical mixture model
pdsDeterminant

determinant of a positive definite symmetric matrix
pdsInverse

Inverse of a positive definite symmetric matrix
mmData

Samples from a mixture model
marginalLikelihood_bySufficientStatistics.GaussianNIW

Marginal likelihood of a "GaussianNIW" object, using sufficient statistics
rPosterior.GaussianNIW

Generate ramdom samples from the posterior distribution of a "GaussianNIW" object
posterior.CatDP

Update a "CatDP" object with sample sufficient statistics
print.HDP

print the content of a "HDP" object
posteriorDiscard.GaussianNIW

Update a "GaussianNIW" object with sample sufficient statistics
posteriorDiscard.HDP

Update a "HDP" object with sample sufficient statistics
rPosterior.GaussianGaussian

Generate ramdom samples from the posterior distribution of a "GaussianGaussian" object
posterior.HDP2

Update a "HDP2" object with sample sufficient statistics
rPosteriorPredictive

Generate random samples from the posterior predictive distribution
sufficientStatistics_Weighted.HDP

Weighted sufficient statistics of a "HDP" object
rCategorical

Random generation for Categorical distribution
posterior.GaussianNIW

Update a "GaussianNIW" object with sample sufficient statistics
rPosteriorPredictive.GaussianGaussian

Generate random samples from the posterior predictive distribution of a "GaussianGaussian" object
sufficientStatistics_Weighted.HDP2

Weighted sufficient statistics of a "HDP2" object
rPosteriorPredictive.CatDirichlet

Generate random samples from the posterior predictive distribution of a "CatDirichlet" object
rT

Random Generation for (multivariate) t distribution
sufficientStatistics.GaussianGaussian

Sufficient statistics of a "GaussianGaussian" object
sufficientStatistics.HDP2

Sufficient statistics of a "HDP2" object
rWishart

Random generation for Wishart distribution
rPosterior.GaussianNIG

Generate ramdom samples from the posterior distribution of a "GaussianNIG" object
rDir

Random generation for Dirichelt distribution
release_questions

additional release questions
sufficientStatistics_Weighted.CatDirichlet

Weighted sufficient statistics of a "CatDirichlet" object
posteriorDiscard.LinearGaussianGaussian

Update a "LinearGaussianGaussian" object with sample sufficient statistics
rGaussian

Random generation for Gaussian distribution
print.CatHDP2

Print the content of an CatHDP2 object
sufficientStatistics_Weighted.GaussianNIG

Weighted sufficient statistics of a "GaussianNIG" object
sufficientStatistics_Weighted.GaussianNIW

Weighted sufficient statistics for a "GaussianNIW" object
rPosteriorPredictive.HDP

Generate random samples from the posterior predictive distribution of a "HDP" object
sufficientStatistics.GaussianInvWishart

Sufficient statistics of a "GaussianInvWishart" object
sufficientStatistics.GaussianNIG

Sufficient statistics of a "GaussianNIG" object
sufficientStatistics.LinearGaussianGaussian

Sufficient statistics of a "LinearGaussianGaussian" object
sufficientStatistics_Weighted.DP

Weighted sufficient statistics of a "DP" object
LinearGaussianGaussian

Create objects of type "LinearGaussianGaussian".