510 likes | 686 Views
Educational Tools for Introductory Bayesian Statistics using Mathematica. Shin-ichi Mayekawa Graduate School of Decision Science and Technology. Tokyo Institute of Technology. Purpose of this Research. Find a way to use Mathematica e fficiently in Bayesian Statistics.
E N D
IMPS2006 Educational Toolsfor Introductory Bayesian Statistics using Mathematica Shin-ichi MayekawaGraduate School of Decision Science and Technology.Tokyo Institute of Technology
IMPS2006 Purpose of this Research • Find a way to use Mathematicaefficiently in Bayesian Statistics. • Mathematica can do Symbolic Math.Especially, definite integration.
IMPS2006 Outline What Mathematica can and cannot do. What mathStatica can and cannot do. What my Bayespack can do. Application of SuMOpack (2005)
IMPS2006 What Mathematica Can Do • Knows(memorizes) PDF, CDF,mean, variance, skewness, kurtosisof many distributions. • Knows(memorizes) Characteristic Function ofunivariate distribution. • Can symbolically calculate/derive the expectation of a function of the random variable. • And More.
IMPS2006 <<Statistics`
IMPS2006 What Mathematica Cannot Do • Given an expression (full or kernel) and the name of the random variable, it cannot identify the distribution. • Cannot directly calculate marginal/conditional distributions. • Cannot handle fully symbolic multivariate distributions. • No Bayesian distributions.
IMPS2006 What is mathStatica ? • mathStatica is a package created by:Colin Rose and Murray Smith(2002) Mathematical Statistics with MathematicaSpringer Texts in Statistics 2002with which we can study and practice mathematical statistics using Mathemtatica. • http://www.mathstatica.com/reviews/
IMPS2006 What mathStatica Can Do • Given PDF, mathStatica can do manysymbolic derivations using the followingfunctions:Expect, Var, Corr, Cov, Prob, Transform, Jacob, Sufficient,Conditional, Marginal, and more.
IMPS2006 What mathStatica Cannot Do • Given an expression (full or kernel) and the name of the random variable, it cannot identify the distribution. • Cannot handle fully symbolic multivariate distributions. • No Bayesian distributions. • No Bayesian statistics.
IMPS2006 Bayespack: objectives • Provide several Bayesian distributuionssuch as Inverted xxxx distribution. • Given an expression (full or kernel) and the name of the random variable(RV), identify the distribution of RV. • Find the kernel of the distributionby pattern matching,and find the normalizing constant.
IMPS2006 Bayespack: objectives • Should be able to handle fully symbolicmultivariate random variables. Use SuMOpack.
IMPS2006 1) Fully Symbolic Matrix Operations 1. Simplification of Matrix Expressions 2. Simplification of Partitioned Matrix Expressions 3. Conversion of Matrix Expressions to Summation Expressions 4. Derivative of a Scalar Function of Matrices w.r.t. a Matrix SuMOpack for Mathematica (2005) 2) Fully Symbolic Summation Operations 1. Simplification of Summation Expressions 2. Conversion of Summation Expressions to Matrix Expressions 3. Derivative of a Summation Expression w.r.t. a Subscripted Variable
IMPS2006 Bayespack: objectives • Should be able to do the standard Bayesian Analysis. • Identify the product of the Likelihood and the prior using the parametersas RV.
IMPS2006 Bayesian Distributions • Chi and Chi-Squared distribution(with scale parametes) • Inverted Chi, Chi-Squared distributionInverted Gamma distribution • t distribution (with mean and scale parametes) • Multivariate t distributionmatric t distribution (with mean and scale parametes) • Inverted Wishart distribution
IMPS2006 Identifying the Distribution
IMPS2006 Bayesian Posterior Distributions • Method 1 Using the tools such as completeSquare,transform the joint distribution to the standard form and identify.
IMPS2006 Completion of Square
IMPS2006 Completion of Square
IMPS2006 Completion of Square
IMPS2006 Normal (natural conjugate)
IMPS2006 Normal (natural conjugate)
IMPS2006 Normal (natural conjugate)
IMPS2006 Normal (natural conjugate)
IMPS2006 Normal (natural conjugate)
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Bayesian Posterior Distributions • Method 2 Try to identify the distribution automatically if possible without transforming to the standard form.
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Normal Regression (natural conjugate)
IMPS2006 Conclusions Bayespack can be used as an Educational Tool. It may be more suited for those whowish to write a textbook on Bayseian Statistics. Thank you.