Skip to content

Commit

Permalink
Update deprecated syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Sep 1, 2023
1 parent 01316e3 commit 873dfe7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Imports:
methods,
Rcpp (>= 0.12.0),
RcppParallel (>= 5.0.1),
rstan (>= 2.18.1),
rstan (>= 2.26.0),
rstantools (>= 2.2.0),
scales,
tidybayes,
Expand All @@ -40,8 +40,8 @@ LinkingTo:
Rcpp (>= 0.12.0),
RcppEigen (>= 0.3.3.3.0),
RcppParallel (>= 5.0.1),
rstan (>= 2.18.1),
StanHeaders (>= 2.18.0)
rstan (>= 2.26.0),
StanHeaders (>= 2.26.0)
SystemRequirements: GNU make
Suggests:
bayesplot,
Expand Down
40 changes: 20 additions & 20 deletions inst/stan/distribution_covariate_model.stan
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,25 @@ data {

// delay distribution for time of kit use to reporting
int<lower=0> N_psi;
real<lower=0> psi[N_psi];
array[N_psi] real<lower=0> psi;

// vector (time, HSDA) of regions (coded 1 to N_region)
int<lower=1,upper=N_region> regions[N_distributed];
array[N_distributed] int<lower=1,upper=N_region> regions;

// vector (time, HSDA) of regions (coded 1 to N_t)
int<lower=1,upper=N_t> times[N_distributed];
array[N_distributed] int<lower=1,upper=N_t> times;

// vector (time, HSDA) of orders
int Orders[N];
array[N] int Orders;

// create 2D version of Orders data
int Orders2D[N_region,N_t];
array[N_region,N_t] int Orders2D;

// vector (time, HSDA) reported as distributed
int Reported_Distributed[N_distributed];
array[N_distributed] int Reported_Distributed;

// vector (time, HSDA) reported as used
int Reported_Used[N_distributed];
array[N_distributed] int Reported_Used;

//hyper-priors
real<lower=0> mu0_sigma;
Expand All @@ -122,9 +122,9 @@ transformed data{


// calculate discretized delay distribution
trunc_pmf = gamma_cdf(max_delays + 1, alpha, beta) - gamma_cdf(1, alpha, beta);
trunc_pmf = gamma_cdf(max_delays + 1 | alpha, beta) - gamma_cdf(1 | alpha, beta);
for (i in 1:max_delays){
distribute_pmf[i] = (gamma_cdf(i + 1, alpha, beta) - gamma_cdf(i, alpha, beta)) /
distribute_pmf[i] = (gamma_cdf(i + 1 | alpha, beta) - gamma_cdf(i | alpha, beta)) /
trunc_pmf;
}
// reverse delay distribution
Expand All @@ -141,21 +141,21 @@ transformed data{

// The parameters accepted by the model.
parameters {
real logp[N_distributed];
array[N_distributed] real logp;
real<lower=0> sigma;
real<lower=0> zeta;
real mu0;

real c[N_region]; // region covariates
real ct[N_t]; // time covariates
array[N_region] real c; // region covariates
array[N_t] real ct; // time covariates



}

//transformed parameters
transformed parameters{
real p[N_distributed];
array[N_distributed] real p;

p = inv_logit(logp);
}
Expand Down Expand Up @@ -196,17 +196,17 @@ model {

// simulated quantities based on model
generated quantities {
int sim_used[N];
array[N] int sim_used;
//vector[N] sim_used;
int Distributed[N];
int Distributed2D[N_region,N_t];
real sim_p[N];
real sim_p2D[N_region,N_t];
array[N] int Distributed;
array[N_region,N_t] int Distributed2D;
array[N] real sim_p;
array[N_region,N_t] real sim_p2D;

vector[N] sim_actual_used;

int region_distributed[N_t];
int convolve_region_distributed[N_t];
array[N_t] int region_distributed;
array[N_t] int convolve_region_distributed;


for(i in 1:N_region){
Expand Down

0 comments on commit 873dfe7

Please sign in to comment.