4.2 centering Chris Parrish July 2, 2016

Size: px
Start display at page:

Download "4.2 centering Chris Parrish July 2, 2016"

Transcription

1 4.2 centering Chris Parrish July 2, 2016 Contents centering and standardizing 1 centering data model fit centering by subtracting the mean model fit using a conventional centering point model fit centering by subtracting the mean and dividing by 2 sd model fit centering and standardizing reference: - ARM chapter 04, github library(rstan) rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectcores()) library(ggplot2) centering and standardizing centering data # Data source("kidiq.data.r", echo = TRUE) > N <- 434 > kid_score <- c(65, 98, 85, 83, 115, 98, 69, 106, 102, + 95, 91, 58, 84, 78, 102, 110, 102, 99, 105, 101, 102, 115, + 100, 87, 99, 96, 72,... [TRUNCATED] > mom_hs <- c(1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 1, 1, 1, 1, 1,... [TRUNCATED] 1

2 > mom_iq <- c( , , , , , , , +... [TRUNCATED] > mom_work <- c(4, 4, 4, 3, 4, 1, 4, 3, 1, 1, 1, 4, + 4, 4, 2, 1, 3, 3, 4, 3, 4, 2, 2, 4, 4, 4, 3, 4, 2, 2, 1, + 2, 3, 2, 3, 4, 4, 4, 1, 4,... [TRUNCATED] model kidiq_interaction.stan data { int<lower=0> N; vector[n] kid_score; vector[n] mom_hs; vector[n] mom_iq; transformed data { vector[n] inter; inter = mom_hs.* mom_iq; // interaction parameters { vector[4] beta; real<lower=0> sigma; model { kid_score ~ normal(beta[1] + beta[2] * mom_hs + beta[3] * mom_iq + beta[4] * inter, sigma); fit # Model: kid_score ~ mom_hs + mom_iq + mom_hs:mom_iq data.list = c("n", "kid_score", "mom_hs", "mom_iq") kidiq_interaction <- stan(file='kidiq_interaction.stan', data=data.list, iter=1000, chains=4) plot(kidiq_interaction) ci_level: 0.8 (80% intervals) outer_level: 0.95 (95% intervals) 2

3 beta[1] beta[2] beta[3] beta[4] sigma 0 50 pairs(kidiq_interaction) beta[1] 0 60 beta[2] beta[3] beta[4] sigma 1476 lp print(kidiq_interaction, pars = c("beta", "sigma", "lp ")) Inference for Stan model: kidiq_interaction. 4 chains, each with iter=1000; warmup=500; thin=1; post-warmup draws per chain=500, total post-warmup draws=2000. beta[1] beta[2] beta[3] beta[4] mean se_mean sd % % % %

4 sigma lp % n_eff Rhat beta[1] beta[2] beta[3] beta[4] sigma lp Samples were drawn using NUTS(diag_e) at Wed Jul 6 00:34: For each parameter, n_eff is a crude measure of effective sample size, and Rhat is the potential scale reduction factor on split chains (at convergence, Rhat=1). The estimated Bayesian Fraction of Missing Information is a measure of the efficiency of the sampler with values close to 1 being ideal. For each chain, these estimates are centering by subtracting the mean model kidiq_interaction_c.stan data { int<lower=0> N; vector[n] kid_score; vector[n] mom_hs; vector[n] mom_iq; transformed data { vector[n] c_mom_hs; vector[n] c_mom_iq; vector[n] inter; c_mom_hs = mom_hs - mean(mom_hs); c_mom_iq = mom_iq - mean(mom_iq); inter = c_mom_hs.* c_mom_iq; // centered predictors parameters { vector[4] beta; real<lower=0> sigma; model { kid_score ~ normal(beta[1] + beta[2] * c_mom_hs + beta[3] * c_mom_iq + beta[4] * inter, sigma); 4

5 fit # Centering by subtracting the mean kidiq_interaction_c <- stan(file='kidiq_interaction_c.stan', data=data.list, iter=1000, chains=4) print(kidiq_interaction_c) Inference for Stan model: kidiq_interaction_c. 4 chains, each with iter=1000; warmup=500; thin=1; post-warmup draws per chain=500, total post-warmup draws=2000. mean se_mean sd 2.5% 25% 50% 75% 97.5% beta[1] beta[2] beta[3] beta[4] sigma lp n_eff Rhat beta[1] beta[2] beta[3] beta[4] sigma lp Samples were drawn using NUTS(diag_e) at Wed Jul 6 00:34: For each parameter, n_eff is a crude measure of effective sample size, and Rhat is the potential scale reduction factor on split chains (at convergence, Rhat=1). The estimated Bayesian Fraction of Missing Information is a measure of the efficiency of the sampler with values close to 1 being ideal. For each chain, these estimates are using a conventional centering point model kidiq_interaction_c2.stan data { int<lower=0> N; vector[n] kid_score; vector[n] mom_hs; vector[n] mom_iq; transformed data { vector[n] c2_mom_hs; vector[n] c2_mom_iq; vector[n] inter; c2_mom_hs = mom_hs - 0.5; c2_mom_iq = mom_iq - 100; // centering on reference points 5

6 inter = c2_mom_hs.* c2_mom_iq; parameters { vector[4] beta; real<lower=0> sigma; model { kid_score ~ normal(beta[1] + beta[2] * c2_mom_hs + beta[3] * c2_mom_iq + beta[4] * inter, sigma); fit # Using a conventional centering point: # c2_mom_hs <- mom_hs # c2_mom_iq <- mom_iq kidiq_interaction_c2 <- stan(file='kidiq_interaction_c2.stan', data=data.list, iter=1000, chains=4) print(kidiq_interaction_c2) Inference for Stan model: kidiq_interaction_c2. 4 chains, each with iter=1000; warmup=500; thin=1; post-warmup draws per chain=500, total post-warmup draws=2000. mean se_mean sd 2.5% 25% 50% 75% 97.5% beta[1] beta[2] beta[3] beta[4] sigma lp n_eff Rhat beta[1] beta[2] beta[3] beta[4] sigma lp Samples were drawn using NUTS(diag_e) at Wed Jul 6 00:34: For each parameter, n_eff is a crude measure of effective sample size, and Rhat is the potential scale reduction factor on split chains (at convergence, Rhat=1). The estimated Bayesian Fraction of Missing Information is a measure of the efficiency of the sampler with values close to 1 being ideal. For each chain, these estimates are

7 centering by subtracting the mean and dividing by 2 sd model kidiq_interaction_z.stan data { int<lower=0> N; vector[n] kid_score; vector[n] mom_hs; vector[n] mom_iq; transformed data { // standardizing vector[n] z_mom_hs; vector[n] z_mom_iq; vector[n] inter; z_mom_hs = (mom_hs - mean(mom_hs)) / (2 * sd(mom_hs)); z_mom_iq = (mom_iq - mean(mom_iq)) / (2 * sd(mom_iq)); inter = z_mom_hs.* z_mom_iq; parameters { vector[4] beta; real<lower=0> sigma; model { kid_score ~ normal(beta[1] + beta[2] * z_mom_hs + beta[3] * z_mom_iq + beta[4] * inter, sigma); fit # Centering by subtracting the mean and dividing by 2 sd kidiq_interaction_z <- stan(file='kidiq_interaction_z.stan', data=data.list, iter=1000, chains=4) print(kidiq_interaction_z) Inference for Stan model: kidiq_interaction_z. 4 chains, each with iter=1000; warmup=500; thin=1; post-warmup draws per chain=500, total post-warmup draws=2000. mean se_mean sd 2.5% 25% 50% 75% 97.5% beta[1] beta[2] beta[3] beta[4] sigma lp n_eff Rhat beta[1] beta[2] beta[3] beta[4] sigma

8 lp Samples were drawn using NUTS(diag_e) at Wed Jul 6 00:34: For each parameter, n_eff is a crude measure of effective sample size, and Rhat is the potential scale reduction factor on split chains (at convergence, Rhat=1). The estimated Bayesian Fraction of Missing Information is a measure of the efficiency of the sampler with values close to 1 being ideal. For each chain, these estimates are

5.4 wells in Bangladesh Chris Parrish July 3, 2016

5.4 wells in Bangladesh Chris Parrish July 3, 2016 5.4 wells in Bangladesh Chris Parrish July 3, 2016 Contents wells in Bangladesh 1 data..................................................... 1 logistic regression with one predictor 3 figure 5.8...............................................

More information

Stan Workshop. Peter Gao and Serge Aleshin-Guendel. November

Stan Workshop. Peter Gao and Serge Aleshin-Guendel. November Stan Workshop Peter Gao and Serge Aleshin-Guendel November 21 2017 Set Up To run a model in Stan in R, you need two files: a.stan file and a.r file. The.stan file declares the model, the.r file performs

More information

Non-analytic; can only be solved with MCMC. Last model isn t found in any package.

Non-analytic; can only be solved with MCMC. Last model isn t found in any package. DAY 2 STAN WORKSHOP RECAP RECAP Ran multiple Stan programs! Wrote multiple Stan programs. Non-analytic; can only be solved with MCMC. Last model isn t found in any package. Started learning a new language.

More information

Hierarchical models. Dr. Jarad Niemi. STAT Iowa State University. February 14, 2018

Hierarchical models. Dr. Jarad Niemi. STAT Iowa State University. February 14, 2018 Hierarchical models Dr. Jarad Niemi STAT 544 - Iowa State University February 14, 2018 Jarad Niemi (STAT544@ISU) Hierarchical models February 14, 2018 1 / 38 Outline Motivating example Independent vs pooled

More information

MIT /30 Gelman, Carpenter, Hoffman, Guo, Goodrich, Lee,... Stan for Bayesian data analysis

MIT /30 Gelman, Carpenter, Hoffman, Guo, Goodrich, Lee,... Stan for Bayesian data analysis MIT 1985 1/30 Stan: a program for Bayesian data analysis with complex models Andrew Gelman, Bob Carpenter, and Matt Hoffman, Jiqiang Guo, Ben Goodrich, and Daniel Lee Department of Statistics, Columbia

More information

Introduction to Stan for Markov Chain Monte Carlo

Introduction to Stan for Markov Chain Monte Carlo Introduction to Stan for Markov Chain Monte Carlo Matthew Simpson Department of Statistics, University of Missouri April 25, 2017 These slides and accompanying R and Stan files are available at http://stsn.missouri.edu/education-and-outreach.shtml

More information

Bayesian Estimation of Regression Models

Bayesian Estimation of Regression Models Bayesian Estimation of Regression Models An Appendix to Fox & Weisberg An R Companion to Applied Regression, third edition John Fox last revision: 2018-10-01 Abstract In this appendix to Fox and Weisberg

More information

MS&E 226: Small Data

MS&E 226: Small Data MS&E 226: Small Data Lecture 2: Linear Regression (v3) Ramesh Johari rjohari@stanford.edu September 29, 2017 1 / 36 Summarizing a sample 2 / 36 A sample Suppose Y = (Y 1,..., Y n ) is a sample of real-valued

More information

Generalized Linear Models

Generalized Linear Models Generalized Linear Models STAT 489-01: Bayesian Methods of Data Analysis Spring Semester 2017 Contents 1 Multi-Variable Linear Models 1 2 Generalized Linear Models 4 2.1 Illustration: Logistic Regression..........

More information

Running head: BAYESIAN LINEAR MIXED MODELS: A TUTORIAL 1. Bayesian linear mixed models using Stan: A tutorial for psychologists, linguists, and

Running head: BAYESIAN LINEAR MIXED MODELS: A TUTORIAL 1. Bayesian linear mixed models using Stan: A tutorial for psychologists, linguists, and Running head: BAYESIAN LINEAR MIXED MODELS: A TUTORIAL 1 Bayesian linear mixed models using Stan: A tutorial for psychologists, linguists, and cognitive scientists Tanner Sorensen University of Potsdam,

More information

MS&E 226. In-Class Midterm Examination Solutions Small Data October 20, 2015

MS&E 226. In-Class Midterm Examination Solutions Small Data October 20, 2015 MS&E 226 In-Class Midterm Examination Solutions Small Data October 20, 2015 PROBLEM 1. Alice uses ordinary least squares to fit a linear regression model on a dataset containing outcome data Y and covariates

More information

1 The Classic Bivariate Least Squares Model

1 The Classic Bivariate Least Squares Model Review of Bivariate Linear Regression Contents 1 The Classic Bivariate Least Squares Model 1 1.1 The Setup............................... 1 1.2 An Example Predicting Kids IQ................. 1 2 Evaluating

More information

(Moderately) Advanced Hierarchical Models

(Moderately) Advanced Hierarchical Models (Moderately) Advanced Hierarchical Models Ben Goodrich StanCon: January 12, 2018 Ben Goodrich Advanced Hierarchical Models StanCon 1 / 18 Obligatory Disclosure Ben is an employee of Columbia University,

More information

36-463/663: Multilevel & Hierarchical Models

36-463/663: Multilevel & Hierarchical Models 36-463/663: Multilevel & Hierarchical Models Regression Basics Brian Junker 132E Baker Hall brian@stat.cmu.edu 1 Reading and HW Reading: G&H Ch s3-4 for today and next Tues G&H Ch s5-6 starting next Thur

More information

Bayesian linear mixed models using Stan: A tutorial for psychologists, linguists, and cognitive scientists

Bayesian linear mixed models using Stan: A tutorial for psychologists, linguists, and cognitive scientists BAYESIAN LINEAR MIXED MODELS: A TUTORIAL 1 Bayesian linear mixed models using Stan: A tutorial for psychologists, linguists, and cognitive scientists Tanner Sorensen University of Potsdam, Potsdam, Germany

More information

MS&E 226: Small Data

MS&E 226: Small Data MS&E 226: Small Data Lecture 3: More on linear regression (v3) Ramesh Johari ramesh.johari@stanford.edu 1 / 59 Recap: Linear regression 2 / 59 The linear regression model Given: n outcomes Y i, i = 1,...,

More information

X t P oisson(λ) (16.1)

X t P oisson(λ) (16.1) Chapter 16 Stan 16.1 Discoveries data revisited The file evaluation_discoveries.csv contains data on the numbers of great inventions and scientific discoveries (X t ) in each year from 1860 to 1959 [1].

More information

Hierarchical Linear Models

Hierarchical Linear Models Hierarchical Linear Models Statistics 220 Spring 2005 Copyright c 2005 by Mark E. Irwin The linear regression model Hierarchical Linear Models y N(Xβ, Σ y ) β σ 2 p(β σ 2 ) σ 2 p(σ 2 ) can be extended

More information

BAYESIAN INFERENCE IN STAN

BAYESIAN INFERENCE IN STAN BAYESIAN INFERENCE IN STAN DANIEL LEE bearlee@alum.mit.edu http://mc-stan.org OBLIGATORY DISCLOSURE I am a researcher at Columbia University. I am a cofounder of Stan Group Inc. and have equity. I am required

More information

Spatial Smoothing in Stan: Conditional Auto-Regressive Models

Spatial Smoothing in Stan: Conditional Auto-Regressive Models Spatial Smoothing in Stan: Conditional Auto-Regressive Models Charles DiMaggio, PhD, NYU School of Medicine Stephen J. Mooney, PhD, University of Washington Mitzi Morris, Columbia University Dan Simpson,

More information

Pooling and Hierarchical Modeling of Repeated Binary Trial Data with Stan

Pooling and Hierarchical Modeling of Repeated Binary Trial Data with Stan Pooling and Hierarchical Modeling of Repeated Binary Trial Data with Stan Stan Development Team (in order of joining): Andrew Gelman, Bob Carpenter, (Matt Hoffman), Daniel Lee, Ben Goodrich, Michael Betancourt,

More information

2017 SISG Bayesian Statistics for Genetics R Notes: Generalized Linear Modeling

2017 SISG Bayesian Statistics for Genetics R Notes: Generalized Linear Modeling 2017 SISG Bayesian Statistics for Genetics R Notes: Generalized Linear Modeling Jon Wakefield Departments of Statistics and Biostatistics, University of Washington 2017-09-05 Overview In this set of notes

More information

36-463/663: Multilevel & Hierarchical Models HW09 Solution

36-463/663: Multilevel & Hierarchical Models HW09 Solution 36-463/663: Multilevel & Hierarchical Models HW09 Solution November 15, 2016 Quesion 1 Following the derivation given in class, when { n( x µ) 2 L(µ) exp, f(p) exp 2σ 2 0 ( the posterior is also normally

More information

36-463/663Multilevel and Hierarchical Models

36-463/663Multilevel and Hierarchical Models 36-463/663Multilevel and Hierarchical Models From Bayes to MCMC to MLMs Brian Junker 132E Baker Hall brian@stat.cmu.edu 1 Outline Bayesian Statistics and MCMC Distribution of Skill Mastery in a Population

More information

Online Appendix: Bayesian versus maximum likelihood estimation of treatment effects in bivariate probit instrumental variable models

Online Appendix: Bayesian versus maximum likelihood estimation of treatment effects in bivariate probit instrumental variable models Online Appendix: Bayesian versus maximum likelihood estimation of treatment effects in bivariate probit instrumental variable models A. STAN CODE // STAN code for Bayesian bivariate model // based on code

More information

Bayesian Regression for a Dirichlet Distributed Response using Stan

Bayesian Regression for a Dirichlet Distributed Response using Stan Bayesian Regression for a Dirichlet Distributed Response using Stan Holger Sennhenn-Reulen 1 1 Department of Growth and Yield, Northwest German Forest Research Institute, Göttingen, Germany arxiv:1808.06399v1

More information

ri c B(p c i, n c i) (17.1) ri t B(p t i, n t i) (17.2)

ri c B(p c i, n c i) (17.1) ri t B(p t i, n t i) (17.2) Chapter 17 Hierarchical models 17.1 A meta-analysis of beta blocker trials Table 17.1 shows the results of some of the 22 trials included in a meta-analysis of clinical trial data on the effect of beta-blockers

More information

Have I Converged? Diagnosis and Remediation

Have I Converged? Diagnosis and Remediation Have I Converged? Diagnosis and Remediation Bob Carpenter Columbia University Stan 2.17 (January 2018) http://mc-stan.org Computation Target Expectations of Function of R.V. Suppose f (θ) is a function

More information

Modeling kid s test scores (revisited) Lecture 20 - Model Selection. Model output. Backward-elimination

Modeling kid s test scores (revisited) Lecture 20 - Model Selection. Model output. Backward-elimination Modeling kid s test scores (revisited) Lecture 20 - Model Selection Sta102 / BME102 Colin Rundel November 17, 2014 Predicting cognitive test scores of three- and four-year-old children using characteristics

More information

Stan: a Probabilistic Programming Language. Stan Development Team (in order of joining):

Stan: a Probabilistic Programming Language. Stan Development Team (in order of joining): Stan: a Probabilistic Programming Language Stan Development Team (in order of joining): Andrew Gelman, Bob Carpenter, Daniel Lee, Ben Goodrich, Michael Betancourt, Marcus Brubaker, Jiqiang Guo, Allen Riddell,

More information

Contents. Part I: Fundamentals of Bayesian Inference 1

Contents. Part I: Fundamentals of Bayesian Inference 1 Contents Preface xiii Part I: Fundamentals of Bayesian Inference 1 1 Probability and inference 3 1.1 The three steps of Bayesian data analysis 3 1.2 General notation for statistical inference 4 1.3 Bayesian

More information

I-priors in Bayesian Variable Selection: From Reproducing Kernel Hilbert Spaces to Hamiltonian Monte Carlo

I-priors in Bayesian Variable Selection: From Reproducing Kernel Hilbert Spaces to Hamiltonian Monte Carlo I-priors in Bayesian Variable Selection: From Reproducing Kernel Hilbert Spaces to Hamiltonian Monte Carlo Haziq Jamil Social Statistics (Year 3) London School of Economics & Political Science 3 November

More information

Bayesian course - problem set 5 (lecture 6)

Bayesian course - problem set 5 (lecture 6) Bayesian course - problem set 5 (lecture 6) Ben Lambert November 30, 2016 1 Stan entry level: discoveries data The file prob5 discoveries.csv contains data on the numbers of great inventions and scientific

More information

Hamiltonian Monte Carlo

Hamiltonian Monte Carlo Hamiltonian Monte Carlo within Stan Daniel Lee Columbia University, Statistics Department bearlee@alum.mit.edu BayesComp mc-stan.org Why MCMC? Have data. Have a rich statistical model. No analytic solution.

More information

(5) Multi-parameter models - Gibbs sampling. ST440/540: Applied Bayesian Analysis

(5) Multi-parameter models - Gibbs sampling. ST440/540: Applied Bayesian Analysis Summarizing a posterior Given the data and prior the posterior is determined Summarizing the posterior gives parameter estimates, intervals, and hypothesis tests Most of these computations are integrals

More information

Linear regression: before and after fitting the model

Linear regression: before and after fitting the model CHAPTER 4 Linear regression: before and after fitting the model It is not always appropriate to fit a classical linear regression model using data in their raw form. As we discuss in Sections 4.1 and 4.4,

More information

4 Acknowledgements 30

4 Acknowledgements 30 A Tutorial on Hidden Markov Models using Stan Luis Damiano (Universidad Nacional de Rosario), Brian Peterson (University of Washington), Michael Weylandt (Rice University) 2017-12-15 Contents 1 The Hidden

More information

lm statistics Chris Parrish

lm statistics Chris Parrish lm statistics Chris Parrish 2017-04-01 Contents s e and R 2 1 experiment1................................................. 2 experiment2................................................. 3 experiment3.................................................

More information

Preferences in college applications

Preferences in college applications Preferences in college applications A non-parametric Bayesian analysis of top-10 rankings Alnur Ali 1 Thomas Brendan Murphy 2 Marina Meilă 3 Harr Chen 4 1 Microsoft 2 University College Dublin 3 University

More information

WinBUGS : part 2. Bruno Boulanger Jonathan Jaeger Astrid Jullion Philippe Lambert. Gabriele, living with rheumatoid arthritis

WinBUGS : part 2. Bruno Boulanger Jonathan Jaeger Astrid Jullion Philippe Lambert. Gabriele, living with rheumatoid arthritis WinBUGS : part 2 Bruno Boulanger Jonathan Jaeger Astrid Jullion Philippe Lambert Gabriele, living with rheumatoid arthritis Agenda 2! Hierarchical model: linear regression example! R2WinBUGS Linear Regression

More information

Computational Methods

Computational Methods Computational Methods STAT 489-0: Bayesian Methods of Data Analysis Spring Semester 207 Contents Importance Sampling 2 2 Markov Chain Monte Carlo 2 2. Metropolis and Metropolis-Hastings Algorithms. 3 2..

More information

Robust Bayesian Regression

Robust Bayesian Regression Readings: Hoff Chapter 9, West JRSSB 1984, Fúquene, Pérez & Pericchi 2015 Duke University November 17, 2016 Body Fat Data: Intervals w/ All Data Response % Body Fat and Predictor Waist Circumference 95%

More information

Principles of Bayesian Inference

Principles of Bayesian Inference Principles of Bayesian Inference Sudipto Banerjee University of Minnesota July 20th, 2008 1 Bayesian Principles Classical statistics: model parameters are fixed and unknown. A Bayesian thinks of parameters

More information

Measurement error as missing data: the case of epidemiologic assays. Roderick J. Little

Measurement error as missing data: the case of epidemiologic assays. Roderick J. Little Measurement error as missing data: the case of epidemiologic assays Roderick J. Little Outline Discuss two related calibration topics where classical methods are deficient (A) Limit of quantification methods

More information

BEGINNING BAYES IN R. Comparing two proportions

BEGINNING BAYES IN R. Comparing two proportions BEGINNING BAYES IN R Comparing two proportions Learning about many parameters Chapters 2-3: single parameter (one proportion or one mean) Chapter 4: multiple parameters Two proportions from independent

More information

Modelling HDD Failure Rates with Bayesian Inference

Modelling HDD Failure Rates with Bayesian Inference Modelling HDD Failure Rates with Bayesian Inference Sašo Stanovnik sstanovnik@gmail.com Mentor: prof. Erik Štrumbelj, PhD erik.strumbelj@fri.uni-lj.si Faculty of Computer and Information Science University

More information

Lec 10: Bayesian Statistics for Genetics Imputation and software

Lec 10: Bayesian Statistics for Genetics Imputation and software Lec 10: Bayesian Statistics for Genetics Imputation and software Ken Rice Swiss Institute in Statistical Genetics September, 2017 Overview In this final session: Overview of imputation where Bayesian (or

More information

Bayesian Estimation of Expected Cell Counts by Using R

Bayesian Estimation of Expected Cell Counts by Using R Bayesian Estimation of Expected Cell Counts by Using R Haydar Demirhan 1 and Canan Hamurkaroglu 2 Department of Statistics, Hacettepe University, Beytepe, 06800, Ankara, Turkey Abstract In this article,

More information

arxiv: v1 [stat.me] 20 Jun 2015

arxiv: v1 [stat.me] 20 Jun 2015 arxiv:1506.06201v1 [stat.me] 20 Jun 2015 Bayesian linear mixed models using Stan: A tutorial for psychologists, linguists, and cognitive scientists Tanner Sorensen 1 and Shravan Vasishth 1,2 1: Department

More information

MULTILEVEL IMPUTATION 1

MULTILEVEL IMPUTATION 1 MULTILEVEL IMPUTATION 1 Supplement B: MCMC Sampling Steps and Distributions for Two-Level Imputation This document gives technical details of the full conditional distributions used to draw regression

More information

Ages of stellar populations from color-magnitude diagrams. Paul Baines. September 30, 2008

Ages of stellar populations from color-magnitude diagrams. Paul Baines. September 30, 2008 Ages of stellar populations from color-magnitude diagrams Paul Baines Department of Statistics Harvard University September 30, 2008 Context & Example Welcome! Today we will look at using hierarchical

More information

Lecturer: David Blei Lecture #3 Scribes: Jordan Boyd-Graber and Francisco Pereira October 1, 2007

Lecturer: David Blei Lecture #3 Scribes: Jordan Boyd-Graber and Francisco Pereira October 1, 2007 COS 597C: Bayesian Nonparametrics Lecturer: David Blei Lecture # Scribes: Jordan Boyd-Graber and Francisco Pereira October, 7 Gibbs Sampling with a DP First, let s recapitulate the model that we re using.

More information

A Comparison of Two MCMC Algorithms for Hierarchical Mixture Models

A Comparison of Two MCMC Algorithms for Hierarchical Mixture Models A Comparison of Two MCMC Algorithms for Hierarchical Mixture Models Russell Almond Florida State University College of Education Educational Psychology and Learning Systems ralmond@fsu.edu BMAW 2014 1

More information

DAG models and Markov Chain Monte Carlo methods a short overview

DAG models and Markov Chain Monte Carlo methods a short overview DAG models and Markov Chain Monte Carlo methods a short overview Søren Højsgaard Institute of Genetics and Biotechnology University of Aarhus August 18, 2008 Printed: August 18, 2008 File: DAGMC-Lecture.tex

More information

Bayesian Inference on Joint Mixture Models for Survival-Longitudinal Data with Multiple Features. Yangxin Huang

Bayesian Inference on Joint Mixture Models for Survival-Longitudinal Data with Multiple Features. Yangxin Huang Bayesian Inference on Joint Mixture Models for Survival-Longitudinal Data with Multiple Features Yangxin Huang Department of Epidemiology and Biostatistics, COPH, USF, Tampa, FL yhuang@health.usf.edu January

More information

Bayesian Linear Regression

Bayesian Linear Regression Bayesian Linear Regression Sudipto Banerjee 1 Biostatistics, School of Public Health, University of Minnesota, Minneapolis, Minnesota, U.S.A. September 15, 2010 1 Linear regression models: a Bayesian perspective

More information

arxiv: v2 [stat.co] 5 Jan 2018

arxiv: v2 [stat.co] 5 Jan 2018 bridgesampling: An R Package for Estimating Normalizing Constants Quentin F. Gronau University of Amsterdam Henrik Singmann University of Zurich Eric-Jan Wagenmakers University of Amsterdam Abstract arxiv:1710.08162v2

More information

David Giles Bayesian Econometrics

David Giles Bayesian Econometrics David Giles Bayesian Econometrics 8. The Metropolis-Hastings Algorithm W. Keith Hastings, 1930 - Ph.D., U of T (1962) UVic Math. & Stats., 1971-1992 (Nicholas Metropolis, 1915 1999) 1 A generalization

More information

Bayesian Networks in Educational Assessment

Bayesian Networks in Educational Assessment Bayesian Networks in Educational Assessment Estimating Parameters with MCMC Bayesian Inference: Expanding Our Context Roy Levy Arizona State University Roy.Levy@asu.edu 2017 Roy Levy MCMC 1 MCMC 2 Posterior

More information

Bayesian linear regression

Bayesian linear regression Bayesian linear regression Linear regression is the basis of most statistical modeling. The model is Y i = X T i β + ε i, where Y i is the continuous response X i = (X i1,..., X ip ) T is the corresponding

More information

Inference for a Population Proportion

Inference for a Population Proportion Al Nosedal. University of Toronto. November 11, 2015 Statistical inference is drawing conclusions about an entire population based on data in a sample drawn from that population. From both frequentist

More information

Supplementary Information for Ecology of conflict: marine food supply affects human-wildlife interactions on land

Supplementary Information for Ecology of conflict: marine food supply affects human-wildlife interactions on land 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Supplementary Information for Ecology of conflict: marine food supply affects human-wildlife interactions on land Kyle A. Artelle, Sean C. Anderson, John D. Reynolds,

More information

A Study into Mechanisms of Attitudinal Scale Conversion: A Randomized Stochastic Ordering Approach

A Study into Mechanisms of Attitudinal Scale Conversion: A Randomized Stochastic Ordering Approach A Study into Mechanisms of Attitudinal Scale Conversion: A Randomized Stochastic Ordering Approach Zvi Gilula (Hebrew University) Robert McCulloch (Arizona State) Ya acov Ritov (University of Michigan)

More information

Paper 1MA1: 2H Question Working Answer Notes 1 11 M1 For isolating term in t, eg. 3t = w 11 or. dividing all terms by 3, eg.

Paper 1MA1: 2H Question Working Answer Notes 1 11 M1 For isolating term in t, eg. 3t = w 11 or. dividing all terms by 3, eg. Pearson Edexcel Level 1/Level 2 GCSE (9-1) in Mathematics - 1 11 For isolating term in t, eg. 3t = w 11 or = 3 dividing all terms y 3, eg. = 3 3 3 3 for = 11 oe 3 2 Jardins of Paris 3 Mean of 96 or net

More information

PIER HLM Course July 30, 2011 Howard Seltman. Discussion Guide for Bayes and BUGS

PIER HLM Course July 30, 2011 Howard Seltman. Discussion Guide for Bayes and BUGS PIER HLM Course July 30, 2011 Howard Seltman Discussion Guide for Bayes and BUGS 1. Classical Statistics is based on parameters as fixed unknown values. a. The standard approach is to try to discover,

More information

27 : Distributed Monte Carlo Markov Chain. 1 Recap of MCMC and Naive Parallel Gibbs Sampling

27 : Distributed Monte Carlo Markov Chain. 1 Recap of MCMC and Naive Parallel Gibbs Sampling 10-708: Probabilistic Graphical Models 10-708, Spring 2014 27 : Distributed Monte Carlo Markov Chain Lecturer: Eric P. Xing Scribes: Pengtao Xie, Khoa Luu In this scribe, we are going to review the Parallel

More information

Package horseshoe. November 8, 2016

Package horseshoe. November 8, 2016 Title Implementation of the Horseshoe Prior Version 0.1.0 Package horseshoe November 8, 2016 Description Contains functions for applying the horseshoe prior to highdimensional linear regression, yielding

More information

Fitting linear mixed models using JAGS and Stan: Atutorial. Tanner Sorensen Department of Linguistics, University of Potsdam, Germany DRAFT

Fitting linear mixed models using JAGS and Stan: Atutorial. Tanner Sorensen Department of Linguistics, University of Potsdam, Germany DRAFT Fitting linear mixed models using JAGS and Stan: Atutorial Tanner Sorensen Department of Linguistics, University of Potsdam, Germany Shravan Vasishth Department of Linguistics, University of Potsdam, Germany

More information

Package zic. August 22, 2017

Package zic. August 22, 2017 Package zic August 22, 2017 Version 0.9.1 Date 2017-08-22 Title Bayesian Inference for Zero-Inflated Count Models Author Markus Jochmann Maintainer Markus Jochmann

More information

Computational statistics

Computational statistics Computational statistics Markov Chain Monte Carlo methods Thierry Denœux March 2017 Thierry Denœux Computational statistics March 2017 1 / 71 Contents of this chapter When a target density f can be evaluated

More information

Markov Chain Monte Carlo methods

Markov Chain Monte Carlo methods Markov Chain Monte Carlo methods By Oleg Makhnin 1 Introduction a b c M = d e f g h i 0 f(x)dx 1.1 Motivation 1.1.1 Just here Supresses numbering 1.1.2 After this 1.2 Literature 2 Method 2.1 New math As

More information

Fast hierarchical Gaussian processes

Fast hierarchical Gaussian processes Fast hierarchical Gaussian processes Seth Flaxman CMU Andrew Gelman Columbia Daniel Neill CMU Alex Smola CMU Aki Vehtari Aalto University Andrew Gordon Wilson CMU Abstract While the framework of Gaussian

More information

Joint longitudinal and time-to-event models via Stan

Joint longitudinal and time-to-event models via Stan Joint longitudinal and time-to-event models via Stan Sam Brilleman 1,2, Michael J. Crowther 3, Margarita Moreno-Betancur 2,4,5, Jacqueline Buros Novik 6, Rory Wolfe 1,2 StanCon 2018 Pacific Grove, California,

More information

Hmms with variable dimension structures and extensions

Hmms with variable dimension structures and extensions Hmm days/enst/january 21, 2002 1 Hmms with variable dimension structures and extensions Christian P. Robert Université Paris Dauphine www.ceremade.dauphine.fr/ xian Hmm days/enst/january 21, 2002 2 1 Estimating

More information

Statistical Inference for Stochastic Epidemic Models

Statistical Inference for Stochastic Epidemic Models Statistical Inference for Stochastic Epidemic Models George Streftaris 1 and Gavin J. Gibson 1 1 Department of Actuarial Mathematics & Statistics, Heriot-Watt University, Riccarton, Edinburgh EH14 4AS,

More information

BUGS Bayesian inference Using Gibbs Sampling

BUGS Bayesian inference Using Gibbs Sampling BUGS Bayesian inference Using Gibbs Sampling Glen DePalma Department of Statistics May 30, 2013 www.stat.purdue.edu/~gdepalma 1 / 20 Bayesian Philosophy I [Pearl] turned Bayesian in 1971, as soon as I

More information

Down by the Bayes, where the Watermelons Grow

Down by the Bayes, where the Watermelons Grow Down by the Bayes, where the Watermelons Grow A Bayesian example using SAS SUAVe: Victoria SAS User Group Meeting November 21, 2017 Peter K. Ott, M.Sc., P.Stat. Strategic Analysis 1 Outline 1. Motivating

More information

Bayesian Methods for Machine Learning

Bayesian Methods for Machine Learning Bayesian Methods for Machine Learning CS 584: Big Data Analytics Material adapted from Radford Neal s tutorial (http://ftp.cs.utoronto.ca/pub/radford/bayes-tut.pdf), Zoubin Ghahramni (http://hunch.net/~coms-4771/zoubin_ghahramani_bayesian_learning.pdf),

More information

Advanced Statistical Modelling

Advanced Statistical Modelling Markov chain Monte Carlo (MCMC) Methods and Their Applications in Bayesian Statistics School of Technology and Business Studies/Statistics Dalarna University Borlänge, Sweden. Feb. 05, 2014. Outlines 1

More information

Heriot-Watt University

Heriot-Watt University Heriot-Watt University Heriot-Watt University Research Gateway Prediction of settlement delay in critical illness insurance claims by using the generalized beta of the second kind distribution Dodd, Erengul;

More information

The Central Limit Theorem

The Central Limit Theorem The Central Limit Theorem Suppose n tickets are drawn at random with replacement from a box of numbered tickets. The central limit theorem says that when the probability histogram for the sum of the draws

More information

Linear Regression In God we trust, all others bring data. William Edwards Deming

Linear Regression In God we trust, all others bring data. William Edwards Deming Linear Regression ddebarr@uw.edu 2017-01-19 In God we trust, all others bring data. William Edwards Deming Course Outline 1. Introduction to Statistical Learning 2. Linear Regression 3. Classification

More information

correct process to convert one price to another currecncy, eg comparison made. same currency

correct process to convert one price to another currecncy, eg comparison made. same currency 1 tt = ww 11 3 For isolating term in t, eg. 3t = w 11 or dividing all terms y 3, eg. ww = 3tt + 11 3 3 3 for tt = ww 11 oe 3 2 Jardins of Paris correct process to convert one price to another currecncy,

More information

Bayesian Linear Models

Bayesian Linear Models Bayesian Linear Models Sudipto Banerjee September 03 05, 2017 Department of Biostatistics, Fielding School of Public Health, University of California, Los Angeles Linear Regression Linear regression is,

More information

Markov Chain Monte Carlo Lecture 6

Markov Chain Monte Carlo Lecture 6 Sequential parallel tempering With the development of science and technology, we more and more need to deal with high dimensional systems. For example, we need to align a group of protein or DNA sequences

More information

DIRECTED NUMBERS ADDING AND SUBTRACTING DIRECTED NUMBERS

DIRECTED NUMBERS ADDING AND SUBTRACTING DIRECTED NUMBERS DIRECTED NUMBERS POSITIVE NUMBERS These are numbers such as: 3 which can be written as +3 46 which can be written as +46 14.67 which can be written as +14.67 a which can be written as +a RULE Any number

More information

ntopic Organic Traffic Study

ntopic Organic Traffic Study ntopic Organic Traffic Study 1 Abstract The objective of this study is to determine whether content optimization solely driven by ntopic recommendations impacts organic search traffic from Google. The

More information

2.Draw each angle in standard position. Name the quadrant in which the angle lies. 2. Which point(s) lies on the unit circle? Explain how you know.

2.Draw each angle in standard position. Name the quadrant in which the angle lies. 2. Which point(s) lies on the unit circle? Explain how you know. Chapter Review Section.1 Extra Practice 1.Draw each angle in standard position. In what quadrant does each angle lie? a) 1 b) 70 c) 110 d) 00.Draw each angle in standard position. Name the quadrant in

More information

Bayesian course - problem set 6 (lecture 7)

Bayesian course - problem set 6 (lecture 7) Bayesian course - problem set 6 (lecture 7) Ben Lambert December 7, 2016 1 A meta-analysis of beta blocker trials Table 1 shows the results of some of the 22 trials included in a meta-analysis of clinical

More information

Markov Chain Monte Carlo

Markov Chain Monte Carlo Markov Chain Monte Carlo (and Bayesian Mixture Models) David M. Blei Columbia University October 14, 2014 We have discussed probabilistic modeling, and have seen how the posterior distribution is the critical

More information

Case Study in the Use of Bayesian Hierarchical Modeling and Simulation for Design and Analysis of a Clinical Trial

Case Study in the Use of Bayesian Hierarchical Modeling and Simulation for Design and Analysis of a Clinical Trial Case Study in the Use of Bayesian Hierarchical Modeling and Simulation for Design and Analysis of a Clinical Trial William R. Gillespie Pharsight Corporation Cary, North Carolina, USA PAGE 2003 Verona,

More information

Timevarying VARs. Wouter J. Den Haan London School of Economics. c Wouter J. Den Haan

Timevarying VARs. Wouter J. Den Haan London School of Economics. c Wouter J. Den Haan Timevarying VARs Wouter J. Den Haan London School of Economics c Wouter J. Den Haan Time-Varying VARs Gibbs-Sampler general idea probit regression application (Inverted Wishart distribution Drawing from

More information

Analyzing the genetic structure of populations: a Bayesian approach

Analyzing the genetic structure of populations: a Bayesian approach Analyzing the genetic structure of populations: a Bayesian approach Introduction Our review of Nei s G st and Weir and Cockerham s θ illustrated two important principles: 1. It s essential to distinguish

More information

On Markov chain Monte Carlo methods for tall data

On Markov chain Monte Carlo methods for tall data On Markov chain Monte Carlo methods for tall data Remi Bardenet, Arnaud Doucet, Chris Holmes Paper review by: David Carlson October 29, 2016 Introduction Many data sets in machine learning and computational

More information

Appendix: Modeling Approach

Appendix: Modeling Approach AFFECTIVE PRIMACY IN INTRAORGANIZATIONAL TASK NETWORKS Appendix: Modeling Approach There is now a significant and developing literature on Bayesian methods in social network analysis. See, for instance,

More information

Exercises, II part Exercises, II part

Exercises, II part Exercises, II part Inference: 12 Jul 2012 Consider the following Joint Probability Table for the three binary random variables A, B, C. Compute the following queries: 1 P(C A=T,B=T) 2 P(C A=T) P(A, B, C) A B C 0.108 T T

More information

A Search and Jump Algorithm for Markov Chain Monte Carlo Sampling. Christopher Jennison. Adriana Ibrahim. Seminar at University of Kuwait

A Search and Jump Algorithm for Markov Chain Monte Carlo Sampling. Christopher Jennison. Adriana Ibrahim. Seminar at University of Kuwait A Search and Jump Algorithm for Markov Chain Monte Carlo Sampling Christopher Jennison Department of Mathematical Sciences, University of Bath, UK http://people.bath.ac.uk/mascj Adriana Ibrahim Institute

More information

NONPARAMETRIC HIERARCHICAL BAYES VIA SEQUENTIAL IMPUTATIONS 1. By Jun S. Liu Stanford University

NONPARAMETRIC HIERARCHICAL BAYES VIA SEQUENTIAL IMPUTATIONS 1. By Jun S. Liu Stanford University The Annals of Statistics 996, Vol. 24, No. 3, 9 930 NONPARAMETRIC HIERARCHICAL BAYES VIA SEQUENTIAL IMPUTATIONS By Jun S. Liu Stanford University We consider the empirical Bayes estimation of a distribution

More information

Gibbs Sampling in Latent Variable Models #1

Gibbs Sampling in Latent Variable Models #1 Gibbs Sampling in Latent Variable Models #1 Econ 690 Purdue University Outline 1 Data augmentation 2 Probit Model Probit Application A Panel Probit Panel Probit 3 The Tobit Model Example: Female Labor

More information