Skip to content

Commit

Permalink
Rel 10.4.3 - Updates for cmdstan-2.33.0
Browse files Browse the repository at this point in the history
  • Loading branch information
goedman committed Sep 15, 2023
1 parent cd8e8d8 commit cf791df
Show file tree
Hide file tree
Showing 35 changed files with 69 additions and 70 deletions.
2 changes: 1 addition & 1 deletion Examples-Stan-Methods/Diagnose/diagnose.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanDiagnose
bernoulli_model = "
data {
int<lower=0> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ProjDir = @__DIR__
gq = "
data {
int<lower=0> N;
int<lower=0> y[N];
array[N] int<lower=0> y;
}
parameters {
real<lower=0.00001> Theta;
Expand Down
2 changes: 1 addition & 1 deletion Examples-Stan-Methods/Optimize/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanOptimize
bernoulli_model = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion Examples-Stan-Methods/Parse_and_Interpolate/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bernoulli_model = "
}
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion Examples-Stan-Methods/StanQuap/howell1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stan4_1 = "
// Inferring the mean and std
data {
int N;
real<lower=0> h[N];
array[N] real<lower=0> h;
}
parameters {
real<lower=0.1> sigma;
Expand Down
2 changes: 1 addition & 1 deletion Examples-Test-Cases/Diagnostics/diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, MCMCChains
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion Examples-Test-Cases/InitThetaDict/init_theta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, MCMCChains, Random
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion Examples-Test-Cases/InitThetaDictArray/init_dict_array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, MCMCChains
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion Examples-Test-Cases/InitThetaFile/init_file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ProjDir = @__DIR__
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion Examples-Test-Cases/NamedArray/namedarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, MCMCChains
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion Examples-Test-Cases/ScalarObs/scalar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, MCMCChains
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
4 changes: 2 additions & 2 deletions Examples-Test-Cases/ZeroLengthArray/zerolengtharray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ using StanSample, MCMCChains
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
real empty[0];
array[N] int<lower=0,upper=1> y;
array[0] real empty;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion Examples/Bernoulli/bernoulli.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using StanSample
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
10 changes: 5 additions & 5 deletions Examples/Dyes/dyes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ parameters {
real<lower=0> tau_between;
real<lower=0> tau_within;
real theta;
real mu[BATCHES];
array[BATCHES] real mu;
}
transformed parameters {
real sigma_between;
real sigma_within;
sigma_between <- 1/sqrt(tau_between);
sigma_within <- 1/sqrt(tau_within);
sigma_between = 1/sqrt(tau_between);
sigma_within = 1/sqrt(tau_within);
}
model {
Expand All @@ -39,8 +39,8 @@ generated quantities {
real sigmasq_between;
real sigmasq_within;
sigmasq_between <- 1 / tau_between;
sigmasq_within <- 1 / tau_within;
sigmasq_between = 1 / tau_between;
sigmasq_within = 1 / tau_within;
}
"

Expand Down
13 changes: 6 additions & 7 deletions Examples/Dyes/dyes_2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@ dyes ="
data {
int BATCHES;
int SAMPLES;
real y[BATCHES, SAMPLES];
//vector[SAMPLES] y[BATCHES];
matrix[BATCHES, SAMPLES] y;
}
parameters {
real<lower=0> tau_between;
real<lower=0> tau_within;
real theta;
real mu[BATCHES];
array[BATCHES] real mu;
}
transformed parameters {
real sigma_between;
real sigma_within;
sigma_between <- 1/sqrt(tau_between);
sigma_within <- 1/sqrt(tau_within);
sigma_between = 1/sqrt(tau_between);
sigma_within = 1/sqrt(tau_within);
}
model {
Expand All @@ -40,8 +39,8 @@ generated quantities {
real sigmasq_between;
real sigmasq_within;
sigmasq_between <- 1 / tau_between;
sigmasq_within <- 1 / tau_within;
sigmasq_between = 1 / tau_between;
sigmasq_within = 1 / tau_within;
}
"

Expand Down
10 changes: 5 additions & 5 deletions Examples/EightSchools/schools8.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ using StanSample, MCMCChains
eightschools ="
data {
int<lower=0> J; // number of schools
real y[J]; // estimated treatment effects
real<lower=0> sigma[J]; // s.e. of effect estimates
array[J] real y; // estimated treatment effects
array[J] real<lower=0> sigma; // s.e. of effect estimates
}
parameters {
real mu;
real<lower=0> tau;
real eta[J];
array[J] real eta;
}
transformed parameters {
real theta[J];
array[J] real theta;
for (j in 1:J)
theta[j] <- mu + tau * eta[j];
theta[j] = mu + tau * eta[j];
}
model {
eta ~ normal(0, 1);
Expand Down
4 changes: 2 additions & 2 deletions Examples/RedCardsStudy/redcardstudy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ rcd[!, :rater1] = Float64.(rcd.rater1)
stan_logistic_0 ="
data {
int<lower=0> N;
int<lower=0> n_redcards[N];
int<lower=0> n_games[N];
array[N] int<lower=0> n_redcards;
array[N] int<lower=0> n_games;
vector[N] rating;
}
parameters {
Expand Down
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
DimensionalData = "0703355e-b756-11e9-17c0-8b28908087d0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
InferenceObjects = "b5cf5a8d-e756-4ee3-b014-01d49d192c00"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Expand Down
2 changes: 1 addition & 1 deletion test/Examples-Stan-Methods/Diagnose/diagnose.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanDiagnose, Test
bernoulli_model = "
data {
int<lower=0> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ProjDir = @__DIR__
gq = "
data {
int<lower=0> N;
int<lower=0> y[N];
array[N] int<lower=0> y;
}
parameters {
real<lower=0.00001> Theta;
Expand Down
2 changes: 1 addition & 1 deletion test/Examples-Stan-Methods/Optimize/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanOptimize, Test
bernoulli_model = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion test/Examples-Stan-Methods/Parse_and_Interpolate/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cd(ProjDir) do
}
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion test/Examples-Stan-Methods/StanQuap/howell1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stan4_1 = "
// Inferring the mean and std
data {
int N;
real<lower=0> h[N];
array[N] real<lower=0> h;
}
parameters {
real<lower=0.1> sigma;
Expand Down
2 changes: 1 addition & 1 deletion test/Examples-Test-Cases/Diagnostics/diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, Test
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion test/Examples-Test-Cases/InitThetaDict/init_dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, Test
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, Test
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion test/Examples-Test-Cases/InitThetaFile/init_file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, Test
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion test/Examples-Test-Cases/ScalarObs/scalar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, Test
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
4 changes: 2 additions & 2 deletions test/Examples-Test-Cases/ZeroLengthArray/zerolengtharray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ using StanSample, Test
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
real empty[0];
array[N] int<lower=0,upper=1> y;
array[0] real empty;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
2 changes: 1 addition & 1 deletion test/Examples/Bernoulli/bernoulli.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using StanSample, Test
bernoullimodel = "
data {
int<lower=1> N;
int<lower=0,upper=1> y[N];
array[N] int<lower=0,upper=1> y;
}
parameters {
real<lower=0,upper=1> theta;
Expand Down
4 changes: 2 additions & 2 deletions test/Examples/Binomial/binomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ generated quantities {
int<lower=0> postpredk;
int<lower=0> priorpredk;
postpredk <- binomial_rng(n, theta);
priorpredk <- binomial_rng(n, thetaprior);
postpredk = binomial_rng(n, theta);
priorpredk = binomial_rng(n, thetaprior);
}
"

Expand Down
12 changes: 6 additions & 6 deletions test/Examples/Binormal/binormal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ binorm_model = "
matrix[2,2] Sigma;
vector[2] mu;
mu[1] <- 0.0;
mu[2] <- 0.0;
Sigma[1,1] <- 1.0;
Sigma[2,2] <- 1.0;
Sigma[1,2] <- 0.10;
Sigma[2,1] <- 0.10;
mu[1] = 0.0;
mu[2] = 0.0;
Sigma[1,1] = 1.0;
Sigma[2,2] = 1.0;
Sigma[1,2] = 0.10;
Sigma[2,1] = 0.10;
}
parameters {
vector[2] y;
Expand Down
Loading

0 comments on commit cf791df

Please sign in to comment.