similar to: Example metropolis hasting

Displaying 20 results from an estimated 2000 matches similar to: "Example metropolis hasting"

2007 Jun 06
1
Metropolis-Hastings Markov Chain Monte Carlo in Spatstat
I'm testing some different formulations of pairwise interaction point processes in Spatstat (version 1.11-6) using R 2.5.0 on a Windows platform and I wish to simulate them using the Metropolis-Hastings algorithm implemented with Spatstat. Spatstat utilizes Fortran77 code with the preprocessor RatFor to do the Metropolis-Hastings MCMC, but the Makefile is more complicated than any I have
2007 Dec 04
1
Metropolis-Hastings within Gibbs coding error
Dear list, After running for a while, it crashes and gives the following error message: can anybody suggest how to deal with this? Error in if (ratio0[i] < log(runif(1))) { : missing value where TRUE/FALSE needed ################### original program ######## p2 <- function (Nsim=1000){ x<- c(0.301,0,-0.301,-0.602,-0.903,-1.208, -1.309,-1.807,-2.108,-2.71) # logdose
2011 Nov 16
2
Error in random walk Metroplis-hasting
Hi R community, I have some data set and construct the likelihood as follows likelihood <- function(alpha,beta){ lh<-1 d<-0 p<-0 k<-NULL data<-read.table("epidemic.txt",header = TRUE) attach(data, warn.conflicts = F) k <-which(inftime==1) d <- (sqrt((x-x[k])^2+(y-y[k])^2))^(-beta) p<-1 - exp(-alpha*d) for(i in 1:100){
2012 Nov 20
2
about MCMC
Hello all, could you tell wehere I can find information related to MCMC (Monte Carlo). And some examples about this topic. Thanks, Tania [[alternative HTML version deleted]]
2008 Apr 08
2
Metropolis acceptance rates
Is there a way to recover Metropolis-step acceptance rates AFTER completing posterior draws? The immediate application is in the probit.bayes and logit.bayes models used by Zelig... which I believe is merely calling MCMCpack. So one strategy, to which I am fixing to resort, is to call, say, MCMClogit with verbose set to mcmc (or mcmc divided by an integer) and then look at my screen.
2007 Jan 30
2
R packages
Hi, Do any body know which packages of R I need to go for the below topics? 1. Monte Carlo Markov chain (MCMC) 2. Gibbs Sampling 3. Metropolis Hastings Thanks in advance... Shubha [[alternative HTML version deleted]]
2013 Apr 04
2
question about message
Hello R, could you tell me please, how to fix this issue? There is installed RStudio-2.15.2 and the next steps where follow but the message appears: http://cran.r-project.org/web/packages/RMySQL/INSTALL): > > 1. Download the RMySQL_0.9.tar.gz file to the folder C:\Program > Files\R\R-2.15.1\bin\x64 > 2. Open a Windows command line, and change directory to that folder > 3.
2012 Mar 14
1
Metropolis-Hastings in R
Hi all, I'm trying to write a MH algorithm in R for a standard normal distribution, I've been trying for a good week or so now with multiple attempts and have finally given up trying to do it on my own as I'm beginning to run out of time for this, would somebody please tell me what is wrong with my latest attempt: n=100 mu=0 sigma=1 lik<-function(theta) exp(((theta-mu)^2)/2*sigma)
2009 Aug 12
1
MCMC sampling question
Hello, Consider MCMC sampling with metropolis / metropolis hastings proposals and a density function with a given valid parameter space. How are MCMC proposals performed if the parameter could be located at the very extreme of the parameter space, or even 'beyond that' ? Example to express it and my very nontechnical 'beyond that': The von Mises distribution is a circular
2011 Nov 11
1
Random-walk Metropolis-Hasting
Following is my code, can some one help on the error at the bottom? > mh<-function(iterations,alpha,beta){ + data<-read.table("epidemic.txt",header = TRUE) + attach(data, warn.conflicts = F) + k<-97 + d <- (sqrt((x-x[k])^2 + (y-y[k])^2)) + p <- 1-exp(-alpha*d^(-beta)) + p.alpha<-1 - exp(-3*d^(-beta)) + p.beta <- 1 - exp(alpha*d^(-2)) +
2013 Feb 18
1
questions hash functions
Hello R, could you explain to me how to resolve this question: If this is a matrix: Element S1 S2 S3 S4 0 0 1 0 1 1 0 1 0 0 2 1 0 0 1 3 0 0 1 0 4 0 0 1 1 5 1 0 0 0 1. How is possible to ompute the minhash signature for each column if we use the following three hash functions:
2012 Dec 03
1
How to mix three different classification techniques
Hello all, do you know how to mix three different classification techniques using R. For example if I have lm regression, svm and neural nets how can I mix them to have something like ensemble learning? Thank you, Tania Sent from my iPod
2009 Nov 08
3
MCMC gradually slows down
Hello, I have written a simple Metropolis-Hastings MCMC algorithm for a binomial parameter: MHastings = function(n,p0,d){ theta = c() theta[1] = p0 t =1 while(t<=n){ phi = log(theta[t]/(1-theta[t])) phisim = phi + rnorm(1,0,d) thetasim = exp(phisim)/(1+exp(phisim)) r = (thetasim)^4*(1-thetasim)^8/(theta[t]^4*(1-theta[t])^8) if(runif(1,0,1)<r){ theta[t+1] = thetasim }
2005 Jul 26
1
Wishart Density
Dear R users, I am doing MCMC using Metropolis-Hastings. My model is bivariate-log-normal and the prior for variance-covariance is wishart distribution. I am wondering if there are some simple codes about how to get the density of Wishart distribution in my case ? Thanks in advance. Meihua [[alternative HTML version deleted]]
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
2007 Jul 13
2
Question about acception rejection sampling - NOT R question
This is not related to R but I was hoping that someone could help me. I am reading the "Understanding the Metropolis Hastings Algorithm" paper from the American Statistician by Chip and Greenberg, 1995, Vol 49, No 4. Right at the beginning they explain the algorithm for basic acceptance rejection sampling in which you want to simulate a density from f(x) but it's not easy and you
2009 Apr 03
1
Hello! I got error in C - R
Hello, My name is Ick Hoon Jin and I am Ph. D. student in Texas A & M Univ.. When I run the C embedded in R in the Linux system, I confront the following error after 6,000 iteration. By googling I found this error is from the problem in C. *** caught segfault *** address (nil), cause 'memory not mapped' My C code is following:
2007 Jun 01
0
Metropolis code help
Dears, I have the below code for metropolis of the GLM logit (logistic regression) using a flat prior. Can someone help me modify the prior so that the model becomes hierarchical by using a flat prior for mu and sigma, the derived density for beta ~ N(mu, sigma^2)? Actually I took my code from a teacher that posted on the internet and modified it to the GLM logit but I can't adapt it to the
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
2010 Oct 04
1
Metropolis: Implementation of Interlock Protocol using Linux Shell Programming, OpenSSH, and GPG
I have wrote a small Linux Shell command for implementing Interlock Protocol which is known as a cryptographic protocol that resistant to man-in-the-middle attack. Here is the steps of interlock protocol: *(1)* Alice send her public key to Bob *(2)* Bob send his public key to Alice. *(3)* Alice encrypts her message using Bob's public key. Then she sends half of that encrypted message to