Skip to content
02/11/2012

Generalized linear (mixed) models etc.

The last 2 scripts introduce generalized linear (mixed) models and some extensions:

  1. First script: bayes_winbugs_jags_5.r; contents:
    • generalized linear models
    • Poisson “t-test” (simulated data, R analysis, WinBUGS / JAGS analysis)
    • binomial “t-test” (simulated data, R analysis, WinBUGS / JAGS analysis)
    • binomial ANCOVA (simulated data, R analysis, WinBUGS / JAGS analysis)
    • binomial GLMM (simulated data, R analysis, WinBUGS / JAGS analysis)
  2. Second script: bayes_winbugs_jags_6.r; contents:
    • GLMMs that take into account inter-annotator disagreement (simulated data, R analysis, WinBUGS / JAGS analysis)
    • ordinal probit “t-test” (based on joint work with Jakub Dotlacil): simulated data for an ordinal probit “t-test”, i.e., an ordinal probit regression with only one predictor (a factor with 2 levels); frequentist analysis in R using the “ordinal” package; Bayesian analysis using WinBUGS / JAGS
02/02/2012

Linear and linear mixed-effects models in R and WinBUGS / JAGS

Plan for the Feb. 7, Feb. 9 and probably Feb. 14 classes (again, feel free to bring your laptops to class and work through the scripts on your own as we go through them in class):

  1. First script: bayes_winbugs_jags_3.r; contents:
    • simple linear regression (simulated data, R analysis, WinBUGS / JAGS analysis)
    • goodness-of-fit assessment in Bayesian analyses (posterior predictive distributions and Bayesian p-values)
    • interpretation of confidence vs. credible intervals
    • fixed-effects 1-way ANOVA (simulated data, R analysis, WinBUGS / JAGS analysis)
    • random-effects 1-way ANOVA (simulated data, R analysis, WinBUGS / JAGS analysis)
    • inferring binomial proportions with hierarchical priors (random-effects for “coins”, i.e., basically, random-effect “binomial” ANOVA)
  2. Second script: bayes_winbugs_jags_4.r; contents:
    • 2-way ANOVA w/o and w/ interactions (simulated data, R analysis, WinBUGS / JAGS analysis)
    • ANCOVA and the importance of covariate standardization (simulated data, R analysis, WinBUGS / JAGS analysis)
    • linear mixed-effects models—random intercepts only, independent random intercepts and slopes, correlated random intercepts and slopes (simulated data, R analysis, WinBUGS / JAGS analysis)
01/27/2012

Intro to WinBUGS / JAGS

Plan for the Jan. 31 & Feb. 2 classes; feel free to bring your laptops to class and work through the scripts on your own as we go through them in class:

  1. First script: bayes_winbugs_jags_1.r; contents:
    • the mean model: simulated data, R analysis, WinBUGS / JAGS analysis
    • the structure of WinBUGS / JAGS models, reexpressing parameters, number of chains, number of iterations, burnin, thinning, the Brooks-Gelman-Rubin (BGR) convergence diagnostic (a.k.a. Rhat), graphical summaries of posterior distributions
    • binomial proportion inference with WinBUGS / JAGS instead of the Metropolis algorithm we built “by hand” for this purpose
    • comparison of 3 models for the same binomial proportion data with different uniform priors: posterior estimation with WinBUGS / JAGS and computing the evidence / marginal likelihood for each model based on the WinBUGS / JAGS posterior samples
    • inference for 2 binomial proportions with WinBUGS / JAGS instead of the Metropolis algorithm we built “by hand” for this purpose
  2. Second script: bayes_winbugs_jags_2.r; contents:
    • essentials of linear models (focus on design matrices)
    • t-tests with equal and unequal variances: simulated data, R analysis, WinBUGS / JAGS analysis
01/23/2012

Intro to Bayesian inference and MCMC (part 2)

Plan for the Jan. 24 & 26 classes:

  1. wrap up examples of inference for binomial proportions with conjugate Beta priors and with grid-discretized priors
  2. intro to Bayes for cognitive science; slides: intro_bayes_2.pdf
  3. introduction to Markov Chain Monte Carlo (MCMC) and the Metropolis family of algorithms bayes_MCMC_intro.r; on a couple of occasions, you will need the following 2 scripts (by John Kruschke; with very minor modifications here): plotPost.R and HDIofMCMC.R
01/20/2012

Cox (1946) and Jaynes (2003)

The slides for Robert Henderson’s excellent presentation of Cox (1946) (“Probability, Frequency and Reasonable Expectation”) and Jaynes (2003) (“Probability Theory: The Logic of Science”), chapters 1 and 2 are available here.

01/15/2012

Intro to Bayesian inference (part 1)

Plan for the Jan. 17 class:

  1. intro to Bayesian inference (part 1); slides: intro_bayes_1.pdf
  2. examples of inference for binomial proportions with conjugate (Beta) priors — based on Kruschke (2011), chapter 5: examples_Bern_Beta.r; to run the examples, you will need the following 2 files: BernBeta.R and HDIofICDF.R
  3. examples of inference for binomial proportions with grid-discretized priors — based on Kruschke (2011), chapter 6: examples_Bern_Grid.r; to run the examples, you will need the following 2 files: BernGrid.R and HDIofGrid.R
01/13/2012

Intro to probability — slides

The slides we discussed on Jan. 12 in the semantics seminar are available here. You can also take a look at Kruschke (2011), chapters 3 and 4.

01/01/2012

“Doing Bayesian Data Analysis” – Now in JAGS

John Kruschke has created JAGS versions of all the programs in “Doing Bayesian Data Analysis”.

Unlike BUGS, JAGS runs on MacOS, Linux, and Windows. JAGS has other features that make it more robust and user-friendly than BUGS. I recommend that you use the JAGS versions of the programs.

For more info, go here.

12/28/2011

From CLG to LaLoCo (Dec. 28, 2011)

The Corpus Linguistics Group (CLG) has evolved into the Language, Logic & Cognition (LaLoCo) lab. A description of LaLoCo’s overarching research goal is available here.

The CLG materials (summaries, scripts etc.) have already been posted on the LaLoCo page:

Most of the LaLoCo / CLG meetings this quarter (winter 2012) will probably be folded into AB’s seminar in semantics.

12/28/2011

Seminar: Statistical & Cognitive Modeling for Formal Semantics

Winter 2012 Seminar in Semantics (Linguistics, UCSC):

  • Statistical & Cognitive Modeling for Formal Semantics

See the syllabus and AB’s teaching page for more information.