Displaying 9 results from an estimated 9 matches for "dcat".
Did you mean:
cat
2010 Jun 23
1
A question about R2Winbugs
...+a*mu[k,t-1]
}
# cluster varicance tau
sigma0.r[k] ~ dbeta(1,1)
sigma.r[k] <- s*sigma0.r[k]
sigma[k] <- sigma.r[k]*sigma.r[k]
tau[k] <- 1/sigma[k]
}
# cluster indicator Z and observation X
for (n in 1:N)
{
Z[n,1] ~ dcat(q1[1:K])
X[n,1] ~ dnorm(mu[Z[n,1],1],tau[Z[n,1]])
for (t in 2:T)
{
Z[n,t] ~ dcat(q[Z[n,t-1],1:K])
X[n,t] ~ dnorm(mu[Z[n,t],t],tau[Z[n,t]])
}
}
# prior on transition matrix Q
# each row of Q has a Dirichlet prior realized by Gamma...
2006 Apr 05
2
R2WinBUGS error
...lt;- -(k[j] + mu[i] + b[i])
}
# probability that response = j
p[i,1] <- max( min(1 - Q[i,1], 1), 0)
for (j in 2 : Ncut)
{
p[i,j] <- max( min(Q[i,j-1] - Q[i,j],1), 0)
}
p[i,(Ncut+1)] <- max( min(Q[i,Ncut], 1), 0)
q02[i] ~ dcat(p[i, ])
}
}
[[alternative HTML version deleted]]
2008 Jan 04
2
R2WinBUGS sending variables as factors
...e Variables
nSeaWiFS <- mSeaW/s_dSeaW
for(i in 1:N) {
log(lambda[i]) <- delta0 + alpha1 * Month[i] + alpha2 * Lat[i] +
beta1 * (SeaW[i] - nSeaW)
logit(p[i]) <- gamma0
mu[i, 1] <- 0
mu[i, 2] <- lambda[i]
mu.i[i] <- mu[i, index[i]]
index[i] ~ dcat(theta[i, 1:2])
theta[i, 1] <- p[i]
theta[i, 2] <- 1 - p[i]
# mixture
YFTCPUE[i] ~ dpois(mu.i[i])
}
# recalculate the original intercept term
Intercept <- delta0 - beta1 * nSeaW
#prior on regression coefficients
beta1 ~ dnorm(0,1.0E-6)
alpha2 ~ dnorm(0,1.0E-...
2010 Mar 16
0
an ordinal regression MCMC run high correlation
...rrelation of a1 and tau. I thought 10,000 is a pretty big number and the chain converges really slow. I am a new MCMC user and don't know other ways to solve this problem.
Will someone please give some suggestions that may apply to this specific modeling?
model {
for ( i in 1:N) {
response[i]~dcat( p[physician[i], ] )
}
for (j in 1:Nt) {
p[j,1]<-1-Q[j,1]
p[j,2]<-Q[j,1]-Q[j,2]
p[j,3]<-Q[j,2]
logit(Q[j,1])<--c[j]
logit(Q[j,2])<--(c[j]+theta)
score[j]<-0.5*p[j,2]+p[j,3]
c[j]~dnorm(a1, tau)
}
a1~dnorm(0, 1.0E-06)
theta~dnorm(0, 1.0E-06)I(0,)
tau~dgamma(0.001,0.001)
}
list(N=6...
2010 Mar 16
0
Fw: an ordinal regression MCMC run high correlation
...0 is a pretty
> big number and the chain converges really slow. I am a new
> MCMC user and don't know other ways to solve this problem.
> Will someone please give some suggestions that may apply to
> this specific modeling?
>
> model {
> for ( i in 1:N) {
> response[i]~dcat( p[physician[i], ] )
> }
>
> for (j in 1:Nt) {
> p[j,1]<-1-Q[j,1]
> p[j,2]<-Q[j,1]-Q[j,2]
> p[j,3]<-Q[j,2]
> logit(Q[j,1])<--c[j]
> logit(Q[j,2])<--(c[j]+theta)
> score[j]<-0.5*p[j,2]+p[j,3]
> c[j]~dnorm(a1, tau)
> }
> a1~dnorm(0, 1.0E-06)
>...
2012 Oct 26
1
Openbugs- Array Index
...[i] <- prop[i]/sum(prop[])
}
for(i in 1:(S+m)){
r[i] ~ dnorm(mu.r,tau.r) I(-2,2)# generating parameters related to
detectability
p[i] <- 1/(1+exp(-(r[i])))# individual-level detection probability
w[i] ~ dbern(psi)# indicator variable whether each species is exposed to
sampling or not
G[i] ~ dcat(prob[1:g])# group identity
for(h in 1:2){# habitat effects
habitat.eff[i,h] ~ dnorm(mu.h[G[i],h],tau.h[G[i],h]) I(-2,2)
}
for(j in 1:4){# fitting process
# 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 ea...
2006 Apr 06
0
R2WinBUGS erro
...+ mu[i] + b[i])
}
# probability that response = j
p[i,1] <- max( min(1 - Q[i,1], 1), 0)
for (j in 2 : Ncut)
{
p[i,j] <- max( min(Q[i,j-1] - Q[i,j],1), 0)
}
p[i,(Ncut+1)] <- max( min(Q[i,Ncut], 1), 0)
q02[i] ~ dcat(p[i, ])
}
}
[[alternative HTML version deleted]]
2010 Apr 08
1
a small question about R with Winbugs
...ivariate normal, but Winbugs
always says "expected multivariate node", does that mean I miss something at
initialization? I will really appreciate the help to solve this problem
Here is the R code, and Winbugs code.
model
{
for(i in 1:N){
y[i,1:2] ~ dmnorm(mu[i,],tau[i,,])
S[i] ~ dcat(pi[])
mu[i,1:2] <- mu.star[S[i],]
tau[i,1:2,1:2] <- tau.star[S[i],,]}
# Constructive DPP
# Stick breaking prior
p[1] <- r[1]
for (j in 2:C) {p[j] <- r[j]*(1-r[j-1])*p[j-1]/r[j-1]}
p.sum <- sum(p[])
for (j in 1:C) {r[j] ~ dbeta(1,alpha); pi[j] <- p[j]/p.sum}
# Basel...
2012 Jul 13
3
Help with R2 OpenBUGs
...op[i]/sum(prop[])
}
for(i in 1:(S+m)){
r[i] ~ dnorm(mu.r,tau.r) I(-5,5) # generating parameters related to
detectability
p[i] <- 1/(1+exp(-(r[i]))) # individual-level detection probability
w[i] ~ dbern(psi) # indicator variable whether each species is exposed
to sampling or not
G[i] ~ dcat(prob[1:g]) # group identity
for(h in 1:3){ # habitat effects
habitat.eff[i,h] ~ dnorm(mu.h[G[i],h],tau.h[G[i],h]) I(-5,5)
}
for(j in 1:20){ # fitting process
# ecological process model
lambda[i,j] <- exp(habitat.eff[i,habitat[j]])
Z[i,j] ~ dpois(lambda[i,j]) # latent abundance of each sp...