Displaying 20 results from an estimated 400 matches similar to: "MCMC logit"
2007 May 03
1
Bayesian logistic regression with a beta prior (MCMClogit)
Dear all,
I am trying to use the logistic regression with MCMClogit (package:
MCMCpack/Coda) and I want to put a beta prior on the parameters, but it's
giving me error message (please see output below) no matter what shape 1 or
2 I use. It works perfect with the cauchy or normal priors. Do you know if
there is a catch there somewhere? Thanks
logpriorfun <- function(beta,shape1,shape2){
2008 Oct 19
1
MCMClogit: using weights
Hi everyone: I am just wondering how can I use weights with MCMClogit function (in MCMCpack package). For example, in case of glm function as given below, there is weights option in the arguments. Aparently there is no option of using weights in MCMClogit.
glm(formula, family = gaussian, data, weights, subset,
na.action, start = NULL, etastart, mustart,
offset, control =
2008 May 12
4
Several questions about MCMClogit
Hello everybody,
I'm new to MCMClogit. I'm trying to use MCMClogit to fit a logistic
regression model but I got some warnings I can't understand.
My input data X is 32(tissue sample)*20(genes) matrix, each element in this
matrix corresponds 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)
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 =
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 modified it to the GLM logit but I
can't adapt it to the
2010 Sep 29
1
sample exponential r.v. by MCMC
Dear R users,
I am leaning MCMC sampling, and have a problem while trying to sample
exponential r.v.'s via the following code:
samp <- MCMCmetrop1R(dexp, theta.init=1, rate=2,
mcmc=5000, burnin=500,
thin=10, verbose=500, logfun=FALSE)
I tried other distribtions such as Normal, Gamma with shape>1, it works
perfectly fine. Can someon
2009 Sep 22
2
Pull Coefficients from MCMCpack models
Hi,
I've been testing some models with the MCMCpack library.
I can run the process and get a nice model "object". I can easily see
the summary and even plot it.
I can't seem to figure out how to:
1) Access the final coefficients in the model
2) Turn the coefficients into a model so I can then run predictions
using them.
A summary command will SHOW Me the coefficients, but
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.
2006 Dec 07
2
Simulation in R
Hello!
I have the following problem.
My code:
--snip--
ergebnisse <- rep(0, each=2)
stichproben <- rep(0, each=2)
for (i in seq(1:2)) {
n <- dim(daten)[1]
ix <- sample(n,200) # producing samples
samp_i <- daten[ix,]
stichproben[i] <- samp_i # doesn???t works
# Calculation of the model:
posterior_i <- MCMClogit(y ~ fbl.ind + fekq3 + febitda4 + fuvs + fkru +
2013 Jun 24
0
Running MCMC using R2WinBUGS
Hi All:
Not sure why my previous question never got posted. Here I am seeking some
help on my code. I am using the following code to run MCMC simulation on
the following data using the model below:
# Data
matrix<-NULL
> csvs<-paste("MVN", 1:2,".csv",sep="")
> for (i in 1:length(csvs)){
+ matrix[[i]]<- read.csv(file=csvs[i],header=TRUE)
+
2006 Dec 07
1
Simulation in R - Part 2
Hello!
So, the simulation works (drawing 100 samples and then calculate the
model for each sample). Here is the code:
--snip--
# sample size n=200
ergebnisse200 <- rep(0, each=100)
stichproben200 <- vector(?list?, 100)
default200 <- rep(0, each=100)
for (i in seq(1:100)) {
n <- dim(daten)[1]
ix <- sample(n,200)
samp_i <- daten[ix,] # draw samples
y <- sum(samp_i$y)
2008 May 12
1
test
Sorry to bother your.
I am trying to post my question for more than 10 times, but I still
didn't see it.
It drives my crazy!!!
It is a test for posting some simple pure text.
Chao
2005 Sep 02
1
source package linking problem under linux
I'm having some problems in installing some source packages under linux.
As an example, MCMCpack. An error is raised when linking:
> install.packages("MCMCpack")
[...]
* Installing *source* package 'MCMCpack' ...
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking
2003 Jul 14
2
qualitative response model
Hi, I want to know is there other functions in R to
estimate qualitative response model besides multinom()
in library nnet, if this is the only possibility, I
have a question about the application:
for example:
there is three transportation choice : car, bus ,
subway.
each alternative has own characteristic variables,
I want to apply conditional logit model to analysis
the choice of three
2011 Feb 02
4
exact logistic regression
Hello to R people
Does anybody know to calculate exact logistic regression in R?
Does such option exist anywhere?
Surprisingly, could not find it using search engine. It is hard to
believe, however, that such useful function is not implemented in R yet?
Could you help, please
Thank you
Denis
2008 Sep 03
4
A new blog on the block for Linux newbies
Hi Good People,
I've created a blog to help newbies in the world of Linux. Can you
people see it and tell what departments that I've to improve more to help
the grate community of Linux.
Please click this link to go to my blog http://slinuxworld.blogspot.com/
Thank you
--
Sadaruwan Samaraweera
--
Sadaruwan Samaraweera
-------------- next part --------------
An HTML
2008 Sep 03
2
(no subject)
Hi Good People,
I've created a blog to help newbies in the world of Linux. Can you
people see it and tell what departments that I've to improve more to help
the grate community of Linux.
Thank you
--
Sadaruwan Samaraweera
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2003 Oct 04
3
a bug of function plot (PR#4405)
Full_Name: Ximing Zhao
Version: R 1.7.1
OS: MacOs X
Submission from: (NULL) (64.136.27.51)
When I used function plot in R 1.7.1, I found two bugs.
My whole function is this:
*****************
drawexp<-function(X,x,c,b){
exp<-function28(X,x,c,b)
if(max(exp)>=max(dexp(x,rate=1))){
plot(x,exp, type="l",main= paste("Exponential ,n=",length(X),"
2007 May 05
0
Response as matrix in MCMClogit?
I hope some of the authors of the package MCMCpack read this.
I don't know if there is a way to set the response in the model formula of
MCMClogit other than a (numeric) response vector. I think the MCMClogit in
the MCMCpack needs some development so that the response in the formula
could be set as a two-column matrix with the columns giving the numbers of
successes and failures (just as in
2009 May 03
3
Optim function in the loop
Hi all,
I wrote the following lines of codes try to do some iterations to find the
global optimal values, but the function does not execute properly. Every
time codes stop after one iteration right after executing the optim()
function. Does anyone could have me to take a look? Thanks.
if (count>0){
k=k+0.05;
mu0=c(83+k,0,0)
Sigma0= diag(0.4,3)
initpar=c(.1+10*k,10*k,10*k,10*k) # initial