Displaying 20 results from an estimated 68 matches for "metropolis".
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 modifi...
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
worked with.
Any suggestions on how I could get started working with the Fortran code in
conjunction w...
2007 Mar 01
1
LDAP error
...4C:4E
ipHostNumber: 192.168.30.254
ipHostNumber: 192.168.90.252
ipHostNumber: 192.168.31.2
ipHostNumber: 192.168.33.253
owner: uid=psaborano,ou=accounts,dc=telbit,dc=pt
manager: uid=psaborano,ou=accounts,dc=telbit,dc=pt
description: Compaq deskpro Pentium III 500MHz cedido pela PTIN
o: PTIN
dn: cn=metropolis,ou=sistemas,dc=telbit,dc=pt
objectClass: top
objectClass: device
objectClass: ieee802Device
objectClass: ipHost
cn: metropolis
owner: uid=psaborano,ou=accounts,dc=telbit,dc=pt
description: Pentium 4 2.40GHz, RAM=1G, 2xSATA 80G, 1xATA 80G, DVD+-RW
macAddress: 00:0C:6E:13:65:3E
ipHostNumber: 192.168....
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
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...
2010 Oct 04
1
Metropolis: Implementation of Interlock Protocol using Linux Shell Programming, OpenSSH, and GPG
...;s encrypted message and decrypts
it with his Private key. Then Bob sends half rest of encrypted message
to Alice.
*(7)* Alice combines the two parts of Bob's encrypted message and decrypts
it with her Private key.
Here is the Code (running well in my Slackware Linux). I named this program
as Metropolis, consist of two parties, the Miracle and the Sleeper. It's
assumed that you have exchange your public key to your partner in secure
way:
SOURCE CODE METROPOLIS (Also attached)
####################################################################
# Implementation of Interlock Protocol in...
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 "met_gaussian" updates the whole
state with Metropolis method using independent Gaussian proposal
distribution centered at the previous state. The sampling is carried
out without considering any speci...
2012 Mar 14
1
Metropolis-Hastings in R
...),1)
theta1<-matrix(0,n,2)
theta1[1,]<-mu
for(i in 2:n){
theta<-theta1[i-1,]
phi<-theta+runif(-0.5,0.5)
k<-rbinom(1,1,alpha(theta,phi))
k1<-k1+k
theta1[i,]<-theta+k*(phi-theta)
}
plot(theta1)
Thanks alot :)
-Mike
--
View this message in context: http://r.789695.n4.nabble.com/Metropolis-Hastings-in-R-tp4472547p4472547.html
Sent from the R help mailing list archive at Nabble.com.
2012 Aug 05
1
Possible bug with MCMCpack metropolis sampler
...described persists if I just run the
MCMCmetorp1R call (with the variables renamed of course) on its own and not
as part of my posterior.sampler function.
Any idea what's going on?
Thanks,
Dan Cervone
--
View this message in context: http://r.789695.n4.nabble.com/Possible-bug-with-MCMCpack-metropolis-sampler-tp4639199.html
Sent from the R help mailing list archive at Nabble.com.
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))
+
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]]
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 th...
2016 Nov 03
6
CTDB and locking issues in 4.4.6 (Classic domain)
...gular file
Device: 29h/41d Inode: 35820037 Links: 1
Access: (0774/-rwxrwxr--) Uid: ( 3535/ jh3) Gid: ( 513/Domain Users)
Access: 2016-11-03 19:51:46.000000000 +0000
Modify: 2016-11-01 13:06:04.000000000 +0000
Change: 2016-11-01 13:06:04.000000000 +0000
Birth: -
[root at zalma ~]# ssh metropolis "stat testfile"
root at metropolis's password:
...
Size: 1286700 Blocks: 2514 IO Block: 65536 regular file
Device: 26h/38d Inode: 35820037 Links: 1
Access: (0774/-rwxrwxr--) Uid: ( 3535/ jh3) Gid: ( 513/Domain Users)
Access: 2016-11-03 19:51:46.000000000 +...
2007 Dec 04
1
Metropolis-Hastings within Gibbs coding error
...er.matrix[i,]<- c(rnorm(1, 0, (1/parameter.matrix[i-1,3])), rnorm(1, 0, (1/parameter.matrix[i-1,3])), rgamma(1, shape=(a0+1), rate=(1/b0+(parameter.matrix[i-1,1]^2+parameter.matrix[i-1,2]^2)/2)))
# as the Gamma with specified parameters is the conditional for tau given beta, data
# implementing Metropolis-Hastings within Gibbs to get estimates of beta0 and beta1
proposal.b0[i]<-sum(log( ((exp(parameter.matrix[i,1])^y)/((1+exp(parameter.matrix[i,1])^n))*exp(-parameter.matrix[i-1,3]*(parameter.matrix[i,1]^2)/2))))
proposal.b1[i]<-sum(log( ((exp(parameter.matrix[i,2]*x)^y) / ((1+exp(parame...
2008 May 12
4
Several questions about MCMClogit
...ponds to the expression value of one particular gene in one of
32 samples. And the Y presents the corresponding classes (0-non cancer,
1-cancer) for those 32 samples. The formula is Y~. All other parameters are
default.
This is the output message:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The Metropolis acceptance rate for beta was 0.00000
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Warning messages:
1: In glm.fit(x = X, y = Y, weights = weights, start = start, etastart =
etastart, :
fitted probabilities numerically 0 or 1 occurred
2: In glm.fit(x = X, y = Y, weights = weights, start = star...
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
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)...
2013 Mar 01
2
using reserved words in R, and reuse variable names in different functions
...writing several functions and running out variable names. I am using
words such as "t", "c", "matrix" to keep the notation same as formulas I am
using.
For example I have,
unnormalized <- function(t, x, y){
val <- rnorm(t, mean=x, var=y)
return(val)
}
metropolis <- function(t, c, x, y){
den1 <- unnormalized(t, mean=x, sd=y)
den2 <- unnormalized(c, mean=x, sd=y)
if(den1 < den2)
return(a)
else
return(b)
}
for(i in 1: 100){
matrix <- c()
matrix[i] <- metroplis(1, 2, 3, 4)
}
Here, I reused letter "t...
2007 Mar 02
1
Help with faster optimization for large parameter problem
...fixed. But eventually, I have to run optim on
the unmodified likelihood function above and it is very slow, taking
several days for large problems.
I have also tried metrop() in mcmc, but I find this needs to be very
close to the mode of the likelihood to be efficient (in fact, MCMCpack's
metropolis function calls optim first and even requires it to invert the
hessian before even starting the metropolis algorithm, unless we can
provide our own covariance matrix). I will probably use metrop() to
generate standard errors once I find a mode....
In the mean time, I can't help thinking tha...
2009 Jan 26
0
AdMit version 1-01.01
...rom CRAN.
SUMMARY
The package provides functions to perform the fitting of an adaptive
mixture of Student-t distributions to a target density through its
kernel function. The mixture approximation can then be used as the importance
density in importance sampling or as the candidate density in the
Metropolis-Hastings algorithm to obtain quantities of interest for
the target density itself. We believe that this approach may be applicable in
many fields of research and hope that the R package AdMit will be
fruitful for many researchers like econometricians or applied statisticians.
MODIFICATIONS
o cha...