search for: dbin

Displaying 17 results from an estimated 17 matches for "dbin".

Did you mean: bin
2007 May 14
1
Hierarchical models in R
Is there a way to do hierarchical (bayesian) logistic regression in R, the way we do it in BUGS? For example in BUGS we can have this model: model {for(i in 1:N) { y[i] ~ dbin(p[i],n[i]) logit(p[i]) <- beta0+beta1*x1[i]+beta2*x2[i]+beta3*x3[i] } sd ~ dunif(0,10) tau <- pow(sd, -2) beta0 ~ dnorm(0,0.1) beta1 ~ dnorm(0,tau) beta2 ~ dnorm(0,tau) beta3 ~ dnorm(0,tau) } where we put a prior on the parameters betas, but the sd of the pri...
2008 Dec 09
1
expected variable name error pos 98349 WInBUGS in R
...k("nausea_random.txt") # check model file > model is syntactically correct > > modelData("nauseadata.txt") # read data file > expected variable name error pos 98349 > *MODEL* > model > { > for (i in 1:n.samples) > {NAUSEA[i] ~ dbin(p[i],1) > logit(p[i]) <- alpha[SITEID[i]]} > #for(k in 1:n.params) > #{b[k]~ dnorm(0.0,tau)} > for (j in 1:n.sites) > {alpha[j]~dnorm(0.0,1.0E-10)} > > tau ~ dgamma(0.001,0.001) > } > *Dataset:* > SITEID NAUSEA > 1 0 > 1 1 > 1 1 > 1 0 > 1 1 > 1 1 &...
2009 Jan 08
1
Alignment of image plot overlay
...end line begins about an inch into the image plot x-axis and ends about an inch off of end of the image plot. Once I have the alignment sorted, I need to put a secondary y-axis on the image plot which is scaled for the trend line. An example plot is attached. My code follows. tad.image(ptt.tad, dbins, interp=T, loess.interp=F, ylim=c(300,1), main="STM07.4", zlim=c(0,1)) axis(4, at=c(1,2,3,4), labels=c(1,2,3,4), tick=T, las=1) par(new=T) plot(x=stm$dal, y=stm$model, ann=F, axes=F, type="l", col="black", lwd=2) Ideas involving the use of par(usr=c(,,,)) haven'...
2008 Dec 07
1
Reading txt file in R
...nit.txt") > modelCheck("nausea_random.txt")       # check model file model is syntactically correct > modelData("nauseadata.txt")                     # read data file expected variable name error pos 134022 Model statement: model { for (i in 1:n.samples) {NAUSEA[i] ~ dbin(p[i],1) logit(p[i]) <- alpha[SITEID[i]] + b[1] + b[2]*BMI[i]} for(k in 1:n.params) {b[k]~ dnorm(0.0,tau)} for (j in 1:n.sites) {alpha[j]~dnorm(0.0,1.0E-10)} tau ~ dgamma(0.001,0.001) } Sample Dataset: USUBJID SITEID BMI NAUSEA  01  0  01  0  01  0  01  0  01  0  01  0  01  0  01  0  01  0 302...
2005 Jul 27
1
error message running R2WinBUGS
...I try to run Winbugs from R using bugs function in R2WinBUGS.My model works well in Winbugs except that I can't get DIC. Since I don't need DIC, when I try to run Winbugs from R , I set "DIC=FALSE". My model is as following: model { for (i in 1:N) { for(j in 1 : T ) { x[i, j] ~ dbin(p[i, j],n[i]) #Hier.prior p[i, j] ~ dbeta(alpha[i, j], beta[i, j]) alpha[i, j] < - pi[ j]*(1-theta[i])/theta[i] beta[i, j] < -(1-pi[ j])*(1-theta[i])/theta[i] } } for(j in 1 : T ) { pi[ j ] ~dbeta(0.1,0.1)I(0.1,0.9) } for (i in 1:N) { theta[i] ~dbeta(2,10) } } And my R code is as follo...
2011 Aug 11
1
R crashes when communicating with JAGS
...rs, David Here's the test code: #------------------------------------------- require(R2WinBUGS) require(rjags) require(R2jags) ## write model file: print(list.modules()) write.model(con="blah.bug",model=function() { for( i in 1 : N ) { r[i] ~ dbin(p[i],n[i]) b[i] ~ dnorm(0.0,tau) logit(p[i]) <- alpha0 + alpha1 * x1[i] + alpha2 * x2[i] + alpha12 * x1[i] * x2[i] + b[i] } alpha0 ~ dnorm(0.0,1.0E-6) alpha1 ~ dnorm(0.0,1.0E-6) alpha2 ~ dnorm(0.0,1.0E-6) alpha12 ~ dnorm(0.0,1.0E-6...
2008 Dec 08
1
Reading txt file in R to run Random Intercept Model
...uot;nauseainit.txt") > modelCheck("nausea_random.txt") # check model file model is syntactically correct > modelData("nauseadata.txt") # read data file expected variable name error pos 98349 *MODEL* model { for (i in 1:n.samples) {NAUSEA[i] ~ dbin(p[i],1) logit(p[i]) <- alpha[SITEID[i]]} #for(k in 1:n.params) #{b[k]~ dnorm(0.0,tau)} for (j in 1:n.sites) {alpha[j]~dnorm(0.0,1.0E-10)} tau ~ dgamma(0.001,0.001) } *Dataset:* SITEID NAUSEA 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 1 1 -Anamika [[alternativ...
2003 Dec 30
0
no Profiles created at logon
...o 777 Smb.conf # Global parameters [global] workgroup = FALLICA.NET netbios name = SERVER server string = Samba %v interfaces = 192.168.0.1/24 encrypt passwords = Yes log level = 2 log file = /profiles/%m.log add user script = /usr/dbin/useradd -d /dev/null -g 100 -s /bin/false -M %u logon script = logon.bat logon path = \\%L\profiles\%u logon drive = H: logon home = \\%L\homes\%u domain logons = Yes os level = 64 preferred master = True domain master = True w...
2013 Jun 24
0
Running MCMC using R2WinBUGS
...+ } Y1 Y2 1 11 6 2 8 5 3 25 13 4 1 13 5 8 22 Y1 Y2 1 9 1 2 7 9 3 25 13 4 1 18 5 9 12 #Model model { for (j in 1 : Nf) { p1[j, 1:2 ] ~ dmnorm(gamma[1:2], T[1:2 ,1:2]) # T is the precision matrix or inverse sigma for MVN for (i in 1:2) { logit(p[j,i])<-p1[j,i] Y[j,i] ~ dbin(p[j,i],n) } } # Hyper-priors: gamma[1:2] ~ dmnorm(mn[1:2],prec[1:2 ,1:2]) mn<-c(-1.59,-2.44) prec<-structure(.Data = c(.001,0,0,.001),.Dim = c(2, 2)) expit[1]<-exp(gamma[1])/(1+exp(gamma[1])) expit[2]<-exp(gamma[2])/(1+exp(gamma[2])) T[1:2 ,1:2] ~ dwish(R[1:2 ,1:2], 2) sigma2...
2012 Oct 26
1
Openbugs- Array Index
...# ecological process model lambda[i,j] <- exp(habitat.eff[i,habitat[j]]) Z[i,j] ~ dpois(lambda[i,j])# latent abundance of each species at each site at each visit A[i,j] <- Z[i,j]*w[i]# latent abundance only for species exposed to sampling for(v in 1:5){ # detection process model AY[i,j,v] ~ dbin(p[i],A[i,j]) } } # group identity (indicator variable) G1[i] <- equals(G[i],1) G2[i] <- equals(G[i],2) } for(i in 1:(S+m)){ for(j in 1:4){ A1[i,j] <- A[i,j]*G1[i] A2[i,j] <- A[i,j]*G2[i] O[i,j] <- step(A[i,j]-1)# latent occupancy of each species for each site O1[i,j] <- O[i,j]*G...
2011 May 27
1
Error with BRugs 0.53 and 0.71, on Win7 with R 2.12.2 and 2.13.0 (crashes R GUI)
...or from modelCheck(): Error in handleRes(res[[3]]) : An OpenBUGS module or procedure was called that did not exist. The specific code seems not to matter, but here is an example (model taken from the OpenBUGS tutorial): modelString = " model { for (i in 1:N) { r[i] ~ dbin(p[i], n[i]) b[i] ~ dnorm(0, tau) logit(p[i]) <- alpha0 + alpha1 * x1[i] + alpha2 * x2[i] + alpha12 * x1[i] * x2[i] + b[i] } alpha0 ~ dnorm(0, 1.0E-6) alpha1 ~ dnorm(0, 1.0E-6) alpha2 ~ dnorm(0, 1.0E-6) alpha12 ~ dnorm(0, 1.0E-6...
2007 Jul 12
0
No subject
...is where I do the insert) > > exten => valid_login,1,NoOp() > exten => valid_login,n,Set(CALLDATE=${STRFTIME(${EPOCH},GMT+5,%x %X)}) > exten => valid_login,n,Set(CLID=${CALLERID(num)}) > exten => valid_login,n,Set(UNID=${CDR(uniqueid)}) > exten => valid_login,n,Set(DBINS = > ${ODBC_DISA(${CALLDATE},${CLID},${ID_ENTERED},${UNID})}) > exten => > valid_login,n,Playback(/var/lib/asterisk/sounds/custom/disa_greet3) > exten => valid_login,n,DISA("no-password",from-disa,"XXXXXXX" > <614xxxxxxxx>) > exten => valid_login...
2010 Aug 10
0
Error in R2Bugs
...arameters=parmlist, model.file=modfile, n.chains=3, n.iter=2000, DIC=TRUE, n.burnin=500, bugs.directory="/Program Files/OpenBUGS", program="openbugs", debug=TRUE) model { for (i in 1:N){ # No. of sect x dist plots r[i]~dbin(p[i], n[i]) eps.ind[i]~dnorm(0, tau.ind) logit(p[i]) <- b.lev*Lev[i] + b.light*Light[i] + b.con*Consp[i] + b.dcon*DConsp[i] + b.s1*Soil1[i] + b.s2*Soil2[i] + b.s3*Soil3[i] + eps.sp[Sp[i]] + eps.plt[Plot[i]] + eps[Sp[i], Plot[i]] + eps.i...
1997 Jul 18
2
MMap failed with code 22
...either PROT_READ or PROT_WRITE in the prot argument. [EINVAL] The file descriptor, fd, is not a valid file descriptor for a character device. This problem was previously raised in DIgest 1327 > Date: Mon, 16 Jun 1997 01:51:52 GMT > From: David Binette <dbin@sce.de> > To: samba@arvidsjaur.anu.edu.au > Subject: smb_shm_open mmap failed with code 22 > Message-ID: <33a899ea.67902989@mail.sce.de> ... > from /usr/local/samba/log/log. > ERROR smb_shm_open : mmap failed with code 22 > ERROR smb_shm_open : mmap failed with code 22...
2008 Dec 19
5
Authorize & Microsoft SQL
Hello Everyone, I have an installation where the client has a Microsoft SQL database that holds all of their case information. They would like the asterisk system to require users to enter a valid case number when making an outgoing call. I?m seeing some documentation regarding people using Microsoft SQL for CDR storage, however nothing regarding validating authentication using a Microsoft SQL
2010 Nov 15
2
Zero truncated Poisson distribution & R2WinBUGS
...rm priors p0~dunif(0,1) lam1~dgamma(.01,.01) # Likelihood # Biological model for true abundance for (i in 1:R) { # Loops over R sites N1[i] ~ dpois(lambda1[i]) lambda1[i] <- lam1 } # Observation model for replicated counts for (i in 1:n) { # Loops over all n observations C1[i] ~ dbin(p1[i], N1[site.p[i]]) p1[i] <-p0 } # Derived quantities totalN1 <- sum(N1[]) # Estimate total population size across all sites } ",fill=TRUE) sink() # Package data for WinBUGS R = dim(y)[1] # number of sites: 200 n = dim(y)[1] * dim(y)[2]#number of observations (sites*surveys) win...
2012 Jul 13
3
Help with R2 OpenBUGs
...gical process model lambda[i,j] <- exp(habitat.eff[i,habitat[j]]) Z[i,j] ~ dpois(lambda[i,j]) # latent abundance of each species at each site at each visit A[i,j] <- Z[i,j]*w[i] # latent abundance only for species exposed to sampling for(v in 1:7){ # detection process model AY[i,j,v] ~ dbin(p[i],A[i,j]) } } # group identity (indicator variable) G1[i] <- equals(G[i],1) G2[i] <- equals(G[i],2) } for(i in 1:(S+m)){ for(j in 1:20){ A1[i,j] <- A[i,j]*G1[i] A2[i,j] <- A[i,j]*G2[i] O[i,j] <- step(A[i,j]-1) # latent occupancy of each species for each site O1[i,j] <-...