similar to: Acceptance rate in metrop

Displaying 20 results from an estimated 5000 matches similar to: "Acceptance rate in metrop"

2009 Sep 06
2
question about ... passed to two different functions
I have hit a problem with the design of the mcmc package I can't figure out, possibly because I don't really understand the R function call mechanism. The function metrop in the mcmc package has a ... argument that it passes to one or two user-supplied functions, which are other arguments to metrop. When the two functions don't have the same arguments, this doesn't work.
2009 Oct 05
2
how to document stuff most users don't want to see
The functions metrop and temper in the mcmc package have a debug = FALSE argument that when TRUE adds a lot of debugging information to the returned list. This is absolutely necessary to test the functions, because one generally knows nothing about the simulated distribution except what what one learns from MCMC samples. Hence you must expose all details of the simulation to have any hope of
2009 Jul 02
1
MCMC/Bayesian framework in R?
Dear R-users (and developers), I am looking for an efficient framework to carry out parameter estimations based on MCMC (optionally with specified priors). My goal is as follow: * take ANY R-function returning a likelihood-value (this function may itself call external programmes or other code!) * run a sampler that covers the multidimensional parameter space (thus creating a posterior
2007 Mar 02
1
Help with faster optimization for large parameter problem
Hello all, I have a large parameter problem with the following very simple likelihood function: fn<-function(param) { x1<-param[1:n] g1<-param[(n+1):(2*n)] beta<-param[(2*n+1):(2*n+k)] sigma2<-param[2*n+k+1]^2 meang1sp<-mean(g1[sp]) mu<-beta%*%matrix(x1,1,n)-(g1[sp]-meang1sp)%*%matrix(g1,1,n) return(sum((ydc-mu)^2)/(2*sigma2) + n*k*log(sqrt(sigma2)) +
2006 Jan 25
0
Log-Likelihood 3d-plot and contourplot / optim() starting values
Hello, i have coded the following loglikelihood-function # Log-Likelihood-Funktion loglik_jm<-function(N,phi,t) { n<-length(t) i<-seq(along=t) s1<-sum(log(N-(i-1))) s2<-phi*sum((N-(i-1))*t[i]) n*log(phi)+s1-s2 } # the data t<-c(7,11,8,10,15,22,20,25,28,35) # now i want to do a 3d-plot and a contourplot in order to see at which values of N and phi the loglikelihood
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.
2010 Sep 15
1
optim with BFGS--what may lead to this, a strange thing happened
Dear R Users on a self-written function for calculating maximum likelihood probability (plz check function code at the bottom of this message), one value, wden, suddenly jump to zero. detail info as following: w[11]=2.14 lnw =2.37 2.90 3.76 ... regw =1.96 1.77 1.82 .... wden=0.182 0.178 0.179... w[11]=2.14 lnw=2.37 2.90 3.76 ... regw =1.96 1.77 1.82 .... wden=0.182
2009 Jan 13
3
problem whit Geneland
I do the these passages: library(Geneland) set.seed(1) data <- simdata(nindiv=200, coord.lim=c(0,1,0,1) , number.nuclei=5 , allele.numbers=rep(10,20), IBD=FALSE, npop=2, give.tess.grid=FALSE) geno <- data$genotypes coord <- t(data$coord.indiv) path.mcmc <-
2007 Oct 04
3
Contour plot (level curves)
Hi all, I have a sample of n values from a bivariate distribution (from a MCMC procedure). How could I draw a contour plot of "the joint density" based on that sample ? Sorry if I was not too clear. Thans in advance, Regards, Caio [[alternative HTML version deleted]]
2010 Sep 19
1
help interpreting a model summary
Hello, I am all new here. Thanks for the job done, R really helped me in my thesis lately. However, I am kind of new in statistics, coming from mecanical engineering, and I mostly teached myself with "The R Book", so I may do silly things some time. PLease tell me if you think so. Anyway, I've just build up a piecewise linear model to fit some data, including some interaction and i
2010 Apr 04
4
ggplot2 geom_rect(): What am I missing here
Hi R fans, As a newbie following the five-hour rule (after hitting my head against the wall for five hours, post to this list), I am appealing for some help understanding geom_rect() in ggplot2. What I want to do is very simple. I want to generate a plot of rectangles. Each one represents a business cycle. The x-values will be pairs representing the start and end of each cycle. The y-values
2006 Sep 13
2
Retrieving value computed in inner function call
Dear R users, Consider the following example function: f = function(a,b) { g = function(x) a*x + b h = function(x) g(x)^2 + x^2 opt = optimize(h,lower = -1, upper = 1) x.min = opt$minimum h.xmin = opt$objective g.xmin = g(x.min) return(c(x.min, h.xmin, g.xmin)) } In my real problem the function that plays the role of "g" is costly to compute. Now, to
2011 Jan 11
0
modified FAST Script from package SensoMineR for the R community - Reg
###Dear R users ###I have been using SensoMineR package from CRAN for most of my work in sensory data analysis and from my usage experience, I encountered some areas for improvement and considered ###modifying the function in SensoMineR package for my personal use. I felt that it could be useful to share this to the community for enabling adoption by other users where they might require a
2008 Jul 30
1
read XML
I have a xml exported by Manifold GIS but I'm not being able to import it into R using XLM package. The file have this structure: <?xml version="1.0" encoding="UTF-8" ?> - <layout> <name>Layout 2</name> <pagesByX>1</pagesByX> <pagesByY>1</pagesByY> - <elements> <legend
1997 May 27
1
R-alpha: signif( small , d) gives NA
signif(.) is a <primitive> function. Unfortunately, I couldn't even find WHERE in the source, signif(.) is defined. Here are the symptoms: xmin <- .Machine $ double.xmin signif(xmin,3) #--> NA umach <- unlist(.Machine)[paste("double.x", c("min","max"), sep='')] for(dig in 1:10) {cat("dig=",dig,": ");
2010 Dec 07
1
Using nlminb for maximum likelihood estimation
I'm trying to estimate the parameters for GARCH(1,1) process. Here's my code: loglikelihood <-function(theta) { h=((r[1]-theta[1])^2) p=0 for (t in 2:length(r)) { h=c(h,theta[2]+theta[3]*((r[t-1]-theta[1])^2)+theta[4]*h[t-1]) p=c(p,dnorm(r[t],theta[1],sqrt(h[t]),log=TRUE)) } -sum(p) } Then I use nlminb to minimize the function loglikelihood: nlminb(
2011 Nov 16
0
Maximum likelihood for censored geometric distribution
Hi all, I need to check for a difference between treatment groups in the parameter of the geometric distribution, but with a cut-off (i.e. right censored). In my experiment I stimulated animals to see whether I got a response, and stopped stimulating if the animal responded OR if I had stimulated 10 times. Since the response could only be to a stimulation, the distribution of response times
2008 Aug 11
1
Unexpected parameter problem using rsaga.geoprocessor() {RSAGA}
Hello, I discovered SAGA, an interesting free GIS, a few days ago and now, I would like to use it from within R 2.6.2 using the RSAGA package. I read the documentation for this package and thought that I understood it correctly for trying to call some of the SAGA modules. For getting the information on the usage of and arguments required by the SAGA command line "Import Binary Raw
2006 Feb 21
1
color quantization / binning a variable into levels
Hi all, I'd like to quantize a variable to map it into a limited set of integers for use with a colormap. "image" and filled.contour" do this mapping inside somewhere, but I'd like to choose the colors for plotting a set of polygons. Is there a pre-existing function that does something like this well? i.e., is capable of using 'breaks'?
2013 Feb 15
1
Fitting pareto distribution / plotting observed & fitted dists
Some background: I have some data on structural dependencies in a base of code artifacts. The dependency structure is reflected in terms of relative node degrees, with each node representing some code unit (just as an example). This gives me real data of the following form (sorry for the longish posting): dat1 <- c(0.00245098039215686, 0, 0, 0, 0, 0, 0, 0, 0.0563725490196078, 0, 0, 0,