similar to: Metropolis-Hastings Markov Chain Monte Carlo in Spatstat

Displaying 20 results from an estimated 1000 matches similar to: "Metropolis-Hastings Markov Chain Monte Carlo in Spatstat"

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
2012 Nov 30
1
Example metropolis hasting
Hello all, could you tell where is an example of metropolis hasting? Thank you! Tania Sent from my iPod
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)
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 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
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
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
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]]
2008 Mar 26
0
Naive Gibbs Sampling with Metropolis Steps (pkg: gibbs.met)
Hi R Users: This package provides two generic functions for performing Markov chain sampling in a naive way for a user-defined target distribution, which involves only continuous variables. The function "gibbs_met" performs Gibbs sampling with each 1-dimensional distribution sampled with Metropolis update using Gaussian proposal distribution centered at the previous state. The function
2001 Sep 14
1
Dynamic loading problem.
I'm having a dynamic loading problem that seems to be caused by exponentiation (the ** operator in Fortran/ratfor). This can be illustrated by the following toy example: ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== % cat foo.r subroutine foo(x,n) x = x**n return end % f77 -c foo.r /tmp/ratfor.06661.0.f: foo: % R CMD SHLIB -o foo.so foo.o gcc -G -o
2007 Mar 01
1
LDAP error
Hi, When i try to inser this on LDAP database, i get this error: "ldapadd: invalid format (line 14) entry: "uid=spessoa,ou=users,ou=accounts,dc=telbit,dc=pt"" I can't see nothing wrong. The .ldif file follows my signature. Any help would be appreciated. Warm Regards, M?rio Gamito -- dn: dc=telbit,dc=pt objectClass: top objectClass: dcObject objectClass: organization o:
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,
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)) +
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 }
2009 Mar 03
1
spatial markov chain methods
Hello, can any one point me to R-packages (if available) which include spatial Markov Chain methods? My second question is more general but hopefully not OT: Currently we are using the software TPROGS, which let people simulate property distributions in space by some Markov Chain approaches. We face some problems due to the lack of information between distances of samples along borehole path
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
2000 Jun 19
2
dyn.load error:
Hi, I have some S functions plus Fortran routines that I want to use in R. They work in S, but when I try to use "dyn.load" to link fortran codes in R , I get the following error. thanks, reza (I am using R-1.0.1 on windows NT, The name of fortran file (compiled Ratfor) is deldirld.o and it's in the D:\Reza\476\tv.gonsrc.R\ directory) >dyn.load("deldirld.o") Error in
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
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){