User:Sleepophil/sandbox

From Wikipedia, the free encyclopedia

Bayesian hierarchical modelling is a statistical model written in multiple levels (hierarchical form) that estimates the parameters of the posterior distribution using the Bayesian method.[1] The sub-models combine to form the hierarchical model, and Bayes' theorem is used to integrate them with the observed data and account for all the uncertainty that is present. The result of this integration is the posterior distribution, also known as the updated probability estimate, as additional evidence on the prior distribution is acquired.

Frequentist statistics may yield conclusions seemingly incompatible with those offered by Bayesian statistics due to the Bayesian treatment of the parameters as random variables and its use of subjective information in establishing assumptions on these parameters.[2] As the approaches answer different questions the formal results aren't technically contradictory but the two approaches disagree over which answer is relevant to particular applications. Bayesians argue that relevant information regarding decision making and updating beliefs cannot be ignored and that hierarchical modeling has the potential to overrule classical methods in applications where respondents give multiple observational data. Moreover, the model has proven to be robust, with the posterior distribution less sensitive to the more flexible hierarchical priors.

Hierarchical modeling is used when information is available on several different levels of observational units. The hierarchical form of analysis and organization helps in the understanding of multiparameter problems and also plays an important role in developing computational strategies.[3]

Philosophy[edit]

Statistical methods and models commonly involve multiple parameters that can be regarded as related or connected in such a way that the problem implies dependence of the joint probability model for these parameters.[4] Individual degrees of belief, expressed in the form of probabilities, come with uncertainty.[5] Amidst this is the change of the degrees of belief over time. As was stated by Professor José M. Bernardo and Professor Adrian F. Smith, “The actuality of the learning process consists in the evolution of individual and subjective beliefs about the reality.” These subjective probabilities are more directly involved in the mind rather than the physical probabilities.[5] Hence, it is with this need of updating beliefs that Bayesians have formulated an alternative statistical model which takes into account the prior occurrence of a particular event.[6]

Bayes' theorem[edit]

The assumed occurrence of a real-world event will typically modify preferences between certain options. This is done by modifying the degrees of belief attached, by an individual, to the events defining the options.[7]

Suppose in a study of the effectiveness of cardiac treatments, with the patients in hospital j having survival probability , the survival probability will be updated with the occurrence of y, the event in which a controversial serum is created which, as believed by some, increases survival in cardiac patients.

In order to make updated probability statements about , given the occurrence of event y, we must begin with a model providing a joint probability distribution for and y. This can be written as a product of the two distributions that are often referred to as the prior distribution and the sampling distribution respectively:

Using the basic property of conditional probability, the posterior distribution will yield:

This equation, showing the relationship between the conditional probability and the individual events, is known as Bayes' theorem. This simple expression encapsulates the technical core of Bayesian inference which aims to incorporate the updated belief, , in appropriate and solvable ways.[7]

Exchangeability[edit]

The usual starting point of a statistical analysis is the assumption that the n values are exchangeable. If no information – other than data y – is available to distinguish any of the ’s from any others, and no ordering or grouping of the parameters can be made, one must assume symmetry among the parameters in their prior distribution.[8] This symmetry is represented probabilistically by exchangeability. Generally, it is useful and appropriate to model data from an exchangeable distribution as independently and identically distributed, given some unknown parameter vector , with distribution .

Finite exchangeability[edit]

For a fixed number n, the set is exchangeable if the joint probability is invariant under permutations of the indices. That is, for every permutation or of , [9]

Following is an exchangeable, but not independent and identical (iid), example: Consider an urn with a red ball and a blue ball inside, with probability of drawing either. Balls are drawn without replacement, i.e. after one ball is drawn from the n balls, there will be n − 1 remaining balls left for the next draw.

Since the probability of selecting a red ball in the first draw and a blue ball in the second draw is equal to the probability of selecting a blue ball on the first draw and a red on the second draw, both of which are equal to 1/2 (i.e. ), then and are exchangeable.

But the probability of selecting a red ball on the second draw given that the red ball has already been selected in the first draw is 0, and is not equal to the probability that the red ball is selected in the second draw which is equal to 1/2 (i.e. ). Thus, and are not independent.

If are independent and identically distributed, then they are exchangeable, but the converse is not necessarily true.[10]

Infinite exchangeability[edit]

Infinite exchangeability is the property that every finite subset of an infinite sequence , is exchangeable. That is, for any n, the sequence is exchangeable.[10]

Hierarchical models[edit]

Components[edit]

Bayesian hierarchical modeling makes use of two important concepts in deriving the posterior distribution,[1] namely:

  1. Hyperparameters: parameters of the prior distribution
  2. Hyperpriors: distributions of Hyperparameters

Suppose a random variable Y follows a normal distribution with parameter θ as the mean and 1 as the variance, that is . The tilde relation can be read as "has the distribution of" or "is distributed as". Suppose also that the parameter has a distribution given by a normal distribution with mean and variance 1, i.e. . Furthermore, follows another distribution given, for example, by the standard normal distribution, . The parameter is called the hyperparameter, while its distribution given by is an example of a hyperprior distribution. The notation of the distribution of Y changes as another parameter is added, i.e. . If there is another stage, say, follows another normal distribution with mean and variance , meaning , and can also be called hyperparameters while their distributions are hyperprior distributions as well.[4]

Framework[edit]

Let be an observation and a parameter governing the data generating process for . Assume further that the parameters are generated exchangeably from a common population, with distribution governed by a hyperparameter .
The Bayesian hierarchical model contains the following stages:

The likelihood, as seen in stage I is , with as its prior distribution. Note that the likelihood depends on only through .

The prior distribution from stage I can be broken down into:

[from the definition of conditional probability]

With as its hyperparameter with hyperprior distribution, .

Thus, the posterior distribution is proportional to:

[using Bayes' Theorem]
[11]

Example[edit]

To further illustrate this, consider the example: A teacher wants to estimate how well a student did on the SAT. The teacher uses information on the student’s high school grades and current grade point average (GPA) to come up with an estimate. The student's current GPA, denoted by , has a likelihood given by some probability function with parameter , i.e. . This parameter is the SAT score of the student. The SAT score is viewed as a sample coming from a common population distribution indexed by another parameter , which is the high school grade of the student (freshman, sophomore, junior or senior).[12] That is, . Moreover, the hyperparameter follows its own distribution given by , a hyperprior. To solve for the SAT score given information on the GPA,

All information in the problem will be used to solve for the posterior distribution. Instead of solving only using the prior distribution and the likelihood function, the use of hyperpriors gives more information to make more accurate beliefs in the behavior of a parameter.[13]

2-stage hierarchical model[edit]

In general, the joint posterior distribution of interest in 2-stage hierarchical models is:

[13]

3-stage hierarchical model[edit]

For 3-stage hierarchical models, the posterior distribution is given by:

[13]

8 schools hierarchical model (a 2-stage example)[edit]

A concrete example of a hierarchical model is the "8 schools" model[14], where 8 different schools organized coaching programs for the SAT test with various results. The improvement in students' SAT scores after finishing the coaching programs from 8 different schools is summarized as follows[14]:

School name Estimated treatment

effect,

Standard error of the

effect estimate,

A 28 15
B 8 10
C -3 16
D 7 11
E -1 9
F 1 11
G 18 10
H 12 18

Namely, the scores of students in each school follows a normal distribution with mean and standard error , assuming the score distribution in each school is close enough to normal distributions so that the statistics can be effectively summarized by the two number and . The goal is to determine how effective are coaching programs at improving SAT scores in general, based on the data we obtain from these 8 schools.

To achieve this, we construct a hierarchical model with parameters , which represents the true mean of the score improvement in each school, and hyperparameters and , which reflects the effectiveness of coaching programs in general. Assuming that standard errors of the effect, , is well-constrained by the student score data, which can be achieved when the sample sizes are large, we have

where is a normal distribution with mean and standard deviation . Assuming also that effectiveness of individual schools follows a normal distribution with mean and standard deviation , i.e.,
so this model is a 2-stage hierarchical model with parameters and hyperparameters and .

Applying Bayes' theorem to this model gives

where and are both likelihood functions given by the normal distribution, and is the prior of the hyperparameters. Prior to this experiments there is no information of how these coaching programs perform, so uniform distributions are used for priors of and . This means that where is a uniform distribution symmetric about 0 and is a uniform distribution only on positive values.

The posterior distribution of the hyperparameters and of the "8 school" model generated by a Markov Chain Monte Carlo simulation. Two Markov Chains, each with steps, are used. The center color map shows the posterior distribution where brighter colors represent higher probability densities. The top panel shows the posterior probability distribution marginalized over , and the right panel shows marginalized over . In both panels, two functions generated by the two Markov Chains are plotted using different colors. This posterior result is consistent with those generated from other Monte Carlo algorithms using established packages[15][16].

At this stage, the right-hand side of the equation above is completely specified, and Metropolis-Hastings algorithm can then be used to numerically integrate the posterior distribution of the hyperparameters. The result of a simulation using two separate Markov chains are plotted in the image to the right. From the posterior distributions shown, is center around values between 5 to 10, values greater than 0, meaning that coaching programs in general is effective at improving students' SAT score based on the data obtained from the 8 schools listed above.

References[edit]

  1. ^ a b Allenby, Rossi, McCulloch (January 2005). "Hierarchical Bayes Model: A Practitioner’s Guide". Journal of Bayesian Applications in Marketing, pp. 1–4. Retrieved 26 April 2014, p. 3
  2. ^ Gelman, Andrew; Carlin, John B.; Stern, Hal S. & Rubin, Donald B. (2004). Bayesian Data Analysis (second ed.). Boca Raton, Florida: CRC Press. pp. 4–5. ISBN 1-58488-388-X.
  3. ^ Gelman et al. 2004, p. 6.
  4. ^ a b Gelman et al. 2004, p. 117.
  5. ^ a b Good, I.J. (1980). "Some history of the hierarchical Bayesian methodology". Trabajos de Estadistica y de Investigacion Operativa. 31: 489–519. doi:10.1007/BF02888365. S2CID 121270218.
  6. ^ Bernardo, Smith(1994). Bayesian Theory. Chichester, England: John Wiley & Sons, ISBN 0-471-92416-4, p. 23
  7. ^ a b Gelman et al. 2004, pp. 6–8.
  8. ^ Bernardo, Degroot, Lindley (September 1983). “Proceedings of the Second Valencia International Meeting”. Bayesian Statistics 2. Amsterdam: Elsevier Science Publishers B.V, ISBN 0-444-87746-0, pp. 167–168
  9. ^ Gelman et al. 2004, pp. 121–125.
  10. ^ a b Diaconis, Freedman (1980). “Finite exchangeable sequences”. Annals of Probability, pp. 745–747
  11. ^ Bernardo, Degroot, Lindley (September 1983). “Proceedings of the Second Valencia International Meeting”. Bayesian Statistics 2. Amsterdam: Elsevier Science Publishers B.V, ISBN 0-444-87746-0, pp. 371–372
  12. ^ Gelman et al. 2004, pp. 120–121.
  13. ^ a b c Box G. E. P., Tiao G. C. (1965). "Multiparameter problem from a bayesian point of view". Multiparameter Problems From A Bayesian Point of View Volume 36 Number 5. New York City: John Wiley & Sons, ISBN 0-471-57428-7
  14. ^ a b Gelman, Andrew (November 2013). Bayesian data analysis (Third ed.). Boca Raton. pp. 119–121. ISBN 978-1-4398-4095-5. OCLC 859253474.{{cite book}}: CS1 maint: location missing publisher (link)
  15. ^ "Getting started — PyStan 2.19.1.1 documentation". pystan.readthedocs.io. Retrieved 2020-12-20.
  16. ^ "Model comparison — PyMC3 3.9.3 documentation". docs.pymc.io. Retrieved 2020-12-20.

Category:Bayesian networks