Re: [R] Random-walk Metropolis-Hasting

2011-11-11 Thread Uwe Ligges
On 11.11.2011 18:48, Gyanendra Pokharel wrote: 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)) +

[R] Random-walk Metropolis-Hasting

2011-11-11 Thread Gyanendra Pokharel
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