I am trying … P(β₂>0) =66.94%. Sure. Does partially/completely removing solid shift the equilibrium? Finding the 8 outer corner vertices of an object. The lighter distributions were generated by posterior predictive simulation and the darker distributions were generated by parametric bootstrapping (similar to posterior prediction, but using only maximum likelihood parameter estimates for simulation). JAGS 20 (“Just Another Gibbs Sampler”) is a stand alone program for performing MCMC simulations. Conjugate priors? We don’t actually need to write out the data since ‘rjags’ automatically does this for us (and in another format at that), but it’s nice to be able to check that JAGS has done something reasonable by analyzing the raw inputs post hoc. Why do I get a 'food burn' alert every time I use my pressure cooker? You can create a posterior predictive data set for each individual or observation in your data set by using simulations that include the additional variance that characterizes Bayesian analyses. When we simulated from the prior predictive distribution. We specify the JAGS model specification file and the data set, which is a named list where the names … Description Usage Arguments Author(s) Examples. I think it's a matter of being careful with terminology. ff. The pp_check method for stanreg-objects prepares the arguments required for the specified bayesplot PPC plotting function and then calls that function. Truncated prior leads to non-intuitive posterior, Generate Posterior predictive distribution at every step in the MCMC chain for a hierarchical regression model, Posterior predictive checking for Bernoulli distributed data. Does tightening a QR skewer in different ways affect wheel alignment? It also contains functions for regression models, hierarchical models, Bayesian tests, and illustrations of Gibbs sampling. Gelman et al in 'Bayesian Data Analysis' (pp 598-599, Opt-in alpha test for a new Stacks editor, Visual design changes to the review queues, Fitting constrained hierarchical models in JAGS, Specify a Zero-inflated (Hurdle) Gamma Model in JAGS/BUGS. The distribution created by averaging future predictions over the posterior densities of all unknown parameters is called the \predictive density" in Bayesian analysis. Would it make sense for rjags or coda to have a predict() function? A simple interface for generating a posterior predictive check plot for a JAGS analysis fit using jagsUI, based on the posterior distributions of discrepency metrics specified by the user and calculated and returned by JAGS (for example, sums of residuals). http://homepages.uni-paderborn.de/jeti/ppexample.pngI'd be interested in your opinions regarding the usefulness of this visualization.Best regardsJan, Info about fanplot can be found here:https://gjabel.wordpress.com/2012/08/13/the-fanplot-package-for-r/. The best answers are voted up and rise to the top, Cross Validated works best with JavaScript enabled, Start here for a quick overview of the site, Detailed answers to any questions you might have, Discuss the workings and policies of this site, Learn more about Stack Overflow the company, Learn more about hiring developers or posting ads with us. It only takes a minute to sign up. Some framework for posterior predictive inference would be nice, ... You have to do it by hand right now, e.g. The bdims data are in your workspace. This means that we compute the log density of the gamma distribution with parameters \(\alpha\) and \(\beta\) for the sampled invTau2 value and add the resulting log density value to the result of summing the data-level and group-level log densities. A set of wrappers around 'rjags' functions to run Bayesian analyses in 'JAGS' (specifically, via 'libjags'). Initialization 4. 1.1 Posterior for single measurement (n= 1) We want to put together the prior (2) and the likelihood (1) to get the posterior ( jx). a two-parameter logistic model is used), a matrix of dimensions production.itr -by-2 is returned (the first and second columns containing the posterior samples … With your simulated data in hand, we’ll write up a model specification in JAGS syntax. In the following paper found here and reference below, the author suggests that "if the model is true or close to true, the posterior predictive p-value will almost certainly be very close to 0.5" . So, I would say you should just report the 95%HDI on the posterior predicted value and leave it at that, without extending it to a conclusion about rejecting zero or being "credibly different" from zero. Thus the distribution in this case reduces to p(~yjy) = Z p(~yjµ)p(µjy)dµ In many situations this can be di–cult to calculate, though it is often easy with a conjugate prior. The following (actual) animation shows the uncertainty by plotting 200 draws from the posterior predictive distribution: Some final thoughts. Either (i) in R after JAGS has created the chain or (ii) in JAGS itself while it … View source: R/whiskerplot.R. Posterior.rjags(tox, notox, sdose, ff, prior.alpha, burnin.itr, production.itr) Arguments tox. A set of wrappers around 'rjags' functions to run Bayesian analyses in 'JAGS' (specifically, via 'libjags'). Description Usage Arguments Author(s) Examples. I am trying to obtain a posterior predictive distribution for specified values of x from a simple linear regression in Jags. Let d=(d1,…,dK) be a vector of all the possible values (categorical or numerical) that the data x=(x1,…,xN) could possibly take. Compilation 3. JAGS uses a combination of Metropolis sampling, Gibbs sampling, and other MCMC algorithms. How to judge whether two groups of sequences are equal in cycles? And thus we have a large collection of parameter draws (or samples, to confuse things a bit). Would it be appropriate, at the same time we are doing the linear regression, to compare these two posterior predictive distributions using a contrast? If not, why? The model is a simple two parameter one, a mean, a variance, with the assumption that the parent population is normally distributed. Calculating pi with Monte Carlo using OpenMP, Unwanted irregular layout when using \multirow. ... JAGS and R: Obtain posterior predictive distribution for specific x. Could someone explain me, is something wrong with the model specification? Example 1: posterior predictive distribution A sample data set of 50 draws from a N(0,1) distribution are taken. In other words, given the posterior distributions of the parameters of the model, the posterior predictive distribution … The hyperprior distribution on m is a uniform prior on the real axis, and the hyperprior distribution on v is a uniform prior from 0 to infinity.. They can be used as optimal predictors in forecasting, optimal classifiers in classification problems, imputations for missing data, and more. In jagsUI: A Wrapper Around 'rjags' to Streamline 'JAGS' Analyses. Where can I get one? By default, a vertical line segment is drawn at the median of the posterior distribution. This is found in the very beginning of Section 6 in the paper. The coda package also provides convergence diagnostics to check that the output is valid for analysis (see Plummer et al 2006). Learn. A sample data set of 50 draws from a N(0,1) distribution are taken. Thanks for contributing an answer to Cross Validated! Thank you.I managed to do this in R using based on this program. But saying that predicted y is "credibly different from zero because the 95%HDI does not include zero" is an extra conclusion based on a decision rule that I eschew. In jagsUI: A Wrapper Around 'rjags' to Streamline 'JAGS' Analyses. Ask Question Asked 4 years, 11 months ago. You can see in the diagnostic plots that the ESS is tiny, despite 12,000 steps thinned by 5. Description. Obviously, we have to import the ‘rjags’ package. You can say correctly that "for x=[], the 95%HDI for the posterior predicted value of y goes from y=[] to y=[]". Description A simple interface for generating a posterior predictive check plot for a JAGS analysis fit using jagsUI, based on the posterior distributions of discrepency metrics specified by the user and calculated and returned by JAGS (for example, sums of residuals). A vector of length k showing the number of patient who had toxicities at each dose level. Within this context, you will explore how to use rjags simulation output to conduct posterior inference. A vector of length k showing the number of patients who did not have toxicities at each dose level. The prior predictive distribution is a collection of datasets generated from the model (the likelihood and the priors). You will use these 100,000 predictions to approximate the posterior predictive distribution for the weight of a 180 cm tall adult. How do spaceships compensate for the Doppler shift in their communication frequency? Description. (In the frequentist world, on the other hand, when a value falls outside the 95% confidence interval it is rejected.) Given a set of N i.i.d. Let the random variable \( H \) represent the prediction of a future hurricane count. In R, use JAGS, rjags, coda, and superdiag. could you at a minimum provide the input data that you are using? Then we need to set up our model object in R, which we do using the jags.model() function. That means every four years I shouldn’t be surprised to observe a … Computing the posterior distribution can be challenging. Instructions 100 XP. N = 10 beta = 1 / (0.3 ** 2) alpha = 0.005 degree = 9 degrees = range (degree + 1) X = np. Open Discussion 594; Help 1168; Welcome to the JAGS forums 207; Help. Cheers!Todd. Adaptation and burn-in 5. Making statements based on opinion; back them up with references or personal experience. と言われるゆえんである - How to parse this sentence? The higher the certainty, the more defined the course of the function gets. Within this context, you will explore how to use rjags simulation output to conduct posterior inference. Here, for example is the bayesplot plot of the posterior distribution for theta. In this course, you'll learn how to implement more advanced Bayesian models using RJAGS. Why does "No-one ever get it in the first take"? Inform others who are looking for a good introductory book; click the stars to go to Amazon.com, https://gjabel.wordpress.com/2012/08/13/the-fanplot-package-for-r/. The goal of posterior prediction is to assess the fit between a model and data by answering the following question: Could the model we’ve assumed plausibly have produced the data we observed? Append the pir and pvr to the ir and vr columns, get rid of the second for loop, and then consider the values of mu [] estimated using pir and pvr to be the posterior predictive estimates of mu. The rjags package provides an interface from R to the JAGS library for Bayesian data analysis. rjags; examples; prototype; Wiki Menu Create Topic; Stats Graph; Forums. Monitoring The next stages of analysis are done outside of JAGS: convergence diagnostics, model criticism, Dale. The posterior distribution of \( H \) at \( h \) under each model is given by \( f(h|D, M_i) \). 2. For example, how are pvr and pir calculated? Bayesian estimates of the two parameters, using rjags The posterior predictive distribution can help with that by focusing attention on the predicted hypothetical observations, especially since the observations usually represent a quantity that is of direct interest to the researchers. The… Can we ask this question for every value of x in order to make inferences about x?Cheers. Some framework for posterior predictive inference would be nice, but I'm not sure that the predict function fits the bill. Instructions 100 XP. Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Example 1: posterior predictive distribution. But somehow the reported results (pri) do not make sense (the means of pri are smaller than expected). The model is a simple two parameter one, a mean, a variance, with the assumption that the parent population is normally distributed. @David pvr and pri are user supplied data: they are the predicted regressors... @teucer are they predicted from user-supplied values of, @teucer, this is a shot in the dark since I still don't understand your model, and this might be the same as what you already have, but would it make sense to append the, @David I want to have some credible interval for the predictions (. Another useful summary is the posterior predictive distribution of a future observation, y~ p(~yjy) = Z p(~yjy; µ)p(µjy)dµ In many situations, y~ will be conditionally independent of y given µ. So, if we average over the posterior distribution, we can restore the missing uncertainty. Infinitely broad prior S 0 =α-1I, i.e.,precision α à0 – Then mean m N reduces to the maximum likelihood value, i.e., mean is the solution vector 3. distribution- estimate theta, get a posterior density function of theta Use uccesses in 11 trials3 s Uniform prior distribution on p Parameter θ, plot posterior of θ Repeat using a beta distribution for prior p, parameters (alpha=2.24, beta=2) 28 c. Predictive distribution for a nonpharmacologic meta-analysis for a urogenital condition with respect to mental health. The solution you post here seems better to me for the reason you state, but also because JAGS and R have different functions for sampling from a T distribution. 2. Overall, I have found the posterior predictive distribution to be an exceptionally useful and flexible tool. site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. Specifically, you will construct posterior estimates of regression parameters using posterior means & credible intervals, you will test hypotheses using posterior probabilities, and you will construct posterior predictive distributions for new observations. Use MathJax to format equations. Running a model refers to generating samples from the posterior distribution of the model parameters. 2. Would it make sense to calculate them inside the same model? # Find the xProbe and predicted y columns: # Find the extreme predicted values for graph axis limits: # Make the plots of the posterior predicted values: # Example for Jags-Ymet-Xmet-MrobustPredict.R, Has this book been especially useful to you? pp_check.stanreg.Rd. 3.5 Posterior predictive distribution. Overall, I have found the posterior predictive distribution to be an exceptionally useful and flexible tool. Posterior medians and 95% credible intervals are reported. Package ‘rjags’ November 6, 2019 ... ject of class “mcmc.list” which can be used to summarize the posterior distribution. The bootstrap is easy to explain, easy to run and often gives reasonable results (despite the somewhat weird model assumptions). Let's give this gamma distribution a shape, 2.0 and a rate, 1.0/5.0. Then replace the two for loops with this: I have done something similar, but without predicted regressors, similar to the example given by Gelman et al in 'Bayesian Data Analysis' (pp 598-599 starting under posterior predictive simulations). After we have seen the data and obtained the posterior distributions of the parameters, we can now use the posterior distributions to generate future data from the model. What is the "dark star" in Fritz Leiber's "The Pail of Air"? Example: Linear regression model with semi-conjugate priors model {# likelihood for (i in 1:N) ... Bayesians want the appropriate posterior predictive distribution Formatting Help; Posterior predictive distribution in a changepoint problem Forum: Open Discussion. Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Interface to the PPC (posterior predictive checking) module in the bayesplot package, providing various plots comparing the observed outcome variable \(y\) to simulated datasets \(y^{rep}\) from the posterior predictive distribution. Courses (338) Skill Tracks (51) Career Tracks (14) Instructors (272) Learning Experience Features. There are two ways to program this process. – Thus maximum posterior weight is w MAP = m N 2. I'm teaching a course using your book this semester and know that this will save me hours of work trying to figure out how to do this. Creator: Avi Created: 2013-07-05 Updated: 2013-07-08 Avi - 2013-07-05 Hello. Would it make sense for rjags or coda to have a predict() function? Bayesian estimates of the two parameters, using rjags (Plummer 2013) in the R A single function call can control adaptive, burn-in, and sampling MCMC phases, with MCMC chains run in sequence or in parallel. sdose. Bayesian estimates of the two parameters, using rjags (Plummer 2013) in the R observations X = { x 1, …, x N } {\displaystyle \mathbf {X} =\{x_{1},\dots,x_{N}\}}, a new value x ~ {\displaystyle {\tilde {x}}} will be drawn from a distribution that depends on a parameter θ ∈ Θ {\displaystyle \theta \in \Theta }: p {\displaystyle p} It … Use rnorm() to simulate a single prediction of weight under the parameter settings in the first row of weight_chains. So the posterior predictive distribution for a new data point x new is: p(x new|x) = Z Θ p(x new|θ,x)p(θ|x)dθ = Z Θ p(x new|θ)p(θ|x)dθ (since x new is independent of the sample data x) I can also read out that the 75%ile of the posterior predictive distribution is a loss of $542 vs. $414 from the prior predictive. You will use these 100,000 predictions to approximate the posterior predictive distribution for the weight of a 180 cm tall adult. For low certainty, it will be very fuzzy. Asking for help, clarification, or responding to other answers. Recursion: Salamin and Brent equation for finding pi. In a Bayesian setting, you can compare data generated from the posterior predictive distribution to the observed data. genMCMC = function( data , xName="x" , yName="y" , if ( !is.null(xProbe) ) { # check that the xProbe values make sense. Here is an example. Example 1: posterior predictive distribution. Put the model specification in a file called example1.bug. What causes a taildragger to move with the fuselage level before takeoff? Bayesian estimates of the two parameters, using rjags (Plummer 2013) in the R True Interactive Learning; Real-world Projects; Data Skills Assessment; DataCamp for Mobile Business Features . ; Repeat the above using the parameter settings in the second row of weight_chains. ; Simulate a single prediction of weight under each of the 100,000 parameter settings in weight_chains.Store these as a new variable Y_180 in weight_chains. If ff = "logit2" (i.e. How to predict values using estimates from rjags / JAGS. Conjugate Bayesian analysis of the Gaussian distribution Kevin P. Murphy∗ murphyk@cs.ubc.ca Last updated October 3, 2007 1 Introduction The Gaussian or normal distribution is one of the most widely used in statistics. When I generated the histogram myself, it has the expected shape. Hello.In your book, What is the meaning of "low-level parameters" ? Within this context, you will explore how to use rjags simulation output to conduct posterior inference. You can see in the diagnostic plots that the ESS is tiny, despite 12,000 steps thinned by 5. The question would be whether the model predicts a credibly higher y outcome for x=80 compared to x=50. A sample data set of 50 draws from a N(0,1) distribution are taken. It looks like the chains have settled into the correct parameter values -- after all the posterior-predictive curves superimposed on the data look good -- but it will take a ton more steps to get a smooth representation of the posterior distribution. Firstly, Dr. Plummer, I have to add my thanks to the … Returns samples from the posterior distributions of each model parameter using JAGS. We can confirm this as the posterior predictive probability of β₂ being positive is 66.94%, i.e. I am fitting a simple linear regression model with R & JAGS: I am trying to calculate the posterior predictive distribution with new data (pvr and pir in the model). It looks like the chains have settled into the correct parameter values -- after all the posterior-predictive curves superimposed on the data look good -- but it will take a ton more steps to get a smooth representation of the posterior distribution. Specifically, you will construct posterior estimates of regression parameters using posterior means & credible intervals, you will test hypotheses using posterior probabilities, and you will construct posterior predictive distributions for new observations. Dear John, dear all,I have been plotting posterior predictives using the fanplot package. A sample data set of 50 draws from a N(0,1) distribution are taken. Append the pir and pvr to the ir and vr columns, get rid of the second for loop, and then consider the values of mu[] estimated using pir and pvr to be the posterior predictive estimates of mu. The model is a simple two parameter one, a mean, a variance, with the assumption that the parent population is normally distributed. In other words, having done a simple linear regression analysis for some data, then, for a given probe value of. Just a small comment: the original JAGS model I posted also produces the posterior distribution for d that WinBUGS does, it's just that the plot function in JAGS uses a different binning for the histogram. All the correlated uncertainty is contained in these draws. Example 1: posterior predictive distribution. However, here I am also interested in the posterior predictive distribution, hence I add a generated quantities code block. To perform posterior prediction, we simulate datasets using parameter values drawn from a posterior distribution. The model is a simple two parameter one, a mean, a variance, with the assumption that the parent population is normally distributed. A vector of length k listing the standardised doses to be used in the CRM model. By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy. The model is a simple two parameter one, a mean, a variance, with the assumption that the parent population is normally distributed. Are airfoil profiles patented? After all, the posterior predictive distribution is merely a function of the posterior parameter distribution, just like a difference or parameters (e.g., μ1-μ2) or an effect size (e.g., μ/σ) is merely a function of parameters. The bdims data are in your workspace. Graphical posterior predictive analysis. linspace (0, 1, N). To check the predictive accuracy of the posterior distribution, you can use the function pp_check(), which plots simulated y values from the posterior distribution against the actual values of y. My model in R looks something like this:rt(1,df=mcmcMat[i,"nu"])*mcmcMat[i,"sigma"] + mcmcMat[i,"beta0"] + mcmcMat[i,"beta1"] * testXThis caused confusion for me for a while but eventually drove home the point that R and JAGS don't use the same functions.Thank you again for posting this. This takes place in ve steps: 1. Bayesian predictions are outcome values simulated from the posterior predictive distribution, which is the distribution of the unobserved (future) data given the observed data. Do most amateur players play aggressively? There are two ways to program this process. Author(s) Martyn Plummer. Posterior Predictive Distribution I After taking the sample, we have a better representation of the uncertainty in θ via our posterior p(θ|x). JAGS takes as input a Bayesian model description — prior plus likelihood — and data and returns an MCMC sample from the posterior distribution. A more recent post extends this to multiple linear regression:http://doingbayesiandataanalysis.blogspot.com/2016/10/posterior-predictive-distribution-for.html, A reader asked how to create posterior predicted distributions of data values, specifically in the case of linear regression. MCMC sampling is performed via JAGS/rjags. Across the chain, the distribution of simulated y values is the posterior predictive distribution of y at x. Construct a density plot of your 100,000 posterior plausible predictions. It doesn't seem to matter whether inv.omega.squared is 0.001 or 0.0001. d. Predictive distribution for a pharmacologic vs. pharmacologic meta-analysis for respiratory disease with respect to a sign reflecting continuation of condition. The output shows a simulated predictive mean of $416.86, close to the analytical answer. So, often you will want to know if, for example, your posterior distribution is approximating your underlying distribution. 2. Also be careful if you're going to make a claim about "rejecting" a difference of zero. For example, parameters that describe individuals are lower-level than parameters that describe group tendencies. The predict function gives me access to the posterior predictive statistics, including the 95% prediction credible interval. Cowboys and Aliens type TV Movie on SyFy Channel. This looks to be very helpful! Example 1: posterior predictive distribution. Simulating data from the posterior predictive distribution using the observed predictors is useful for checking the fit of the model. Prior and Posterior Predictive Checks ... can say that PPCs analyze the degree to which data generated from the model deviate from data generated from the true distribution. Essentially that's like using a ROPE around y=0 with zero width, and ROPEs should have non-zero width. Mathematically, if the likelihood function can be factored like this:p(D|a,b,c) = p(D|a) p(a|b) p(b|c) p(c)then a is a lower-level parameter than b which is a lower-level parameter than c. OK, thank you.I was speaking about 9.3 Shrinkage in hierarchical models. The output shows a simulated predictive mean of $416.86, close to the analytical answer. Then replace the two for loops with this: for (i in 1:length (ri)+length (pri)) { ri [i] ~ dnorm (mu [i],tau) mu [i] <- alpha + b.vr*vr [i] + b.ir*ir [i] } defining Y.rep to have the same distribution as Y, but not observed. That is, our prior mean for the expected value of this distribution will be 10. The marginal posterior probability over all models is given by \[ f(h|D)= \sum_{i=1}^m f(h |D, M_i) P(M_i |D ). Source: R/pp_check.R. Can one use a reversible hash algorithm as a compression function? library (bayesplot) mcmc_areas ( bern_mcmc, pars = c ("theta"), # make a plot for the theta parameter prob = … Does the United States Department of State issue any US record clearance letter? Which looks to be from the first edition of the book. Example 1: posterior predictive distribution A sample data set of 50 draws from a N(0,1) distribution are taken. The posterior predictive distribution Assume that new observations are drawn independently from the same normal distribution from which have been extracted. When plotting the posterior predictive distribution of the polynomial models we can see that a model of degree 3 has already sufficient complexity to explain the data reasonably well. If data points arrive sequentially, then posterior to any stage acts as prior distribution … So, has a multivariate normal distribution with mean (where is the posterior mean of ) and covariance matrix (where is the posterior variance of ). Posterior Predictive Distribution in Regression Example 3: In the regression setting, we have shown that the posterior predictive distribution for a new response vector y ∗ is multivariate-t. Prediction 15. It might sound strange that we should be able to enumerate all the possible values the data can take, what if the data is measured on a continuous scale? Comment Thread. It contains functions for summarizing basic one and two parameter posterior distributions and predictive distributions and MCMC algorithms for summarizing posterior distributions defined by the user. I've tried setting this for the multiple regression version, but the JAGS model won't compile.The model below gives this error: Error parsing model file: syntax error on line 37 near "yP"JAGS model syntax:1 | data{2 | ym <- mean(y)3 | ysd <- sd(y)4 | for ( i in 1:Ntotal ) {5 | zy[i] <- ( y[i] - ym ) / ysd6 | }7 | for ( j in 1:Nx ) {8 | xm[j] <- mean(x[,j])9 | xsd[j] <- sd(x[,j])10 | for ( i in 1:Ntotal ) {11 | zx[i,j] <- ( x[i,j] - xm[j] ) / xsd[j]12 | }13 | }14 | Nprobe <- length(xP)15 | for ( j in 1:length(xP) ) {16 | zxP[j] <- ( xP[j] - xm ) / xsd17 | }18 | }19 | model{20 | for ( i in 1:Ntotal ) {21 | zy[i] ~ dt( zbeta0 + sum( zbeta[1:Nx] * zx[i,1:Nx] ) , 1/zsigma^2 , nu )22 | }23 | # Priors vague on standardized scale:24 | zbeta0 ~ dnorm( 0 , 1/2^2 ) 25 | for ( j in 1:Nx ) {26 | zbeta[j] ~ dnorm( 0 , 1/2^2 )27 | }28 | zsigma ~ dunif( 1.0E-5 , 1.0E+1 )29 | nu ~ dexp(1/30.0)30 | # Transform to original scale:31 | beta[1:Nx] <- ( zbeta[1:Nx] / xsd[1:Nx] )*ysd32 | beta0 <- zbeta0*ysd + ym - sum( zbeta[1:Nx] * xm[1:Nx] / xsd[1:Nx] )*ysd33 | sigma <- zsigma*ysd34 | # Predicted y values as xProbe:35 | for ( i in 1:Nprobe ) {36 | zyP[i] ~ dt( zbeta0 + sum( zbeta[1:Nx] * zxP[i,1:Nx] , 1/zsigma^2 , nu )37 | yP[i] <- zyP[i] * ysd + ym38 | }39 | }, @Sean S, you're missing a parenthesis at the end of line 36, Dear Professor Kruschke – Dear all,Is it legitimate to use the posterior predictions to make inferences about different values of the predictor?For instance, in the above example, can we conclude that the weight variable is credibly different from, say, 225 when x = 50 but not when x = 80? The hyperprior distribution on m is a uniform prior on the real axis, and the hyperprior distribution on v is a uniform prior from 0 to infinity.. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. It's maybe not as accurate as plotting the little sideways gauss curves at some data points, but it's quite intuitive. This is very helpful. I am assuming that your data includes observations for mu[] but not pmu[] and you want to estimate pmu[j] given j values of pvr and pir. Combining the outputs of all four models into one data frame gives me then the opportunity to compare the prediction credible intervals of the four models in one chart.