Metric Predicted Variable on One Group
|
|
- Beatrice Fleming
- 5 years ago
- Views:
Transcription
1 Metric Predicted Variable on One Group Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more information.
2 Prior Homework
3 Prior Homework As a preface to today, have students choose two papers and evaluate them (will come in handy later) 1. Choose two top journals in their field 2. Identify how many research papers are included in the most recent issues 3. Use R s sample function to randomly pick which of those papers to read/analyze
4 Prior Homework Once papers are chosen, read them and 1. Count how many p-values are reported 2. In what percentage of those is the confidence interval also reported? 3. In what percentage is the effect size, regression coefficient, or actual size of the difference between observed and expected values reported? 4. In what percentage is the biological significance discussed? 5. What percentage are naked p-values, with no other information (including graphics that would provide such information) Create a brief presentation to summarize your findings
5 First, Note on Tests vs Generalized Linear Models
6 Tests vs Generalized Linear Model In stats courses (or elsewhere), you likely learned different tests Each applicable in different situations t-test ANOVA ANCOVA Binomial Test Linear Regression Wilcoxon Rank-Sum Test Chi-Square Test Fisher s Exact Test etc.
7 Tests vs Generalized Linear Model In stats courses (or elsewhere), you likely learned different tests Each applicable in different situations Often, these are taught and/or learned as independent things Underlying principles not clear Memorization rather than understanding
8 A Secret They re all variations on a generalized linear model One set of underlying principles, different types of parameters
9 A Secret They re all variations on a generalized linear model One set of underlying principles, different types of parameters Once you understand basic principles, no need to memorize anything, just build an appropriate model!
10 Back to Metric Predicted Variable on One Group
11 Goals When would we use this type of analysis? Obtain parameter estimates and credible intervals for a given set of data To see if observed data fit some expected value Is the sex ratio of the population 50:50? Is the blood pressure of a certain group higher/lower than recommended value? Is the IQ of a certain group higher/lower than general population average of 100? etc.
12 Data
13 Data IQ data from 25 NSERC recipients*, ** Do they have higher IQs than the population average of 100? * Not real data. ** I do not currently have an NSERC grant
14 Data First let s get a feel for the data A very important thing to always do first iq <- read.table( IQdata.csv, header = TRUE, sep =, )
15 Data First let s get a feel for the data A very important thing to always do first iq <- read.table( IQdata.csv, header = TRUE, sep =, )
16 Data First, let s plot a histogram of the data hist(iq$iq) Histogram of iq$iq Frequency iq$iq
17 Data Let s make it look a little nicer hist(iq$iq, xlab = IQ, main =, col = steelblue )
18 Data Let s make it look a little nicer hist(iq$iq, xlab = IQ, main =, col = steelblue ) State explicitly what the x-axis label should be (could do the same thing for y- axis using ylab = )
19 Data Let s make it look a little nicer hist(iq$iq, xlab = IQ, main =, col = steelblue ) State explicitly what the main title should be. Here, we re specifying blank (no main label)
20 Data Let s make it look a little nicer hist(iq$iq, xlab = IQ, main =, col = steelblue ) Specify what fill colour you want
21 Data Let s make it look a little nicer hist(iq$iq, xlab = IQ, main =, col = steelblue ) Frequency IQ
22 Data Almost no end to the customization you can do with graphics (histograms in this case) in R See help file for more information?hist
23 Data Get data characteristics summary(iq$iq) Min. 1st Qu. Median Mean 3rd Qu. Max
24 Data Get data characteristics summary(iq$iq) Min. 1st Qu. Median Mean 3rd Qu. Max sd(iq$iq) [1]
25 Frequentist Approach
26 Frequentist Approach How would your normally analyze these data?
27 Frequentist Approach How would your normally analyze these data? Could use a one-sample t-test (t.test in R)
28 Frequentist Approach How would your normally analyze these data? Could use a one-sample t-test (t.test in R) Two-tailed test = Are the observed data different from the population average of 100 t.test(iq$iq, mu = 100)
29 Frequentist Approach How would your normally analyze these data? Could use a one-sample t-test (t.test in R) Two-tailed test = Are the observed data different from the population average of 100 t.test(iq$iq, mu = 100) One Sample t-test data: iq$iq t = 2.134, df = 24, p-value = alternative hypothesis: true mean is not equal to percent confidence interval: sample estimates: mean of x
30 Frequentist Approach How would your normally analyze these data? Could use a one-sample t-test (t.test in R) Two-tailed test = Are the observed data different from the population average of 100 One-tailed test = Are the observed data greater than the population average of 100 (our original question) t.test(iq$iq, mu = 100, alternative = c( greater ))
31 Frequentist Approach t.test(iq$iq, mu = 100, alternative = c( greater )) One Sample t-test data: iq$iq t = 2.134, df = 24, p-value = alternative hypothesis: true mean is greater than percent confidence interval: Inf sample estimates: mean of x
32 Frequentist Approach Let s think about how this may be reported in a paper, maybe something like The IQ of NSERC recipients is significantly higher than the population average of 100 (p < 0.05). Would the histogram be included? Would the actual average, confidence interval, or difference between observed and expected by included? Based on your analysis of the papers
33 Frequentist Approach Let s think about how this may be reported in a paper, maybe something like The IQ of NSERC recipients is significantly higher than the population average of 100 (p < 0.05). Would the histogram be included? Would the actual average, confidence interval, or difference between observed and expected by included? Is a mean of vs biologically important?
34 Frequentist Approach Let s think about how this may be reported in a paper, maybe something like The IQ of NSERC recipients is significantly higher than the population average of 100 (p < 0.05). Would the histogram be included? Would the actual average, confidence interval, or difference between observed and expected by included? Is a mean of vs biologically important? Hopefully you re starting to see how little information is provided by p-values, and how strange it is to base our understanding of the world on them.
35 Bayesian Approach
36 Standardize the Data Markov Chain will perform much better if we standardize the data first Also makes for clearer choice of priors Just need to convert it back to original scale prior to interpreting results! Mean will be 0, and sd will be ~1
37 Standardize the Data Markov Chain will perform much better if we standardize the data first Also makes for clearer choice of priors Just need to convert it back to original scale prior to interpreting results! each original x value each new standardized x value mean of x sd of x Mean will be 0, and sd will be ~1
38 Standardize the Data ym <- mean(iq$iq) ysd <- sd(iq$iq) zy <- (iq$iq - ym) / ysd mean(zy) [1] e-15 sd(zy) [1] 1
39 Standardize the Data hist(zy, main =, col = steelblue ) Frequency zy
40 Specify the model Yay - your first model! What distribution should we use? Frequency zy
41 Specify the model Equation
42 Specify the model Equation Normal distribution defined by two parameters (mean and sd) Want to understand the characteristics of this distribution
43 Specify the model Equation Normal distribution defined by two parameters (mean and sd) Want to understand the characteristics of this distribution Estimate the probabilities associated with these parameters taking different reasonable values
44 Specify the model Any parameter we are trying to estimate also needs a prior
45 Specify the model Any parameter we are trying to estimate also needs a prior µ τ = 1/σ 2 - norm y
46 Specify the model Any parameter we are trying to estimate also needs a prior What makes sense? µ τ = 1/σ 2 - norm y
47 Specify the model Any parameter we are trying to estimate also needs a prior µ τ = 1/σ 2 - norm µ τ = 1/σ 2 - norm y
48 Specify the model Any parameter we are trying to estimate also needs a prior 0 µ τ = 1/σ 2 - norm µ τ = 1/σ 2 - norm y
49 Specify the model Any parameter we are trying to estimate also needs a prior 0 10 µ τ = 1/σ 2 - norm µ τ = 1/σ 2 - norm y
50 Specify the model Any parameter we are trying to estimate also needs a prior 0 10 µ τ = 1/σ 2 - norm What makes sense? - µ τ = 1/σ 2 norm y
51 Specify the model Any parameter we are trying to estimate also needs a prior µ τ = 1/σ 2 - norm α gamma β Ranges from 0 to, Mode = 1, sd = 10 (see p in Kruschke (2015)) - µ τ = 1/σ 2 norm y
52 Specify the model y ~ dnorm(mu, sigma) mu ~ dnorm(0, 10) sigma ~ dgamma(1.1, 0.11)
53 Specify the model For JAGS, we actually need this as text in it s own file modelstring = model { # Likelihood for (i in 1:N) { y[i] ~ dnorm(mu, tau) } # Priors mu ~ dnorm(0, (1 / 10^2)) sigma ~ dgamma(1.1, 0.11) tau <- 1 / sigma^2 } writelines(modelstring, con = model.txt )
54 Specify the model For JAGS, we actually need this as text in it s own file Note that this value is not pulled from a distribution, but rather is modelstring = model { # Likelihood for (i in 1:N) { y[i] ~ dnorm(mu, tau) } # Priors mu ~ dnorm(0, (1 / 10^2)) sigma ~ dgamma(1.1, 0.11) tau <- 1 / sigma^2 } writelines(modelstring, con = model.txt ) calculated from existing values
55 Prepare Data for JAGS What information does JAGS need to run the model? modelstring = model { # Likelihood for (i in 1:N) { y[i] ~ dnorm(mu, tau) } # Priors mu ~ dnorm(0, (1 / 10^2)) sigma ~ dgamma(1.1, 0.11) tau <- 1 / sigma^2 } writelines(modelstring, con = model.txt )
56 Prepare Data for JAGS What information does JAGS need to run the model? modelstring = model { # Likelihood for (i in 1:N) { y[i] ~ dnorm(mu, tau) } Number of records (rows) in data set, as variable N (can be any label we want) # Priors mu ~ dnorm(0, (1 / 10^2)) sigma ~ dgamma(1.1, 0.11) tau <- 1 / sigma^2 } writelines(modelstring, con = model.txt )
57 Prepare Data for JAGS What information does JAGS need to run the model? modelstring = model { A vector of all of the values of data # Likelihood for (i in 1:N) { y[i] ~ dnorm(mu, tau) } # Priors mu ~ dnorm(0, (1 / 10^2)) sigma ~ dgamma(1.1, 0.11) tau <- 1 / sigma^2 } writelines(modelstring, con = model.txt )
58 Prepare Data for JAGS Specify as a list for JAGS datalist = list ( y = zy, N = length(zy) )
59 Specify Initial Values JAGS often performs better if you give it a starting point This can just be a draw from the prior Write a function that will save these as a list Note that these are for R, not JAGS initslist <- function() { list( mu = rnorm(n = 1, mean = 0, sd = 10), sigma = rgamma(n = 1, shape = 1.1, rate = 0.11) ) }
60 Specify MCMC Parameters and Run library(runjags) runjagsout <- run.jags( method = simple, model = model.txt, monitor = c( mu, sigma ), data = datalist, inits = initslist, n.chains = 3, adapt = 500, burnin = 1000, sample = 20000, thin = 1, summarise = TRUE, plots = FALSE)
61 Evaluate Performance of the Model
62 Testing Model Performance Are many ways of doing this, we ll use four: From the coda package (see manual for more options & details) 1. Trace plots 2. Autocorrelation plots 3. Gelman and Rubin Diagnostic 4. Effective chain length
63 Testing Model Performance First, load the coda package, and format data as an MCMC list library(coda) codasamples = as.mcmc.list(runjagsout)
64 Testing Model Performance codasamples is a list, with each chain as a separate mcmc list Let s use the head function to take a look at the first chain head(codasamples[[1]]) Markov Chain Monte Carlo (MCMC) output: Start = 1501 End = 1507 Thinning interval = 1 mu sigma
65 Testing Model Performance Trace plots Plots iteration # against value drawn for that iteration If chain is mixing well, should look like a wide mess that is consistent noise around a mean value - a spiky caterpillar
66 Testing Model Performance Trace plots Can plot one chain at a time par(mfrow = c(1,2)) traceplot(codasamples[[1]])
67 Testing Model Performance Trace plots Can plot one chain at a time par(mfrow = c(1,2)) traceplot(codasamples[[1]]) Change the plot parameters to include both plots in one figure. Specifies a plot area with 1 row (first term) and 2 columns (second term)
68 Testing Model Performance Trace plots...or all together (each as a different colour) traceplot(codasamples)
69 Testing Model Performance Autocorrelation plots If chain is mixing well, steps differing by one step should be the only ones showing real autocorrelation, whereas steps further apart should not Good Bad Autocorrelation Lag
70 Testing Model Performance Autocorrelation plots Can only assess one chain at a time (should all be similar though) autocorr.plot(codasamples[[1]]) mu sigma Autocorrelation Autocorrelation Lag Lag
71 Testing Model Performance Gelman & Rubin diagnostic Compares variance within vs between chains If chains mixing well, these should be the same (ratio = 1.0) If not, between-chain variance should be greater than within-chain variance (ratio > 1.0)
72 Testing Model Performance Gelman & Rubin diagnostic gelman.diag(codasamples) Potential scale reduction factors: Point est. Upper C.I. mu 1 1 sigma 1 1 Multivariate psrf 1
73 Testing Model Performance Effective chain length Estimate of the equivalent number of independent steps that the chain represents If steps show autocorrelation, this number will be low If not, estimate should be close to the full number of steps times the number of chains
74 Testing Model Performance Effective chain length effectivesize(codasamples) mu sigma
75 Viewing Results (already!)
76 Parsing Data Convert codasamples to a matrix Will concatenate chains into one long one mcmcchain = as.matrix(codasamples)
77 Parsing Data Convert codasamples to a matrix Will concatenate chains into one long one mcmcchain = as.matrix(codasamples) Separate out data for each parameter zmu <- mcmcchain[, "mu"] zsigma <- mcmcchain[, "sigma"]
78 Convert Back to Original Scale mu <- (zmu * ysd) + ym sigma <- zsigma * ysd
79 Plotting Posterior Distributions Will use 2 functions from Kruschke plotpost.r HDIofMCMC.R These need to be in R s working directory, then loaded source( plotpost.r )
80 Plotting Posterior Distributions Mean (mu) par(mfrow = c(1,1)) histinfo = plotpost(mu, xlab = bquote(mu)) mean = % HDI µ
81 Plotting Posterior Distributions Mean (mu) par(mfrow = c(1,1)) histinfo = plotpost(mu, xlab = bquote(mu)) Can change using the credmass argument. Nothing special about 95% anymore!!!! mean = % HDI µ
82 Plotting Posterior Distributions Mean (mu) par(mfrow = c(1,1)) histinfo = plotpost(mu, credmass = 0.89, xlab = bquote(mu)) mean = % HDI µ
83 Plotting Posterior Distributions Mean (mu) abline(v = 100, lty = 2, lwd = 2, col = red ) mean = % HDI µ
84 Plotting Posterior Distributions Standard deviation (sigma) histinfo = plotpost(sigma, xlab = bquote(sigma), showmode = TRUE) mode = % HDI σ
85 Plotting Posterior Distributions Standard deviation (sigma) histinfo = plotpost(sigma, xlab = bquote(sigma), showmode = TRUE) mode = Show mode instead of mean because distribution is skewed 95% HDI σ
86 Interpretation Distribution is clearly centred at a value > 100 Difference isn t too big though Useful information on which to base understanding mean = mode = % HDI µ 95% HDI σ
87 How Well Does Our Model Fit the Data? Posterior Predictive Check
88 Posterior Predictive Check Plot data Choose some values from the posterior and plot over data
89 Posterior Predictive Check histinfo = hist(iq$iq, xlab = "IQ", main = "", col = skyblue", prob = TRUE) Density IQ
90 Posterior Predictive Check Get range of values from observed distribution plot xlims = range(histinfo$breaks) xlims [1]
91 Posterior Predictive Check Get range of values from observed distribution plot xlims = range(histinfo$breaks) xlims [1] Create a sequence of 500 values within this range xsample = seq(from = xlims[1], to = xlims[2], length = 500)
92 Posterior Predictive Check Get length of posterior chainlength = length(mu)
93 Posterior Predictive Check Get length of posterior chainlength = length(mu) Get 20 values from this range (we ll draw 20 lines) xnew = floor(seq(from = 1, to = chainlength, length = 20))
94 Posterior Predictive Check Get length of posterior chainlength = length(mu) Get 20 values from this range (we ll draw 20 lines) xnew = floor(seq(from = 1, to = chainlength, length = 20)) Rounds values, but so that they won t be larger than upper limit
95 Posterior Predictive Check Loop through list and plot associated lines for (i in xnew) { lines(xsample, dnorm(xsample, mean = mu[i], sd = sigma[i]), col = gray47 ) } Density IQ
96 Were Priors Appropriate?
97 Assessing Priors Plot posterior distribution on top of priors Ensure priors cover range appropriately See how heavily posteriors are influenced by priors (and how much by the data)
98 Assessing Priors Will use transformed data, because that is what the model was based on
99 Assessing Priors Mean (mu) Make a list containing the range of values over which to evaluate performance Mean should be 0, with sd = 1, so a range from -2 to 2 should work mupriorlist <- seq(from = -2, to = 2, length = 500)
100 Assessing Priors Mean (mu) Then, generate priors using model parameters muprior <- dnorm(mupriorlist, mean = 0, sd = 10)
101 Assessing Priors Mean (mu) Get the distribution of the posterior using the density function mupost <- density(zmu)
102 Assessing Priors Mean (mu) Plot the priors muhigh <- ceiling(max(mupost$y)) plot(mupriorlist, muprior, ylim = c(0, muhigh), type = l, lty = 2, xlab = Possible Values, ylab = Probability, main = mu ) mu Probability Possible Values
103 Assessing Priors Mean (mu) Add the posterior and legend lines(mupost) legend( topleft, legend = c("prior", "Posterior"), lty = c(2, 1), bty = "n") mu Probability Prior Posterior Possible Values
104 Assessing Priors Standard deviation (sigma) Do the same thing with sigma sigmapriorlist <- seq(from = 0, to = 5, length = 500) sigmaprior <- dgamma(sigmapriorlist, shape = 1.1, rate = 0.11) sigmapost <- density(zsigma)
105 Assessing Priors Standard deviation (sigma) sigmahigh <- ceiling(max(sigmapost$y)) plot(sigmapriorlist, sigmaprior, ylim = c(0, sigmahigh), type = l, lty = 2, xlab = Possible Values, ylab = Probability, main = sigma ) lines(sigmapost) legend("topleft", legend = c("prior", "Posterior"), lty = c(2, 1), bty = "n")
106 Assessing Priors Standard deviation (sigma) sigma Probability Prior Posterior Possible Values
107 Questions?
108 Homework!!
109 Modify Model Based on a t-distribution t distribution less effected by outliers than the normal distribution (i.e., it is robust to outliers) Kruschke (2015) p. 460
110 Modify Model Based on a t-distribution Robust estimation Include all model testing, prior justification, and validation steps! Is a bit tricky to get scale correct for plotting lines on top of histogram
111 Modify Model Based on a t-distribution dt centred around 0 in R (not JAGS), so need to re-scale Remember, in JAGS dt(mu, tau, df) In R dt(x, df) mu and tau in JAGS don t have an equivalent in R Need to re-scale dt(mu, tau, df) in JAGS = sqrt(tau) * dt((x - mu) * sqrt(tau), df) in R
112 Modify Model Based on a t-distribution Relevant at this step Changing this as appropriate for a t- distribution
113 Creative Commons License Anyone is allowed to distribute, remix, tweak, and build upon this work, even commercially, as long as they credit me for the original creation. See the Creative Commons website for more information. Click here to go back to beginning
Metric Predicted Variable on Two Groups
Metric Predicted Variable on Two Groups Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more information. Goals
More informationMetric Predicted Variable With One Nominal Predictor Variable
Metric Predicted Variable With One Nominal Predictor Variable Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more
More informationHierarchical Modeling
Hierarchical Modeling Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more information. General Idea One benefit
More informationCount Predicted Variable & Contingency Tables
Count Predicted Variable & Contingency Tables Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more information.
More informationMultiple Regression: Mixed Predictor Types. Tim Frasier
Multiple Regression: Mixed Predictor Types Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more information. The
More informationMultiple Regression: Nominal Predictors. Tim Frasier
Multiple Regression: Nominal Predictors Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more information. Goals
More informationBayesian Statistics: An Introduction
: An Introduction Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more information. Outline 1. Bayesian statistics,
More informationWinBUGS : 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 information36-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 informationWhy Bayesian approaches? The average height of a rare plant
Why Bayesian approaches? The average height of a rare plant Estimation and comparison of averages is an important step in many ecological analyses and demographic models. In this demonstration you will
More informationBUGS 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 informationBayesian 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 informationR Demonstration ANCOVA
R Demonstration ANCOVA Objective: The purpose of this week s session is to demonstrate how to perform an analysis of covariance (ANCOVA) in R, and how to plot the regression lines for each level of the
More informationQuantitative Understanding in Biology 1.7 Bayesian Methods
Quantitative Understanding in Biology 1.7 Bayesian Methods Jason Banfelder October 25th, 2018 1 Introduction So far, most of the methods we ve looked at fall under the heading of classical, or frequentist
More informationIntroduction to R, Part I
Introduction to R, Part I Basic math, variables, and variable types Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here
More informationMarkov Chain Monte Carlo
Markov Chain Monte Carlo Recall: To compute the expectation E ( h(y ) ) we use the approximation E(h(Y )) 1 n n h(y ) t=1 with Y (1),..., Y (n) h(y). Thus our aim is to sample Y (1),..., Y (n) from f(y).
More informationMarkov chain Monte Carlo
Markov chain Monte Carlo Feng Li feng.li@cufe.edu.cn School of Statistics and Mathematics Central University of Finance and Economics Revised on April 24, 2017 Today we are going to learn... 1 Markov Chains
More information36-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 informationClass 04 - Statistical Inference
Class 4 - Statistical Inference Question 1: 1. What parameters control the shape of the normal distribution? Make some histograms of different normal distributions, in each, alter the parameter values
More informationCSC 2541: Bayesian Methods for Machine Learning
CSC 2541: Bayesian Methods for Machine Learning Radford M. Neal, University of Toronto, 2011 Lecture 3 More Markov Chain Monte Carlo Methods The Metropolis algorithm isn t the only way to do MCMC. We ll
More informationIntroduction to Bayesian Statistics and Markov Chain Monte Carlo Estimation. EPSY 905: Multivariate Analysis Spring 2016 Lecture #10: April 6, 2016
Introduction to Bayesian Statistics and Markov Chain Monte Carlo Estimation EPSY 905: Multivariate Analysis Spring 2016 Lecture #10: April 6, 2016 EPSY 905: Intro to Bayesian and MCMC Today s Class An
More informationPackage bpp. December 13, 2016
Type Package Package bpp December 13, 2016 Title Computations Around Bayesian Predictive Power Version 1.0.0 Date 2016-12-13 Author Kaspar Rufibach, Paul Jordan, Markus Abt Maintainer Kaspar Rufibach Depends
More informationDAG 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 informationBayesian Inference for Regression Parameters
Bayesian Inference for Regression Parameters 1 Bayesian inference for simple linear regression parameters follows the usual pattern for all Bayesian analyses: 1. Form a prior distribution over all unknown
More informationBayesian 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 informationPhysics 509: Bootstrap and Robust Parameter Estimation
Physics 509: Bootstrap and Robust Parameter Estimation Scott Oser Lecture #20 Physics 509 1 Nonparametric parameter estimation Question: what error estimate should you assign to the slope and intercept
More informationFirst steps of multivariate data analysis
First steps of multivariate data analysis November 28, 2016 Let s Have Some Coffee We reproduce the coffee example from Carmona, page 60 ff. This vignette is the first excursion away from univariate data.
More informationDeciding, Estimating, Computing, Checking
Deciding, Estimating, Computing, Checking How are Bayesian posteriors used, computed and validated? Fundamentalist Bayes: The posterior is ALL knowledge you have about the state Use in decision making:
More informationDeciding, Estimating, Computing, Checking. How are Bayesian posteriors used, computed and validated?
Deciding, Estimating, Computing, Checking How are Bayesian posteriors used, computed and validated? Fundamentalist Bayes: The posterior is ALL knowledge you have about the state Use in decision making:
More informationRobustness and Distribution Assumptions
Chapter 1 Robustness and Distribution Assumptions 1.1 Introduction In statistics, one often works with model assumptions, i.e., one assumes that data follow a certain model. Then one makes use of methodology
More informationMCMC Methods: Gibbs and Metropolis
MCMC Methods: Gibbs and Metropolis Patrick Breheny February 28 Patrick Breheny BST 701: Bayesian Modeling in Biostatistics 1/30 Introduction As we have seen, the ability to sample from the posterior distribution
More informationStat 5102 Notes: Markov Chain Monte Carlo and Bayesian Inference
Stat 5102 Notes: Markov Chain Monte Carlo and Bayesian Inference Charles J. Geyer April 6, 2009 1 The Problem This is an example of an application of Bayes rule that requires some form of computer analysis.
More informationStat 5102 Notes: Markov Chain Monte Carlo and Bayesian Inference
Stat 5102 Notes: Markov Chain Monte Carlo and Bayesian Inference Charles J. Geyer March 30, 2012 1 The Problem This is an example of an application of Bayes rule that requires some form of computer analysis.
More informationMarkov Chain Monte Carlo (MCMC) and Model Evaluation. August 15, 2017
Markov Chain Monte Carlo (MCMC) and Model Evaluation August 15, 2017 Frequentist Linking Frequentist and Bayesian Statistics How can we estimate model parameters and what does it imply? Want to find the
More informationSTAT 425: Introduction to Bayesian Analysis
STAT 425: Introduction to Bayesian Analysis Marina Vannucci Rice University, USA Fall 2017 Marina Vannucci (Rice University, USA) Bayesian Analysis (Part 2) Fall 2017 1 / 19 Part 2: Markov chain Monte
More informationUsing R in 200D Luke Sonnet
Using R in 200D Luke Sonnet Contents Working with data frames 1 Working with variables........................................... 1 Analyzing data............................................... 3 Random
More informationThe evdbayes Package
The evdbayes Package April 19, 2006 Version 1.0-5 Date 2006-18-04 Title Bayesian Analysis in Extreme Theory Author Alec Stephenson and Mathieu Ribatet. Maintainer Mathieu Ribatet
More informationCPSC 340: Machine Learning and Data Mining
CPSC 340: Machine Learning and Data Mining MLE and MAP Original version of these slides by Mark Schmidt, with modifications by Mike Gelbart. 1 Admin Assignment 4: Due tonight. Assignment 5: Will be released
More informationA Bayesian Approach to Phylogenetics
A Bayesian Approach to Phylogenetics Niklas Wahlberg Based largely on slides by Paul Lewis (www.eeb.uconn.edu) An Introduction to Bayesian Phylogenetics Bayesian inference in general Markov chain Monte
More informationPARAMETER ESTIMATION: BAYESIAN APPROACH. These notes summarize the lectures on Bayesian parameter estimation.
PARAMETER ESTIMATION: BAYESIAN APPROACH. These notes summarize the lectures on Bayesian parameter estimation.. Beta Distribution We ll start by learning about the Beta distribution, since we end up using
More informationprobability George Nicholson and Chris Holmes 31st October 2008
probability George Nicholson and Chris Holmes 31st October 2008 This practical focuses on understanding probabilistic and statistical concepts using simulation and plots in R R. It begins with an introduction
More informationBayesian Estimation An Informal Introduction
Mary Parker, Bayesian Estimation An Informal Introduction page 1 of 8 Bayesian Estimation An Informal Introduction Example: I take a coin out of my pocket and I want to estimate the probability of heads
More informationBayesian inference for a population growth model of the chytrid fungus Philipp H Boersch-Supan, Sadie J Ryan, and Leah R Johnson September 2016
Bayesian inference for a population growth model of the chytrid fungus Philipp H Boersch-Supan, Sadie J Ryan, and Leah R Johnson September 2016 1 Preliminaries This vignette illustrates the steps needed
More informationAdvanced 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 informationComputer Vision Group Prof. Daniel Cremers. 10a. Markov Chain Monte Carlo
Group Prof. Daniel Cremers 10a. Markov Chain Monte Carlo Markov Chain Monte Carlo In high-dimensional spaces, rejection sampling and importance sampling are very inefficient An alternative is Markov Chain
More informationIntroductory Statistics with R: Simple Inferences for continuous data
Introductory Statistics with R: Simple Inferences for continuous data Statistical Packages STAT 1301 / 2300, Fall 2014 Sungkyu Jung Department of Statistics University of Pittsburgh E-mail: sungkyu@pitt.edu
More informationRobust 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 informationMALA versus Random Walk Metropolis Dootika Vats June 4, 2017
MALA versus Random Walk Metropolis Dootika Vats June 4, 2017 Introduction My research thus far has predominantly been on output analysis for Markov chain Monte Carlo. The examples on which I have implemented
More informationBayesian Regression Linear and Logistic Regression
When we want more than point estimates Bayesian Regression Linear and Logistic Regression Nicole Beckage Ordinary Least Squares Regression and Lasso Regression return only point estimates But what if we
More informationStat 451 Lecture Notes Markov Chain Monte Carlo. Ryan Martin UIC
Stat 451 Lecture Notes 07 12 Markov Chain Monte Carlo Ryan Martin UIC www.math.uic.edu/~rgmartin 1 Based on Chapters 8 9 in Givens & Hoeting, Chapters 25 27 in Lange 2 Updated: April 4, 2016 1 / 42 Outline
More informationST 740: Markov Chain Monte Carlo
ST 740: Markov Chain Monte Carlo Alyson Wilson Department of Statistics North Carolina State University October 14, 2012 A. Wilson (NCSU Stsatistics) MCMC October 14, 2012 1 / 20 Convergence Diagnostics:
More informationBayesian Graphical Models
Graphical Models and Inference, Lecture 16, Michaelmas Term 2009 December 4, 2009 Parameter θ, data X = x, likelihood L(θ x) p(x θ). Express knowledge about θ through prior distribution π on θ. Inference
More informationMarkov Chain Monte Carlo
Department of Statistics The University of Auckland https://www.stat.auckland.ac.nz/~brewer/ Emphasis I will try to emphasise the underlying ideas of the methods. I will not be teaching specific software
More informationStatistical Inference: Estimation and Confidence Intervals Hypothesis Testing
Statistical Inference: Estimation and Confidence Intervals Hypothesis Testing 1 In most statistics problems, we assume that the data have been generated from some unknown probability distribution. We desire
More informationA Re-Introduction to General Linear Models (GLM)
A Re-Introduction to General Linear Models (GLM) Today s Class: You do know the GLM Estimation (where the numbers in the output come from): From least squares to restricted maximum likelihood (REML) Reviewing
More informationUnivariate Normal Distribution; GLM with the Univariate Normal; Least Squares Estimation
Univariate Normal Distribution; GLM with the Univariate Normal; Least Squares Estimation PRE 905: Multivariate Analysis Spring 2014 Lecture 4 Today s Class The building blocks: The basics of mathematical
More informationSPSS Guide For MMI 409
SPSS Guide For MMI 409 by John Wong March 2012 Preface Hopefully, this document can provide some guidance to MMI 409 students on how to use SPSS to solve many of the problems covered in the D Agostino
More informationPackage ForwardSearch
Package ForwardSearch February 19, 2015 Type Package Title Forward Search using asymptotic theory Version 1.0 Date 2014-09-10 Author Bent Nielsen Maintainer Bent Nielsen
More informationPermutation Tests. Noa Haas Statistics M.Sc. Seminar, Spring 2017 Bootstrap and Resampling Methods
Permutation Tests Noa Haas Statistics M.Sc. Seminar, Spring 2017 Bootstrap and Resampling Methods The Two-Sample Problem We observe two independent random samples: F z = z 1, z 2,, z n independently of
More informationprobability George Nicholson and Chris Holmes 29th October 2008
probability George Nicholson and Chris Holmes 29th October 2008 This practical focuses on understanding probabilistic and statistical concepts using simulation and plots in R R. It begins with an introduction
More informationStat 516, Homework 1
Stat 516, Homework 1 Due date: October 7 1. Consider an urn with n distinct balls numbered 1,..., n. We sample balls from the urn with replacement. Let N be the number of draws until we encounter a ball
More informationASQWorkshoponBayesianStatisticsfor Industry
ASQWorkshoponBayesianStatisticsfor Industry March 8, 2006 Prof. Stephen Vardeman Statistics and IMSE Departments Iowa State University vardeman@iastate.edu 1 Module 6: Some One-Sample Normal Examples We
More informationPS2.1 & 2.2: Linear Correlations PS2: Bivariate Statistics
PS2.1 & 2.2: Linear Correlations PS2: Bivariate Statistics LT1: Basics of Correlation LT2: Measuring Correlation and Line of best fit by eye Univariate (one variable) Displays Frequency tables Bar graphs
More informationMarkov 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 informationLecture 5. G. Cowan Lectures on Statistical Data Analysis Lecture 5 page 1
Lecture 5 1 Probability (90 min.) Definition, Bayes theorem, probability densities and their properties, catalogue of pdfs, Monte Carlo 2 Statistical tests (90 min.) general concepts, test statistics,
More informationPreface 5. Introduction 6. A Hands-on Example 8. Regression Models 12. Model Checking & Diagnostics 20. Contents. Bayesian Probability 7
M I C H A E L C L A R K C E N T E R F O R S TAT I S T I C A L C O N S U LTAT I O N A N D R E S E A R C H U N I V E R S I T Y O F M I C H I G A N B AY E S I A N B A S I C S A C O N C E P T U A L I N T R
More informationCorrelation and regression
NST 1B Experimental Psychology Statistics practical 1 Correlation and regression Rudolf Cardinal & Mike Aitken 11 / 12 November 2003 Department of Experimental Psychology University of Cambridge Handouts:
More informationAdditional Problems Additional Problem 1 Like the http://www.stat.umn.edu/geyer/5102/examp/rlike.html#lmax example of maximum likelihood done by computer except instead of the gamma shape model, we will
More informationBayesian data analysis using JASP
Bayesian data analysis using JASP Dani Navarro compcogscisydney.com/jasp-tute.html Part 1: Theory Philosophy of probability Introducing Bayes rule Bayesian reasoning A simple example Bayesian hypothesis
More informationThis is particularly true if you see long tails in your data. What are you testing? That the two distributions are the same!
Two sample tests (part II): What to do if your data are not distributed normally: Option 1: if your sample size is large enough, don't worry - go ahead and use a t-test (the CLT will take care of non-normal
More informationHypothesis testing, part 2. With some material from Howard Seltman, Blase Ur, Bilge Mutlu, Vibha Sazawal
Hypothesis testing, part 2 With some material from Howard Seltman, Blase Ur, Bilge Mutlu, Vibha Sazawal 1 CATEGORICAL IV, NUMERIC DV 2 Independent samples, one IV # Conditions Normal/Parametric Non-parametric
More informationMarkov Chain Monte Carlo
Markov Chain Monte Carlo Jamie Monogan University of Georgia Spring 2013 For more information, including R programs, properties of Markov chains, and Metropolis-Hastings, please see: http://monogan.myweb.uga.edu/teaching/statcomp/mcmc.pdf
More informationCreating Non-Gaussian Processes from Gaussian Processes by the Log-Sum-Exp Approach. Radford M. Neal, 28 February 2005
Creating Non-Gaussian Processes from Gaussian Processes by the Log-Sum-Exp Approach Radford M. Neal, 28 February 2005 A Very Brief Review of Gaussian Processes A Gaussian process is a distribution over
More informationMatematisk statistik allmän kurs, MASA01:A, HT-15 Laborationer
Lunds universitet Matematikcentrum Matematisk statistik Matematisk statistik allmän kurs, MASA01:A, HT-15 Laborationer General information on labs During the rst half of the course MASA01 we will have
More informationAn example to illustrate frequentist and Bayesian approches
Frequentist_Bayesian_Eample An eample to illustrate frequentist and Bayesian approches This is a trivial eample that illustrates the fundamentally different points of view of the frequentist and Bayesian
More informationExplore the data. Anja Bråthen Kristoffersen
Explore the data Anja Bråthen Kristoffersen density 0.2 0.4 0.6 0.8 Probability distributions Can be either discrete or continuous (uniform, bernoulli, normal, etc) Defined by a density function, p(x)
More informationChapter 23: Inferences About Means
Chapter 3: Inferences About Means Sample of Means: number of observations in one sample the population mean (theoretical mean) sample mean (observed mean) is the theoretical standard deviation of the population
More informationCPSC 340: Machine Learning and Data Mining. MLE and MAP Fall 2017
CPSC 340: Machine Learning and Data Mining MLE and MAP Fall 2017 Assignment 3: Admin 1 late day to hand in tonight, 2 late days for Wednesday. Assignment 4: Due Friday of next week. Last Time: Multi-Class
More informationappstats27.notebook April 06, 2017
Chapter 27 Objective Students will conduct inference on regression and analyze data to write a conclusion. Inferences for Regression An Example: Body Fat and Waist Size pg 634 Our chapter example revolves
More informationWinLTA USER S GUIDE for Data Augmentation
USER S GUIDE for Version 1.0 (for WinLTA Version 3.0) Linda M. Collins Stephanie T. Lanza Joseph L. Schafer The Methodology Center The Pennsylvania State University May 2002 Dev elopment of this program
More informationMetropolis-Hastings Algorithm
Strength of the Gibbs sampler Metropolis-Hastings Algorithm Easy algorithm to think about. Exploits the factorization properties of the joint probability distribution. No difficult choices to be made to
More informationPackage bhrcr. November 12, 2018
Type Package Package bhrcr November 12, 2018 Title Bayesian Hierarchical Regression on Clearance Rates in the Presence of Lag and Tail Phases Version 1.0.2 Date 2018-11-12 Author Colin B. Fogarty [cre]
More informationPackage 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 informationPrinciples 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 informationNonlinear Regression. Summary. Sample StatFolio: nonlinear reg.sgp
Nonlinear Regression Summary... 1 Analysis Summary... 4 Plot of Fitted Model... 6 Response Surface Plots... 7 Analysis Options... 10 Reports... 11 Correlation Matrix... 12 Observed versus Predicted...
More informationCase Study: Modelling Industrial Dryer Temperature Arun K. Tangirala 11/19/2016
Case Study: Modelling Industrial Dryer Temperature Arun K. Tangirala 11/19/2016 Background This is a case study concerning time-series modelling of the temperature of an industrial dryer. Data set contains
More information36-463/663: Hierarchical Linear Models
36-463/663: Hierarchical Linear Models Taste of MCMC / Bayes for 3 or more levels Brian Junker 132E Baker Hall brian@stat.cmu.edu 1 Outline Practical Bayes Mastery Learning Example A brief taste of JAGS
More informationProbability and Statistics Prof. Dr. Somesh Kumar Department of Mathematics Indian Institute of Technology, Kharagpur
Probability and Statistics Prof. Dr. Somesh Kumar Department of Mathematics Indian Institute of Technology, Kharagpur Module No. #01 Lecture No. #27 Estimation-I Today, I will introduce the problem of
More informationStatistical Computing with R
Statistical Computing with R Eric Slud, Math. Dept., UMCP October 21, 2009 Overview of Course This course was originally developed jointly with Benjamin Kedem and Paul Smith. It consists of modules as
More informationA Re-Introduction to General Linear Models
A Re-Introduction to General Linear Models Today s Class: Big picture overview Why we are using restricted maximum likelihood within MIXED instead of least squares within GLM Linear model interpretation
More informationCS Homework 3. October 15, 2009
CS 294 - Homework 3 October 15, 2009 If you have questions, contact Alexandre Bouchard (bouchard@cs.berkeley.edu) for part 1 and Alex Simma (asimma@eecs.berkeley.edu) for part 2. Also check the class website
More informationBayesian inference. Fredrik Ronquist and Peter Beerli. October 3, 2007
Bayesian inference Fredrik Ronquist and Peter Beerli October 3, 2007 1 Introduction The last few decades has seen a growing interest in Bayesian inference, an alternative approach to statistical inference.
More informationOpen book, but no loose leaf notes and no electronic devices. Points (out of 200) are in parentheses. Put all answers on the paper provided to you.
ISQS 5347 Final Exam Spring 2017 Open book, but no loose leaf notes and no electronic devices. Points (out of 200) are in parentheses. Put all answers on the paper provided to you. 1. Recall the commute
More informationStatistical Methods in Particle Physics Lecture 1: Bayesian methods
Statistical Methods in Particle Physics Lecture 1: Bayesian methods SUSSP65 St Andrews 16 29 August 2009 Glen Cowan Physics Department Royal Holloway, University of London g.cowan@rhul.ac.uk www.pp.rhul.ac.uk/~cowan
More informationA Parameter Expansion Approach to Bayesian SEM Estimation
A Parameter Expansion Approach to Bayesian SEM Estimation Ed Merkle and Yves Rosseel Utrecht University 24 June 2016 Yves Rosseel A Parameter Expansion Approach to Bayesian SEM Estimation 1 / 51 overview
More informationAddition to PGLR Chap 6
Arizona State University From the SelectedWorks of Joseph M Hilbe August 27, 216 Addition to PGLR Chap 6 Joseph M Hilbe, Arizona State University Available at: https://works.bepress.com/joseph_hilbe/69/
More informationContents. Preface to Second Edition Preface to First Edition Abbreviations PART I PRINCIPLES OF STATISTICAL THINKING AND ANALYSIS 1
Contents Preface to Second Edition Preface to First Edition Abbreviations xv xvii xix PART I PRINCIPLES OF STATISTICAL THINKING AND ANALYSIS 1 1 The Role of Statistical Methods in Modern Industry and Services
More informationStat 5421 Lecture Notes Proper Conjugate Priors for Exponential Families Charles J. Geyer March 28, 2016
Stat 5421 Lecture Notes Proper Conjugate Priors for Exponential Families Charles J. Geyer March 28, 2016 1 Theory This section explains the theory of conjugate priors for exponential families of distributions,
More informationBayes: All uncertainty is described using probability.
Bayes: All uncertainty is described using probability. Let w be the data and θ be any unknown quantities. Likelihood. The probability model π(w θ) has θ fixed and w varying. The likelihood L(θ; w) is π(w
More information