Contrast coding

Assigning numerical values to categorical (factor) variables is called contrast coding. This need arises when we want to estimate the difference in the dependent variable among different conditions of an independent variable. In other words, we use contrast coding to instruct the Bayesian model to compare the conditional means between different conditions or bundles ofContinue reading “Contrast coding”

Bayesian Hierarchical Model

Data is often grouped by similarities that arise from repeated measurements for each subject or experimental item. This structure can be represented as hierarchies. This type of model is known as a hierarchical model, multi-level model, mixed model, or partial pooling model. Exchangeability The Bayesian hierarchical model is based on the assumption of exchangeability. ThisContinue reading “Bayesian Hierarchical Model”

Bayesian for data analysis and hypothesis testing

In Bayesian data analysis, we often hypothesize the observed data is sampled from an underlying data model (M) with its own probability density function (PDF) and associated parameters (, such as p in Binomial distribution). The PDF is used as the likelihood function (p(y|, M). Our assumption or knowledge or belief about parameters used inContinue reading “Bayesian for data analysis and hypothesis testing”

Bivariate and Multivariate distributions

Univariate distributions display probability distribution for one variable, such as the number of desirable events in Binomial distribution, the variable having mean and standard deviation in Normal distribution, and the probability for each Bernoulli event in a Beta distribution. A bivariate or multivariate distribution defines probability for two or more dimensions. Assuming a PMF isContinue reading “Bivariate and Multivariate distributions”

Beta Distribution

Binomial distribution requires the knowledge of the probability for obtaining the desirable outcome in each trial (p). However, in real life, this parameter needs to be inferred from data. The foundation of statistics is inference, that is to figure out the probability from observations. Beta distribution shows probabilities of a continuous range of probabilities (variableContinue reading “Beta Distribution”

Bayesian for parameter estimation and A/B test

There are two drugs that are applied to equal amount of patients. We obtained two sets of data for each corresponding drug indicating its effectiveness (e.g. how long each patient survived without symptom). We want to know which drug is more effective. Furthermore, we want to assess how much more effective the winner drug isContinue reading “Bayesian for parameter estimation and A/B test”

Bayesian Statistics for Beginner

Bayesian Statistics is about how to use data to update your belief. It is not about how to use data to prove or support your hypothesis. Bayesian statistics lets people to combine their prior knowledges with observations to disagree or update with their beliefs in a quantitative way. The core of Bayesian thinking is theContinue reading “Bayesian Statistics for Beginner”

Binomial Distribution

Binomial Distribution describes probabilities of getting a number of successful trials (variable, k) within a fixed total number of trials (constant parameter, n), given the probability of one successful trial is known and fixed (constant parameter, p) (B(k; n, p)). Each trial in binomial distribution, as described above, is a Bernoulli event that can onlyContinue reading “Binomial Distribution”

Probability and Probability Distribution

Probability captures how strong, or how uncertain, we believe in the world. It is a natural extension of logic (absolute believes, binaries). The probability for an event to occur lies between 0 and 1 (rule No.1). Probability can be calculated as the proportion of number of desirable events over the total number of events. ForContinue reading “Probability and Probability Distribution”