similar to: MCMC/Bayesian framework in R?

Displaying 20 results from an estimated 1000 matches similar to: "MCMC/Bayesian framework in R?"

2010 Sep 29
1
sample exponential r.v. by MCMC
Dear R users, I am leaning MCMC sampling, and have a problem while trying to sample exponential r.v.'s via the following code: samp <- MCMCmetrop1R(dexp, theta.init=1, rate=2, mcmc=5000, burnin=500, thin=10, verbose=500, logfun=FALSE) I tried other distribtions such as Normal, Gamma with shape>1, it works perfectly fine. Can someon
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,
2010 Nov 03
1
dll problem with C++ function
Dear fellow R-users, I have the problem of being unable to repeatedly use a C++-function within R unless by dyn.unloading/dyn.loading it after each .C call. The C++-code (too large to attach) compiles without problem using R CMD SHLIB. It loads (using dyn.load("myfun.so")) and executes (via .C(myfun, ...) ) properly. The function returns no object, only reads files from disk,
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?)?
2005 Oct 28
1
MCMC in R
Dear R-helpers, Hi! All. I'm doing a project which needs MCMC simulation. I wonder whether there exists related packages in R. The only one I know is a MCMCpack package. What I want to do is implementing gibbs sampling and Metropolis-Hastings Algorithm to get the posterior of hierarchical bayesian models. Thanks in advance. Jun
2005 Sep 02
1
source package linking problem under linux
I'm having some problems in installing some source packages under linux. As an example, MCMCpack. An error is raised when linking: > install.packages("MCMCpack") [...] * Installing *source* package 'MCMCpack' ... checking for C++ compiler default output file name... a.out checking whether the C++ compiler works... yes checking whether we are cross compiling... no checking
2010 Apr 13
2
Getting Started with Bayesian MCMC
Hi all, I would like to start to use R's MCMC abilities to compute answers in Bayesian statistics. I don't have any specific problems in mind yet, but I would like to be able to compute/sample posterior probabilities for low-dimensional custom models, as well as handle "standard" Bayesian cases like linear regression and hierarchical models. R clearly has a lot of abilities in
2007 May 03
1
Bayesian logistic regression with a beta prior (MCMClogit)
Dear all, I am trying to use the logistic regression with MCMClogit (package: MCMCpack/Coda) and I want to put a beta prior on the parameters, but it's giving me error message (please see output below) no matter what shape 1 or 2 I use. It works perfect with the cauchy or normal priors. Do you know if there is a catch there somewhere? Thanks logpriorfun <- function(beta,shape1,shape2){
2017 Aug 23
0
Bayesian Stats Job, MCMC Code Porting
Hello R Programmers, We have a large existing Perl codebase which is currently being upgraded to use the new optimizing RPerl compiler (not related to the R language). http://rperl.org/ Also in use by the same Perl codebase is some custom R code which loads the "bayesm" library in order to execute Markov Chain Monte Carlo (MCMC) calculations.
2007 Mar 09
1
MCMC logit
Hi, I have a dataset with the binary outcome Y(0,1) and 4 covariates (X1,X@,X#,X$). I am trying to use MCMClogit to model logistic regression using MCMC. I am getting an error where it doesnt identify the covariates ,although its reading in correctly. The dataset is a sample of actual dataset. Below is my code: > ####################### > > > #retreive data > # considering four
2008 Oct 23
1
MCMC for sampling from ordinal logistic regression
Hi: Is there a R-function that can generate samples from the posterior distribution of an ordered logistic regression model (just like MCMCoprobit from MCMCpack in R). I will greatly appreciate some guidance in this regard. Thanks Reez
2011 Aug 15
2
MCMC regress, using runif()
Hello, just to follow up a question from last week. Here what I've done so far (here an example): library(MCMCpack) Y=c(15,14,23,18,19,9,19,13) X1=c(0.2,0.6,0.45,0.27,0.6,0.14,0.1,0.52) X2a=c(17,22,21,18,19,25,8,19) X2b=c(22,22,29,34,19,26,17,22) X2 <- function()runif(length(X2a), X2a, X2b) model1 <- MCMCregress(Y~X1+X2()) summary(model1) but I am not sure if my X2-function is
2010 Apr 11
1
MCMC results into LaTeX
Dear All, What is the preferred way to get Bayesian analysis results (such as those from MCMCpacki, MCMCglmm, and DPpackage) into LaTeX table automatically? I have been using the "apsrtable" package and similar functions in "memisc" package, but neither seems to handle MCMC output directly. Many thanks. Shige
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
2008 Mar 21
1
idea for GSoC: an R package for fitting Bayesian Hierarchical Models
Dear R developers, these days I'm working on some R code for fitting completely generic Bayesian Hierarchical Models in R, a la OpenBUGS and JAGS. A key feature of OpenBUGS and JAGS is that they automatically build an appropriate MCMC sampler from a generic model, specified as a directed acyclic graph (DAG). The spirit of my (would-be) implementation is instead more focused on experimentation
2012 Jan 02
0
Reading mcmc/coda into a big.matrix efficiently
I'm trying to read CODA/mcmc files (see the coda package), as generated by jags/WinBUGS/OpenBUGS, into a big.matrix. I can't load the whole mcmc object produced by read.coda() into memory since I'm using a laptop for this analysis (currently I'm unfunded). Right now I'm doing it by creating the filebacked.big.matrix, reading a chunk of data at a time from the chain
2008 Apr 15
1
codes for MCMC
I look for codes sources of R (examples of application) to implement examples on Monte Carlo, MCMC and Gibbs sampling. -- Dr. P. NGOM, Facult? des Sciences et Techniques D?partement de Math?matiques et Informatique Universit? Cheikh Anta Diop Dakar - S?n?gal ---------------------------------------------------------------- Universite Cheikh Anta DIOP - DAKAR
2003 Aug 21
2
mcmc
Hello, I am about to move all of my modelling work into R, and I have been investigating the present state of MCMC and Bayesian methods in R. Following a thread on the mailing list in 2000, I have looked at mcmcpack and Hydra. Three years down the line, is there anything new in this area? I have used both MCSim and WinBUGS in the past. The first one seems promising, but is too focused towards
2006 Dec 07
0
Help to understand an Error using summary to an mcmc object
Hi, I used the MCMCirtKd function of MCMCpack: posterior2 <- MCMCirtKd(data, dimensions = 2, + burnin = 5000, mcmc = 50000, thin = 10, + verbose = 10000, B0 = .25, store.item = TRUE, item.constraints = beta.constraints) And after apply the comand summary() I got some erros and warnings that I could not understand: summary.posterior2 <- summary(posterior2)
2006 May 11
1
about MCMC pack
Hello, I tryed to use the MCMC pack, particularly the function MCMCirtKd to simulate the posterior distribution in a multidimensional IRT model. The code I used is: posterior1 <- MCMCirtKd(Y, dimensions=2, item.constraints=list("V2"=list(3,0)), burnin = 1000, mcmc = 10000, thin=1, verbose = 1, seed = NA, alphabeta.start = NA, b0 = 0, B0=0, store.item = FALSE,