-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
model-api/src/model-builder/code-blocks/prior/_with-covariates-template_
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## on the coefficients for each covariate. | ||
for(m in 1:length(X[1, ])) { | ||
Beta[m] ~ dnorm(0, VAGUE_COEF_PRIOR_SLOPE) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## on sigma for each site and/or stratum. | ||
for(k in 1:y.n.strata) { | ||
for(j in 1:y.n.site[k]) { | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## on sigma for each site and/or stratum. | ||
for(k in 1:y.n.strata) { | ||
for(j in 1:y.n.site[k]) { | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### on sigma.y for each stratum. | ||
#for(k in 1:y.n.strata) { | ||
# sigma.y[k] ~ dunif(0, 500) | ||
#} | ||
|
||
### on sigma for each site and/or stratum. | ||
for(k in 1:y.n.strata) { | ||
for(j in 1:y.n.site[k]) { | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Prior for delta parameter of GP distribution. | ||
for(k in 1:y.n.strata) { | ||
delta[k] ~ dunif(-1, 1) | ||
} | ||
C <- 10000 |
14 changes: 14 additions & 0 deletions
14
model-api/src/model-builder/code-blocks/prior/hurdle-ordinal-latent-beta-g0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## on the coefficients for the likelihood associated with the hurdle. | ||
for(k in 1:y.n.strata) { | ||
mu.G0[k] ~ dnorm(0, pow(1.5, -2)) # flat prior on proportion | ||
sigma.G0[k] ~ dgamma(0.01, 0.01) | ||
tau.G0[k] <- 1 / max(1E-12, sigma.G0[k]^2) | ||
G1[k] ~ dnorm(0, pow(1.5, -2)) | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
for(j in 1:y.n.site[k]) { | ||
G0[j, k] ~ dnorm(mu.G0[k], tau.G0[k]) | ||
G[j, 1, k] <- G0[j, k] | ||
G[j, 2, k] <- G1[k] | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
model-api/src/model-builder/code-blocks/prior/hurdle-ordinal-latent-beta-g0-b-drop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## on the coefficients for the likelihood associated with the hurdle. | ||
for(k in 1:y.n.strata) { | ||
mu.G0[k] ~ dnorm(0, pow(1.5, -2)) # flat prior on proportion | ||
sigma.G0[k] ~ dgamma(0.01, 0.01) | ||
tau.G0[k] <- 1 / max(1E-12, sigma.G0[k]^2) | ||
G1[k] ~ dnorm(0, pow(1.5, -2)) | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
for(j in 1:y.n.site[k]) { | ||
G0[j, k] ~ dnorm(mu.G0[k], tau.G0[k]) | ||
G[j, 1, k] <- G0[j, k] | ||
G[j, 2, k] <- G1[k] | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
model-api/src/model-builder/code-blocks/prior/hurdle-ordinal-latent-beta-g0-bg-drop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## on the coefficients for the likelihood associated with the hurdle. | ||
for(k in 1:y.n.strata) { | ||
mu.G0[k] ~ dnorm(0, pow(1.5, -2)) # flat prior on proportion | ||
sigma.G0[k] ~ dgamma(0.01, 0.01) | ||
tau.G0[k] <- 1 / max(1E-12, sigma.G0[k]^2) | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
for(j in 1:y.n.site[k]) { | ||
G0[j, k] ~ dnorm(mu.G0[k], tau.G0[k]) | ||
G[j, 1, k] <- G0[j, k] | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
model-api/src/model-builder/code-blocks/prior/hurdle-ordinal-latent-beta-g0-bg-drop-fixed-g0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## on the coefficients for the likelihood associated with the hurdle. | ||
for(k in 1:y.n.strata) { | ||
mu.G0[k] ~ dnorm(0, 1 / 1.5^2) | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
for(j in 1:y.n.site[k]) { | ||
G0[j, k] <- mu.G0[k] | ||
G[j, 1, k] <- G0[j, k] | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
model-api/src/model-builder/code-blocks/prior/hurdle-ordinal-latent-beta-g0-g-drop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## on the coefficients for the likelihood associated with the hurdle. | ||
for(k in 1:y.n.strata) { | ||
mu.G0[k] ~ dnorm(0, pow(1.5, -2)) # flat prior on proportion | ||
sigma.G0[k] ~ dgamma(0.01, 0.01) | ||
tau.G0[k] <- 1 / max(1E-12, sigma.G0[k]^2) | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
for(j in 1:y.n.site[k]) { | ||
G0[j, k] ~ dnorm(mu.G0[k], tau.G0[k]) | ||
G[j, 1, k] <- G0[j, k] | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
model-api/src/model-builder/code-blocks/prior/hurdle-ordinal-latent-beta-g0-g-drop-fixed-g0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## on the coefficients for the likelihood associated with the hurdle. | ||
for(k in 1:y.n.strata) { | ||
mu.G0[k] ~ dnorm(0, 1 / 1.5^2) | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
for(j in 1:y.n.site[k]) { | ||
G0[j, k] <- mu.G0[k] | ||
G[j, 1, k] <- G0[j, k] | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
model-api/src/model-builder/code-blocks/prior/hurdle-ordinal-latent-beta-g0-g1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## on slope and intercept parameters and their covariance matrix for each | ||
## site within each stratum. | ||
for(k in 1:y.n.strata) { | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
for(j in 1:y.n.site[k]) { | ||
G[j, 1:2, k] ~ dmnorm(G.hat[j, 1:2, k], Tau.G[, 1:2, k]) | ||
G.hat[j, 1, k] <- mu.G0[k] | ||
G.hat[j, 2, k] <- mu.G1[k] | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
mu.G0[k] ~ dnorm(0, pow(1.5, -2)) | ||
mu.G1[k] ~ dnorm(0, pow(1.5, -2)) | ||
Tau.G[1:2, 1:2, k] <- inverse(Sigma.G[1:2, 1:2, k]) | ||
Sigma.G[1, 1, k] <- sigma.G0[k]^2 | ||
sigma.G0[k] ~ dgamma(0.01, 0.01) | ||
Sigma.G[2, 2, k] <- sigma.G1[k]^2 | ||
sigma.G1[k] ~ dgamma(0.01, 0.01) | ||
Sigma.G[1, 2, k] <- rho.G[k] * sigma.G0[k] * sigma.G1[k] | ||
Sigma.G[2, 1, k] <- Sigma.G[1, 2, k] | ||
rho.G[k] ~ dunif(-1, 1) | ||
} |
21 changes: 21 additions & 0 deletions
21
model-api/src/model-builder/code-blocks/prior/hurdle-ordinal-latent-beta-g0-g1-b-drop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## on slope and intercept parameters and their covariance matrix for each | ||
## site within each stratum. | ||
for(k in 1:y.n.strata) { | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
for(j in 1:y.n.site[k]) { | ||
G[j, 1:2, k] ~ dmnorm(G.hat[j, 1:2, k], Tau.G[, 1:2, k]) | ||
G.hat[j, 1, k] <- mu.G0[k] | ||
G.hat[j, 2, k] <- mu.G1[k] | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
mu.G0[k] ~ dnorm(0, pow(1.5, -2)) | ||
mu.G1[k] ~ dnorm(0, pow(1.5, -2)) | ||
Tau.G[1:2, 1:2, k] <- inverse(Sigma.G[1:2, 1:2, k]) | ||
Sigma.G[1, 1, k] <- sigma.G0[k]^2 | ||
sigma.G0[k] ~ dgamma(0.01, 0.01) | ||
Sigma.G[2, 2, k] <- sigma.G1[k]^2 | ||
sigma.G1[k] ~ dgamma(0.01, 0.01) | ||
Sigma.G[1, 2, k] <- rho.G[k] * sigma.G0[k] * sigma.G1[k] | ||
Sigma.G[2, 1, k] <- Sigma.G[1, 2, k] | ||
rho.G[k] ~ dunif(-1, 1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### on sigma for each site and/or stratum. | ||
for(k in 1:y.n.strata) { | ||
for(j in 1:y.n.site[k]) { | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## max `response` for asymptotic functions. | ||
maxR ~ dunif(0, 100) |
7 changes: 7 additions & 0 deletions
7
model-api/src/model-builder/code-blocks/prior/negative-binomial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## on the variance of observations. | ||
for(k in 1:y.n.strata) { | ||
for(j in 1:y.n.site[k]) { | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
} |
4 changes: 4 additions & 0 deletions
4
model-api/src/model-builder/code-blocks/prior/negative-binomial-simple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## on kappa for each stratum. | ||
for(k in 1:y.n.strata) { | ||
kappa[k] ~ dunif(0, 10000) | ||
} |
12 changes: 12 additions & 0 deletions
12
model-api/src/model-builder/code-blocks/prior/ordinal-latent-normal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
for(k in 1:y.n.strata) { | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
# This code allows for site- or strata-level variances: .01 is rate and | ||
# shape parameter in flat gamma. | ||
for(j in 1:y.n.site[k]) { | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
} | ||
# Priors on cutpoints, 1 and nYlevels-1 are fixed (Kruschke 2nd ed., pg. 688) | ||
for(k in 2:(nYlevels - 2)) { | ||
theta[k] ~ dnorm(k + .05, 1/2^2) | ||
} |
5 changes: 5 additions & 0 deletions
5
model-api/src/model-builder/code-blocks/prior/with-covariates-hurdle-ordinal-latent-beta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## on the coefficients for each covariate. | ||
for(q in 1:length(X[1, ])) { | ||
Beta[q] ~ dnorm(0, VAGUE_COEF_PRIOR_SLOPE) | ||
Gamma[q] ~ dnorm(0, VAGUE_COEF_PRIOR_SLOPE) | ||
} |
4 changes: 4 additions & 0 deletions
4
...api/src/model-builder/code-blocks/prior/with-covariates-hurdle-ordinal-latent-beta-b-drop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## on the coefficients for each covariate. | ||
for(q in 1:length(X[1, ])) { | ||
Gamma[q] ~ dnorm(0, pow(1.5, -2)) | ||
} |
Empty file.
4 changes: 4 additions & 0 deletions
4
...api/src/model-builder/code-blocks/prior/with-covariates-hurdle-ordinal-latent-beta-g-drop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## on the coefficients for each covariate. | ||
for(q in 1:length(X[1, ])) { | ||
Beta[q] ~ dnorm(0, VAGUE_COEF_PRIOR_SLOPE) | ||
} |
8 changes: 8 additions & 0 deletions
8
model-api/src/model-builder/code-blocks/prior/zero-inflated-beta-binomial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## on `p.zero` for each stratum and sigma for each site and/or stratum. | ||
for(k in 1:y.n.strata) { | ||
p.zero[k] ~ dunif(0, 1) | ||
for(j in 1:y.n.site[k]) { | ||
VARIANCES_SPEC_SWITCH | ||
} | ||
VARIANCES_SPEC_HYPERS_SWITCH | ||
} |
4 changes: 4 additions & 0 deletions
4
model-api/src/model-builder/code-blocks/prior/zero-inflated-binomial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## on `p.zero` for each stratum. | ||
for(k in 1:y.n.strata) { | ||
p.zero[k] ~ dunif(0, 1) | ||
} |
6 changes: 6 additions & 0 deletions
6
model-api/src/model-builder/code-blocks/prior/zero-inflated-negative-binomial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## on `kappa`, `p.zero`, and `tau.epsilon` for each stratum. | ||
for(k in 1:y.n.strata) { | ||
kappa[k] ~ dunif(0, 10000) | ||
p.zero[k] ~ dunif(0, 1) | ||
} | ||
tau.epsilon <- 1 |
4 changes: 4 additions & 0 deletions
4
model-api/src/model-builder/code-blocks/prior/zero-inflated-poisson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## on `p.zero` for each stratum. | ||
for(k in 1:y.n.strata) { | ||
p.zero[k] ~ dunif(0, 1) | ||
} |