Displaying 20 results from an estimated 1000 matches similar to: "MCMCpack gelman.plot and gelman.diag"
2011 Feb 24
2
MCMCpack combining chains
Deal all, as MCMClogit does not allow for the specification of several chains, I have run my model 3 times with different random number seeds and differently dispersed multivariate normal priors.
For example:
res1 = MCMClogit(y~x,b0=0,B0=0.001,data=mydat, burnin=500, mcmc=5500, seed=1234, thin=5)
res2 = MCMClogit(y~x,b0=1,B0=0.01,data=mydat, burnin=500, mcmc=5500, seed=5678, thin=5)
res3 =
2004 Mar 04
1
Gelman-Rubin Convergence test
Dear friends,
I run the Gelman-Rubin Convergence test for a MCMC object I have and I
got the following result Multivariate psrf 1.07+0i, What does this mean? I
guess (if I am not mistaken) that I should get a psrf close to 1.00 but what
is 1.07+0i? Is that convergence or something else?
Jorge
[[alternative HTML version deleted]]
2004 Feb 11
0
gelman.diag question
Dear Friends,
I am trying to use the gelman-rubin convergence test. I generated a matrix
samp[10,000x86] with the gibbs sampler. the test requires the creation of
"mcmc" objects. Since I don't know how to define samp as a "mcmc" object, I
tried to create one mcmc object by means of the mcmc() function. With this
function I tried to create a mcmc object dul from samp but I
2010 Aug 09
1
creating pdf of wireframe
Dear R list,
I have written some code to produce several wireframe plots in a panel. They
look good, but when I try to create a pdf, many (but not all) of the details
I have specified are not reproduced. For example, the line width I have
specified is not reproduced, and neither are the font sizes for the axis
labels. I'm an R novice, so I could really use some guidance.
Here is the code I am
2008 Feb 03
1
Effect size of comparison of two levels of a factor in multiple linear regression
Dear R users,
I have a linear model of the kind
outcome ~ treatment + covariate
where 'treatment' is a factor with three levels ("0", "1", and "2"),
and the covariate is continuous. Treatments "1" and "2" both have
regression coefficients significantly different from 0 when using
treatment contrasts with treatment "0" as the
2010 May 28
3
Gelman 2006 half-Cauchy distribution
Hi,
I am trying to recreate the right graph on page 524 of Gelman's 2006
paper "Prior distributions for variance parameters in hierarchical
models" in Bayesian Analysis, 3, 515-533. I am only interested, however,
in recreating the portion of the graph for the overlain prior density
for the half-Cauchy with scale 25 and not the posterior distribution.
However, when I try:
2011 Aug 10
2
function runif in for loop
Hello,
I'd like to perform a regression using MCMCregress (MCMCpack).
One variable therefore should be a function rather than a variable:
I want to use X as an input and X should be defined as a random number between to values. Therefore I want to use the function runif like:
X <-(1, Xa, Xb) but it seems that runif doesn't allow to use vectors.
So I think I've to calculate the new
2009 Jul 02
0
MCMCpack: Selecting a better model using BayesFactor
Dear R users,
Thanks in advance.
I am Deb, Statistician at NSW Department of Commerce, Sydney.
I am using R 2.9.1 on Windows XP.
This has reference to the package “MCMCpack”. My objective is to
select a better model using various alternatives. I have provided here
an example code from MCMCpack.pdf.
The matrix of Bayes Factors is:
model1 model2 model3
model1 1.000 14.08
2011 Mar 17
0
Gelman-Rubin convergence diagnostics via coda package
Dear,
I'm trying to run diagnostics on MCMC analysis (fitting a log-linear
model to rates data). I'm getting an error message when trying
Gelman-Rubin shrink factor plot:
>gelman.plot(out)
Error in chol.default(W) :
the leading minor of order 2 is not positive definite
I take it that somewhere, somehow a matrix is singular, but how can
that be remedied?
My code:
library(rjags)
2012 Oct 03
0
calculating gelman diagnostic for mice object
I am using -mice- for multiple imputation and would like to use the gelman
diagnostic in -coda- to assess the convergence of my imputations. However,
gelman.diag requires an mcmc list as input. van Buuren and
Groothuis-Oudshoorn (2011) recommend running mice step-by-step to assess
convergence (e.g. imp2 <- mice.mids(imp1, maxit = 3, print = FALSE) ) but
this creates mids objects. How can I
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
2007 Feb 11
2
problem with Matrix package
I decided to update my packages and then had a problem with loading the
Matrix package
http://cran.at.r-project.org/bin/windows/contrib/2.4/Matrix_0.9975-9.zip
This is what happened when I tried to load it in:
> library("Matrix")
Error in importIntoEnv(impenv, impnames, ns, impvars) :
object 'Logic' is not exported by 'namespace:methods'
Error:
2006 May 02
2
evaluation of expressions
Hi, all. I'm trying to automate some regression operations in R but am
confused about how to evaluate expressoins that are expressed as
character strings. For example:
y <- ifelse (rnorm(10)>0, 1, 0)
sex <- rnorm(10)
age <- rnorm(10)
test <- as.data.frame (cbind (y, sex, age))
# this works fine:
glm (y ~ sex + I(age^2), data=test, family=binomial(link="logit"),
2010 Jul 13
0
Unknown Method key? error in Rails 2.3.8 Unit testing
I was writing unit tests for my models for a while. After that I was
tweaking around and again continued writing unit tests.
Earlier all my unit tests were working - successfully. But now WHen I
run them, it gives me
Loaded suite unit/post_test
Started
EEEE
Finished in 0.112698 seconds.
1) Error:
test_presence_of_body(PostTest):
NoMethodError: undefined method `key?'' for
2006 May 01
3
pulling items out of a lm() call
I want to write a function to standardize regression predictors, which
will require me to do some character-string manipulation to parse the
variables in a call to lm() or glm().
For example, consider the call
lm (y ~ female + I(age^2) + female:black + (age + education)*female).
I want to be able to parse this to pick out the input variables
("female", "age",
2006 Feb 01
1
student-t regression in R?
Is there a quick way to fit student-t regressions (that is, a regression
with t-distributed error, ideally with the degrees-of-freedom parameter
estimated from the data)? I can do it easily enough in Bugs, or I can
program the log-likelihood in R and optimize using optim(), but an R
version (if it's already been written by somebody) would be convenient,
especially for teaching purposes.
2008 Jan 21
2
multiple ids on restful action
Hi,
I know this question has come up before, but I couldn''t find a
satisfying answer.
Maybe I didn''t look well enough, so any pointers to old messages
regarding this subject would be welcome too.
I need some way to pass multiple ids to a resource.
Something like /posts/13,14
If I do this I have to manually split the id on ","s in the action,
and use
post_path([post1,
2006 Jan 10
2
lmer(): nested and non-nested factors in logistic regression
Thanks to some help by Doug Bates (and the updated version of the Matrix
package), I've refined my question about fitting nested and non-nested
factors in lmer(). I can get it to work in linear regression but it
crashes in logistic regression. Here's my example:
# set up the predictors
n.age <- 4
n.edu <- 4
n.rep <- 100
n.state <- 50
n <- n.age*n.edu*n.rep
age.id
2008 Dec 20
2
Problems installing lme4 on Ubuntu
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
While I'm not an R expert, I have used R on Windows XP. Now I've moved
to Ubuntu (Intrepid), and I'm trying to configure R to work with the
Gelman and Hill _Data Analysis Using Regression and
Multilevel/Hierarchical Models_. So far, it's not working.
I start by following the instructions for installing arm and BRugs at
2011 Aug 15
2
MCMC regress, using runif()
Hello,
just to follow up a question from last week. Here what I've done so far (here an example):
library(MCMCpack)
Y=c(15,14,23,18,19,9,19,13)
X1=c(0.2,0.6,0.45,0.27,0.6,0.14,0.1,0.52)
X2a=c(17,22,21,18,19,25,8,19)
X2b=c(22,22,29,34,19,26,17,22)
X2 <- function()runif(length(X2a), X2a, X2b)
model1 <- MCMCregress(Y~X1+X2())
summary(model1)
but I am not sure if my X2-function is