search for: posteriors

Displaying 20 results from an estimated 369 matches for "posteriors".

Did you mean: posterior
2010 Jul 18
2
loop troubles
Hi all, I appreciate the help this list has given me before. I have a question which has been perplexing me. I have been working on doing a Bayesian calculating inserting studies sequentially after using a non-informative prior to get a meta-analysis type result. I created a function using three iterations of this, my code is below. I insert prior mean and precision (I add precision manually
2012 Aug 05
1
Possible bug with MCMCpack metropolis sampler
Hi, I'm having issues with what I believe is a bug in the MCMCpack's MCMCmetrop1R function. I have code that basically looks like this: posterior.sampler <- function(data, prior.mu){ log.posterior <- function(theta) log.likelihood(data, theta) + log.prior(prior.mu, theta) post.samples <- MCMCmetrop1R(log.posterior, theta.init=prior.mu, burnin=100, mcmc=1000, thin=40,
2004 Jan 23
1
predict.lda problem with posterior probabilities
With predict.lda the posterior probabilities only relate to the existing Class definitions. This is fine for Class definitions like gender but it is a problem when new data does not necessarily belong to an existing Class. Is there a classification method that gives posterior probabilities for Class membership and does not assume the new data must belong to one of the existing Classes? A new
2006 Dec 05
3
Comparing posterior and likelihood estimates for proportions (off topic)
This question is slightly off topic, but I'll use R to try and make it as relevant as possible. I'm working on a problem where I want to compare estimates from a posterior distribution with a uniform prior with those obtained from a frequentist approach. Under these conditions the estimates should agree. Specifically, I am asking the question, "What is the probability that the true
2008 Dec 31
3
WinBUGS posterior samples (via R2WinBUGS)?
Hi all, I did some analysis using package R2WinBUGS to call WinBUGS. I set the iterations to 50000 (fairly a large number, I think), but after the program was done, the effective posterior samples contained only 7 draws. I don't know why. By the way, I checked posterior sample size by using bugsobj$n.sims. And, for my previous practice with WinBUGS/R2WinBUGS, no such strange thing happend.
2008 Sep 27
0
compute posterior mean by numerical integration
Dear R useRs, i try to compute the posterior mean for the parameters omega and beta for the following posterior density. I have simulated data where i know that the true values of omega=12 and beta=0.01. With the function postMeanOmega and postMeanBeta i wanted to compute the mean values of omega and beta by numerical integration, but instead of omega=12 and beta=0.01 i get omega=11.49574 and
2004 Feb 16
0
How do we obtain Posterior Predictive (Bayesian) P-values in R (a sking a second time)
Dear Friends, According to Gelman et al (2003), "...Bayesian P-values are defined as the probability that the replicated data could be more extreme than the observed data, as measured by the test quantity p=pr[T(y_rep,tetha) >= T(y,tetha)|y]..." where p=Bayesian P-value, T=test statistics, y_rep=data from replicated experiment, y=data from original experiment, tetha=the function
2007 Apr 03
1
Calculating DIC from MCMC output
Greetings all, I'm a newcomer to Bayesian stats, and I'm trying to calculate the Deviance Information Criterion "by hand" from some MCMC output. However, having consulted several sources, I am left confused as to the exact terms to use. The most common formula can be written as DIC = 2*Mean(Deviance over the whole sampled posterior distribution) - Deviance(Mean
2013 Feb 18
1
compare posterior samples from R2OpenBugs and R function bugs{R2WinBUGS}
Hi all, I used both OpenBugs and R function bugs{R2WinBUGS} to run a linear mixed effects model based on the same data set and initial values. I got the same summary statistics but different posterior samples. However, if I order these two sets of samples, one is generated from OpenBugs and the other is generated from R, they turn to be the same. And the samples from R do not have any
2007 Jan 26
1
Bayesian inference: Poisson distribution with normal (!) prior
Hello, for a frequency modelling problem I want to combine expert knowledge with incoming real-life data (which is not available up to now). The frequency has to be modelled with a poisson distribution. The parameter lambda has to be normal distributed (for certain reasons we did not NOT choose gamma althoug it would make everything easier). I've started with the subsequent two functions to
2013 May 08
1
How to calculate Hightest Posterior Density (HPD) of coeficients in a simple regression (lm) in R?
Hi! I am trying to calculate HPD for the coeficients of regression models fitted with lm or lmrob in R, pretty much in the same way that can be accomplished by the association of mcmcsamp and HPDinterval functions for multilevel models fitted with lmer. Can anyone point me in the right direction on which packages/how to implement this? Thanks for your time! R. [[alternative HTML version
2010 Sep 30
1
Accessing Vector of A Data Frame
I have a variable that looks like this: > print(pred$posterior) o x 1 2.356964e-03 9.976430e-01 2 8.988153e-01 1.011847e-01 3 9.466137e-01 5.338627e-02 4 2.731429e-11 1.000000e+00 Now what I want to do is to access "o" and "x" How come this approach fail? > print(pred$posterior$o) or >
2012 Dec 18
1
multi dimensional optim problem
I am attempting to use optim to solve a neural network problem. I would like to optimize coefficients that are currently stored in a matrix Y=270 x 1 X= 27- x 14 b1= 10x14 b2= 11x1 V= 10 x 14 set of prior variances. I have the following function: posterior.mode1=function(y,X,b_0,b2,V) { log.like=function(b1) { a_g=compute(b1) z_g=tanh(a_g); z_g=cbind(1,z_g)
2008 Dec 05
0
making sense of posterior statistics in the deal package
Hello, I'm doing bayesian network analyses with the deal package. I am at a loss for how to interpret output from the analysis (i.e. what is a good score, what is a bad score, which stats tell me what about the network edges/nodes). Here is an example node with its posterior scores for all parent nodes. ------------------------------------------------------------ Conditional Posterior:
2006 Apr 12
3
[Q] Bayeisan Network with the "deal" package
Dear R-users I am looking for a help in using the "deal" package. I followed the manual and paper from the author's web site to learn it, as shown below, but I could not figure out how to access the local and posterior probability of the nodes in the constructed network. library(deal) data(ksl) ksl.nw <- network(ksl) ksl.prior <- jointprior(ksl.nw) banlist <-
2011 Dec 03
2
density function always evaluating to zero
Dear R users, I'm trying to carry out monte carlo integration of a posterior density function which is the product of a normal and a gamma distribution. The problem I have is that the density function always returns 0. How can I solve this problem? Here is my code #generate data x1 <- runif(100, min = -10, max = 10) y <- 2 * x1^2 + rnorm(100) # # # # # # # # Model 0 # # # # # # #
2004 Jul 13
1
lda() - again.
Hi. I asked a question about lda() and got some answers. However, one question remains (which is not independent of the earlier ones): What output does lda() produce which I can use to compute the posteriors? I know predict(lda())$posterior will give me precisely the posteriors, but suppose I'd like to compute them myself, outside of R. So far, I have not been able to use "coefficients of linear discrimiants" to do this, for they don't seem to be the alpha and beta in log(post)...
2006 Nov 19
0
posterior probability formula in predict.lda
IHi all, have a dataset with rows as plots and environmental data as columns. I have predicted the values using the following ed.pred<-predict(lda.ed,ed) #lda.ed the model, ed the env. variables used for the prediction plots I am wanting to know the formula used by predict.lda for calculating the posterior probabilities. Can anyone point me in the right direction? Thanks
2008 Jan 24
0
posterior probability in finite mixture
Dear All, This is a question somewhat off-topic. Say, if I have known the number of components in the mixture, all the estimated parameters, prior probabilities, and so on for a finite mixture model, how might I compute the posterior probabilities of each case for a new dataset without observed response (Y)? I want to know the parametric form of such calculation such that I can calculate it
2010 Aug 09
1
creating pdf of wireframe
Dear R list, I have written some code to produce several wireframe plots in a panel. They look good, but when I try to create a pdf, many (but not all) of the details I have specified are not reproduced. For example, the line width I have specified is not reproduced, and neither are the font sizes for the axis labels. I'm an R novice, so I could really use some guidance. Here is the code I am