Displaying 20 results from an estimated 900 matches similar to: "Gibbs sampling"
2011 Nov 10
1
Gibbs sampler
I have the following code,
gibbs <-function(m,theta = 0.25, lambda =0.55, n =1){
alpha <- 1.5
beta <- 1.5
gamma <- 1.5
x<- array(0,c(m+1, 3))
x[1,1] <- theta
x[1,2] <- lambda
x[1,3]<- n
for(t in 2:(m+1)){
x[t,1] <- rbinom(1, x[t-1,3], x[t-1,1])
x[t,2]<-rbeta(1, x[t-1,1] + alpha, x[t-1,3] - x[t-1,1] + beta)
x[t,3]
2006 Jun 26
1
Griddy-Gibbs sampler
Hey everyone,
I have read the paper by Ritter and Tanner(1992) on Griddy-Gibbs sampler and I am trying to implement it in R without much luck. I was wondering if anyone had used this or could point me to any example code.
Thanks,
Liz
---------------------------------
[[alternative HTML version deleted]]
2004 Nov 18
1
gibbs sampling for mixture of normals
hi
i'm looking for a gibbs sampling algorithm for R for the case of mixture of K
normals, and in particular for the case of bivariate normals.
i'd be grateful if anyone could send its own R-routine, at least for the
univariate case.
thank you in advance
matteo
2009 Jan 25
1
Gibbs sampler...did it work?
I am writing a Gibbs sampler. I think it is outputting some of what I want,
in that I am getting vector of several thousand values (but not 10,000) in a
txt file at the end.
My question is, is the error message (see below) telling me that it can't
output 10,000 values (draws) because of a limitation in my memory, file
size, shape etc, or that there is an error in the sampler itself?
>
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
2004 Dec 07
4
Importing vector graphics into R
Dear R users,
I know of the possibility to import bitmaps via the nice pixmap library.
But if you later on create a PDF it is somewhat disappointing to
have such graphics bitmapped. Is there a trick (via maps?) to import a
vector graphic and have them plotted onto a graph? My searching attempts
in the searchable r-help archive did not seem to result in anything
useful...
Cheers,
hinrich
2005 Oct 03
3
spline.des
Hello, I am using library fda and I can not run a lot of functions because
I receive the error:
Error in bsplineS(evalarg, breaks, norder, nderiv) :
couldn't find function "spline.des"
do you know how I can fix that? Thnaks. Liliana
2010 Nov 10
2
Decimal places in a function output
An embedded and charset-unspecified text was scrubbed...
Name: n?o dispon?vel
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101110/9e098a24/attachment.pl>
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
2004 Jul 16
0
for loops in Gibbs sampler
Dear all:
I am using R to do multiple imputation for longitudinal data set. The
Gibbs chain basically requires draw posterior distribution of model
parameters, including the random effects. The multiple imputation requires
several independent Gibbs chains. So my program structure is like:
for (chain in 1:5)
{
# perform Gibbs sampling...
for (row in 1:row.no)
{
b.row=some function # draw
2000 Dec 15
0
Gibbs sampling in GLMMs: Beta testers required
Sort of a warning before I start: This post may be considered to
describe a rather amateurish approach to distributing software
which may annoy some people, but I sincerely hope it doesn't.
I've been working for some years with David Clayton on a project which
started life as
an S package but has now turned into an R library. It is (now)
called GLMMGibbs and estimates the parameters of
2004 Apr 16
0
autologistic regression with Gibbs sampler
Hello everyone,
I have some binary, spatially autocorrelated data I would like to run autologistic regression on. I hope to incorporate both ordinary covariates (environmental predictors) and a spatial autocovariate in the model, ideally with a second-order neighbourhood structure. Since my computing skills are limited, I am wondering if anyone has composed an algorithm for this purpose, and
2010 Nov 24
1
Frequency tables including the zero frequencies
An embedded and charset-unspecified text was scrubbed...
Name: n?o dispon?vel
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101123/bb780c83/attachment.pl>
2002 Jan 02
2
good book
to teach statistics with R
thanks
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2006 Aug 11
2
about MCMC pack again...
Hello, thank you very much for your previous answers about the C++ code.
I am interested in the application of the Gibbs Sampler in the IRT
models, so in the function MCMCirt1d and MCMCirtkd. I've found the C++
source codes, as you suggested, but I cannot find anything about the
Gibbs Sampler. All the files are for the Metropolis algorithm.
Maybe I am not able to read them very well, by the
2004 Apr 27
3
se.fit in predict.glm
Hi Folks,
I'm seeking confirmation of something which is probably true
but which I have not managed to find in the documentation.
I have a binary response y={0.1} and a variable x and have
fitted a probit response to the data with
f <- glm( y~x, family=binomial(link=probit) )
and then, with a specified set of x-value X I have used the
predict.glm function as
p <- predict( f, X,
2007 Sep 14
10
Mixing SATA & PATA Drives
I suspect it''s probably not a good idea but I was wondering if someone
could clarify the details.
I have 4 250G SATA(150) disks and 1 250G PATA(133) disk. Would it
cause problems if I created a raidz1 pool across all 5 drives?
I know the PATA drive is slower so would it slow the access across the
whole pool or just when accessing that disk?
Thanks for your input.
- Chris
2011 Apr 11
1
rtmvt
I have been using the rtmvt function in the {tmvtnorm} package i'm getting
the warning:
"Acceptance rate is very low and rejection sampling becomes inefficient.
Consider using Gibbs sampling."
but i AM specifying the gibbs algorithm!!:
rtmvt(M, mean=q[,,i,j], sigma=((u[i,j] + nu[i])/(p+nu[i]))*delta[,,i],
df=ceiling(nu[i]+p), lower=c(0,0), algorithm="gibbs")
Any
2011 Nov 07
3
Correction in error
Hello R community, following is my code and it shows error, can some one
fix this error and explain why this occurs?
gibbs <-function(m,n, theta = 0, lambda = 1){
alpha <- 1.5
beta <- 1.5
gamma <- 1.5
x<- array(0,c(m+1, 3))
x[1,1] <- theta
x[1,2] <- lambda
x[1,3]<- n
for(t in 2:m+1){
x[t,1] <- rbinom(x[t-1,3], 1, x[t-1,1])
2009 Aug 17
1
Bayesian data analysis - help with sampler function
I have downloaded the Umacs (Universal Markov chain sampler) and submitted the following sample code from Kerman and Gelman.
s <-Sampler(
J=8,
sigma.y =c(15,10,16,11,9,11,10,18),
y =c(28, 8,-3,7,-1,1,18,12),
theta =Gibbs(theta.update,theta.init),
V =Gibbs(V.update,mu.init),
mu =Gibbs(mu.update,mu.init),
tau =Gibbs(tau.update,tau.init),