similar to: Bayesian data analysis - help with sampler function

Displaying 20 results from an estimated 1000 matches similar to: "Bayesian data analysis - help with sampler function"

2007 May 23
1
Where is package "Umacs"?
We were promised this package last spring but I can't find it anywhere! Does anyone have any info? Thanks. >From RNews: "Umacs (Universal Markov chain sampler) is an R package (to be released in Spring 2006) that facilitates the construction of the Gibbs sampler and Metropolis algorithm for Bayesian inference ..." -- View this message in context:
2005 May 01
2
eigen() may fail for some symmetric matrices, affects mvrnorm()
Hi all, Recently our statistics students noticed that their Gibbs samplers were crashing due to some NaNs in some parameters. The NaNs came from mvrnorm (Ripley & Venables' MASS package multivariate normal sampling function) and with some more investigation it turned out that they were generated by function eigen, the eigenvalue computing function. The problem did not seem to happen
2007 Oct 31
1
Simple Umacs example help..
Hello all... I am just starting to teach myself Bayesian methods, and am interested in learning how to use UMacs. I've read the documentation, but the single example is a bit over my head at the level I am at right now. I was wondering if anyone has any simple examples they'd like to share. I've successfully done a couple of simple gibbs examples, but have had a hard time
2009 Jan 25
1
Gibbs sampler...did it work?
I am writing a Gibbs sampler. I think it is outputting some of what I want, in that I am getting vector of several thousand values (but not 10,000) in a txt file at the end. My question is, is the error message (see below) telling me that it can't output 10,000 values (draws) because of a limitation in my memory, file size, shape etc, or that there is an error in the sampler itself? >
2006 Jun 26
1
Griddy-Gibbs sampler
Hey everyone, I have read the paper by Ritter and Tanner(1992) on Griddy-Gibbs sampler and I am trying to implement it in R without much luck. I was wondering if anyone had used this or could point me to any example code. Thanks, Liz --------------------------------- [[alternative HTML version deleted]]
2011 Nov 10
1
Gibbs sampler
I have the following code, gibbs <-function(m,theta = 0.25, lambda =0.55, n =1){ alpha <- 1.5 beta <- 1.5 gamma <- 1.5 x<- array(0,c(m+1, 3)) x[1,1] <- theta x[1,2] <- lambda x[1,3]<- n for(t in 2:(m+1)){ x[t,1] <- rbinom(1, x[t-1,3], x[t-1,1]) x[t,2]<-rbeta(1, x[t-1,1] + alpha, x[t-1,3] - x[t-1,1] + beta) x[t,3]
2009 Jul 02
1
MCMC/Bayesian framework in R?
Dear R-users (and developers), I am looking for an efficient framework to carry out parameter estimations based on MCMC (optionally with specified priors). My goal is as follow: * take ANY R-function returning a likelihood-value (this function may itself call external programmes or other code!) * run a sampler that covers the multidimensional parameter space (thus creating a posterior
2006 Aug 11
2
about MCMC pack again...
Hello, thank you very much for your previous answers about the C++ code. I am interested in the application of the Gibbs Sampler in the IRT models, so in the function MCMCirt1d and MCMCirtkd. I've found the C++ source codes, as you suggested, but I cannot find anything about the Gibbs Sampler. All the files are for the Metropolis algorithm. Maybe I am not able to read them very well, by the
2007 Aug 20
1
rv package, rvnorm function
In an attempt to learn to use the rv package, I have been working through the examples in Jouni Kerman and Andrew Gelman's "Using Random Variables to Manipulate and Summarize Simulations in R" (July 4, 2007). I am using a Dell Precision 380n computer running Gentoo Linux and R 2.2.1 (the latest available through Gentoo's portage/emerge system). Everything worked well until I
2008 Nov 01
2
sampling from Laplace-Normal
Hi, I have to draw samples from an asymmetric-Laplace-Normal distribution: f(u|y, x, beta, phi, sigma, tau) \propto exp( - sum( ( abs(lo) + (2*tau-1)*lo )/(2*sigma) ) - 0.5/phi*u^2), where lo = (y - x*beta) and y=(y_1, ..., y_n), x=(x_1, ..., x_n) -- sorry for this huge formula -- A WinBUGS Gibbs sampler and the HI package arms sampler were used with the same initial data for all parameters. I
2004 Jul 16
0
for loops in Gibbs sampler
Dear all: I am using R to do multiple imputation for longitudinal data set. The Gibbs chain basically requires draw posterior distribution of model parameters, including the random effects. The multiple imputation requires several independent Gibbs chains. So my program structure is like: for (chain in 1:5) { # perform Gibbs sampling... for (row in 1:row.no) { b.row=some function # draw
2005 Jul 19
1
initial points for arms in package HI
Dear R-users I have a problem choosing initial points for the function arms() in the package HI I intend to implement a Gibbs sampler and one of my conditional distributions is nonstandard and not logconcave. Therefore I'd like to use arms. But there seem to be a strong influence of the initial point y.start. To show the effect I constructed a demonstration example. It is reproducible
2004 Apr 16
0
autologistic regression with Gibbs sampler
Hello everyone, I have some binary, spatially autocorrelated data I would like to run autologistic regression on. I hope to incorporate both ordinary covariates (environmental predictors) and a spatial autocovariate in the model, ideally with a second-order neighbourhood structure. Since my computing skills are limited, I am wondering if anyone has composed an algorithm for this purpose, and
2012 Aug 30
2
Which BUGS should one use?
Hello ALL! Some times ago I started to learn and play with Bayesian stuffs. Many advice use of WinBUGS for Bayesian inference Using Gibbs Sampler. However, WinBUGS is discontinued, and now, development is under OpenBUGS. I wasn't lazy, so I installed both and tried out. In more than 90% of cases they give comparable outcome. But in few cases I got substantial differences. Recently, I read nice
2005 May 16
1
A question about bugs.R: functions for running WinBUGs from R
Dear R users, I've found bugs.R : the functions for running WinBUGs from R that is writen by Dr. Andrew Gelman who is a professor from Columbia University. The bugs.R would be very useful for me, and I think many of you know it as well. I followed the instuctions on Dr. Gelman's web to install all of documents that bugs.R needs, but when I try to run the school example the web posted in
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 # # # # # # #
2010 Oct 22
2
Linking to lapack
Hello all. I'm developing a package for R holding a Gibbs sampler, which tends to have better performance when written in C than in R. During each iteration in the Gibbs sampler, I need the inverse of a symmetric matrix. For this, I wish to use lapack, as is concisely suggested in "Writing R extensions", since this will have better performance than I could ever write myself. After
2009 Mar 03
1
R - need more memory, or rejection sampling algorithm doesn't work?
Hi all, I am trying to run rejection sampling for the quantity z11 in the function below. Unfortunately I can't simplify the function further so that z11 only appears once. Whenever I run the algorithm, R looks as if it is running it (no error messages or anything), but then nothing happens for minutes...how long should it take to run something like this in R? I have tried in in both linux
2008 Jun 22
3
R vs. Bugs
A naive question from a non-statistician: I'm looking into running a Bayesian analysis of a model with high dimensionality. It's not a standard model (the likelihood requires a lot of code to implement), and I'm using a Linux machine. Was wondering if someone has any thoughts on what the advantages of OpenBugs are as opposed to just R (or should I be thinking WinBUGS under Wine?)?
2012 Jan 05
1
Calling R functions within C/C++
Hello everyone! First of all, please note that I'm working under Windows 7. I have written a Gibbs sampler in R and I'm now in the process of translating it in C++ to increase the speed. I'm relatively new to C++ and this question may be trivial, but my search so far have been unsuccessful. In my Gibbs sampler I am using some basic R functions (like the rep function for example)