EpiNow2 Stan Functions
primarycensored.stan File Reference

Functions in this File

real expgrowth_cdf (real x, real xmin, real xmax, real r)
 
real expgrowth_lcdf (real x, real xmin, real xmax, real r)
 
real expgrowth_lpdf (real x, real xmin, real xmax, real r)
 
vector primary_lcdf_vec (vector p, int primary_id, array[] real primary_params, data real pwindow)
 
real discretestep_lcdf (data real d, vector boundaries, vector pmf, int primary_id, array[] real primary_params, data real pwindow)
 
vector hazards_to_pmf (vector hazards)
 
real discretehazard_lcdf (data real d, vector boundaries, vector hazards, int primary_id, array[] real primary_params, data real pwindow)
 
real pstep_lcdf (real t, vector boundaries, vector pmf)
 
real phazard_lcdf (real t, vector boundaries, vector hazards)
 
int check_for_uniform_terms (int dist_id, int primary_id)
 
int check_for_analytical (int dist_id, int primary_id)
 
real primarycensored_uniform_lcdf_from_terms (vector terms_d, vector terms_q, data real pwindow)
 
vector primarycensored_gamma_uniform_terms (real t, array[] real params)
 
real primarycensored_gamma_uniform_lcdf (data real d, real q, array[] real params, data real pwindow)
 
vector primarycensored_lognormal_uniform_terms (real t, array[] real params)
 
real primarycensored_lognormal_uniform_lcdf (data real d, real q, array[] real params, data real pwindow)
 
real log_weibull_g (real t, real shape, real scale)
 
vector primarycensored_weibull_uniform_terms (real t, array[] real params)
 
real primarycensored_weibull_uniform_lcdf (data real d, real q, array[] real params, data real pwindow)
 
vector primarycensored_gengamma_uniform_terms (real t, array[] real params)
 
real primarycensored_gengamma_uniform_lcdf (data real d, real q, array[] real params, data real pwindow)
 
real primarycensored_analytical_lcdf_raw (data real d, int dist_id, array[] real params, data real pwindow, int primary_id, array[] real primary_params)
 
real primarycensored_analytical_lcdf (data real d, int dist_id, array[] real params, data real pwindow, data real L, data real D, int primary_id, array[] real primary_params)
 
real primarycensored_analytical_cdf (data real d, int dist_id, array[] real params, data real pwindow, data real L, data real D, int primary_id, array[] real primary_params)
 
int check_for_analytical_vectorized (int dist_id, int primary_id, data real pwindow)
 
vector primarycensored_uniform_terms (real t, data int dist_id, array[] real params)
 
vector primarycensored_analytical_lcdf_vectorized (data int start, data int n, data int dist_id, array[] real params, data real pwindow)
 
int dist_has_positive_support (data int dist_id)
 
real primary_lcdf (real p, int primary_id, array[] real primary_params, data real pwindow)
 
int lognormal_lcdf_underflows (real y, real mu, real sigma)
 
real gengamma_lcdf (real y, real shape, real scale, real k)
 
real dist_lcdf (real delay, array[] real params, int dist_id)
 
real primary_lpdf (real x, int primary_id, array[] real params, real xmin, real xmax)
 
vector primarycensored_ode (real t, vector y, array[] real theta, array[] real x_r, array[] int x_i)
 
real primarycensored_log_normalizer (real log_cdf_D, real log_cdf_L, real L)
 
real primarycensored_apply_truncation (real log_cdf, real log_cdf_L, real log_normalizer, real L)
 
vector primarycensored_truncation_bounds (data real L, data real D, data int dist_id, array[] real params, data real pwindow, data int primary_id, array[] real primary_params)
 
real primarycensored_cdf (data real d, data int dist_id, array[] real params, data real pwindow, data real L, data real D, data int primary_id, array[] real primary_params)
 
real primarycensored_lcdf (data real d, data int dist_id, array[] real params, data real pwindow, data real L, data real D, data int primary_id, array[] real primary_params)
 
real primarycensored_lpmf (data int d, data int dist_id, array[] real params, data real pwindow, data real d_upper, data real L, data real D, data int primary_id, array[] real primary_params)
 
vector primarycensored_lcdf_vectorized (data int start, data int n, data int dist_id, array[] real params, data real pwindow, data int primary_id, array[] real primary_params)
 
vector primarycensored_sone_lpmf_vectorized (data int max_delay, data real L, data real D, data int dist_id, array[] real params, data real pwindow, data int primary_id, array[] real primary_params)
 
vector primarycensored_sone_pmf_vectorized (data int max_delay, data real L, data real D, data int dist_id, array[] real params, data real pwindow, data int primary_id, array[] real primary_params)
 

Function Documentation

◆ check_for_analytical()

int check_for_analytical ( int dist_id,
int primary_id )

Definition at line 139 of file primarycensored.stan.

References check_for_uniform_terms().

Referenced by primarycensored_cdf(), and primarycensored_lcdf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_for_analytical_vectorized()

int check_for_analytical_vectorized ( int dist_id,
int primary_id,
data real pwindow )

Definition at line 325 of file primarycensored.stan.

References check_for_uniform_terms().

Referenced by primarycensored_lcdf_vectorized().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_for_uniform_terms()

int check_for_uniform_terms ( int dist_id,
int primary_id )

Definition at line 135 of file primarycensored.stan.

Referenced by check_for_analytical(), and check_for_analytical_vectorized().

Here is the caller graph for this function:

◆ discretehazard_lcdf()

real discretehazard_lcdf ( data real d,
vector boundaries,
vector hazards,
int primary_id,
array[]real primary_params,
data real pwindow )

Definition at line 109 of file primarycensored.stan.

References discretestep_lcdf(), and hazards_to_pmf().

Referenced by primarycensored_analytical_lcdf_raw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ discretestep_lcdf()

real discretestep_lcdf ( data real d,
vector boundaries,
vector pmf,
int primary_id,
array[]real primary_params,
data real pwindow )

Definition at line 42 of file primarycensored.stan.

References primary_lcdf(), and primary_lcdf_vec().

Referenced by discretehazard_lcdf(), and primarycensored_analytical_lcdf_raw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dist_has_positive_support()

int dist_has_positive_support ( data int dist_id)

◆ dist_lcdf()

real dist_lcdf ( real delay,
array[]real params,
int dist_id )

Definition at line 398 of file primarycensored.stan.

References dist_has_positive_support(), gengamma_lcdf(), lognormal_lcdf_underflows(), phazard_lcdf(), and pstep_lcdf().

Referenced by primarycensored_ode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ expgrowth_cdf()

real expgrowth_cdf ( real x,
real xmin,
real xmax,
real r )

Definition at line 2 of file primarycensored.stan.

Referenced by expgrowth_lcdf().

Here is the caller graph for this function:

◆ expgrowth_lcdf()

real expgrowth_lcdf ( real x,
real xmin,
real xmax,
real r )

Definition at line 14 of file primarycensored.stan.

References expgrowth_cdf().

Referenced by primary_lcdf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ expgrowth_lpdf()

real expgrowth_lpdf ( real x,
real xmin,
real xmax,
real r )

Definition at line 23 of file primarycensored.stan.

Referenced by primary_lpdf().

Here is the caller graph for this function:

◆ gengamma_lcdf()

real gengamma_lcdf ( real y,
real shape,
real scale,
real k )

Definition at line 395 of file primarycensored.stan.

Referenced by dist_lcdf().

Here is the caller graph for this function:

◆ hazards_to_pmf()

vector hazards_to_pmf ( vector hazards)

Definition at line 100 of file primarycensored.stan.

Referenced by discretehazard_lcdf(), and phazard_lcdf().

Here is the caller graph for this function:

◆ log_weibull_g()

real log_weibull_g ( real t,
real shape,
real scale )

Definition at line 208 of file primarycensored.stan.

Referenced by primarycensored_weibull_uniform_terms().

Here is the caller graph for this function:

◆ lognormal_lcdf_underflows()

int lognormal_lcdf_underflows ( real y,
real mu,
real sigma )

Definition at line 389 of file primarycensored.stan.

Referenced by dist_lcdf().

Here is the caller graph for this function:

◆ phazard_lcdf()

real phazard_lcdf ( real t,
vector boundaries,
vector hazards )

Definition at line 132 of file primarycensored.stan.

References hazards_to_pmf(), and pstep_lcdf().

Referenced by dist_lcdf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primary_lcdf()

real primary_lcdf ( real p,
int primary_id,
array[]real primary_params,
data real pwindow )

Definition at line 376 of file primarycensored.stan.

References expgrowth_lcdf().

Referenced by discretestep_lcdf(), and primary_lcdf_vec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primary_lcdf_vec()

vector primary_lcdf_vec ( vector p,
int primary_id,
array[]real primary_params,
data real pwindow )

Definition at line 33 of file primarycensored.stan.

References primary_lcdf().

Referenced by discretestep_lcdf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primary_lpdf()

real primary_lpdf ( real x,
int primary_id,
array[]real params,
real xmin,
real xmax )

Definition at line 449 of file primarycensored.stan.

References expgrowth_lpdf().

Referenced by primarycensored_ode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_analytical_cdf()

real primarycensored_analytical_cdf ( data real d,
int dist_id,
array[]real params,
data real pwindow,
data real L,
data real D,
int primary_id,
array[]real primary_params )

Definition at line 318 of file primarycensored.stan.

References primarycensored_analytical_lcdf().

Referenced by primarycensored_cdf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_analytical_lcdf()

real primarycensored_analytical_lcdf ( data real d,
int dist_id,
array[]real params,
data real pwindow,
data real L,
data real D,
int primary_id,
array[]real primary_params )

Definition at line 292 of file primarycensored.stan.

References primarycensored_analytical_lcdf_raw(), primarycensored_apply_truncation(), primarycensored_log_normalizer(), and primarycensored_truncation_bounds().

Referenced by primarycensored_analytical_cdf(), and primarycensored_lcdf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_analytical_lcdf_raw()

real primarycensored_analytical_lcdf_raw ( data real d,
int dist_id,
array[]real params,
data real pwindow,
int primary_id,
array[]real primary_params )

◆ primarycensored_analytical_lcdf_vectorized()

vector primarycensored_analytical_lcdf_vectorized ( data int start,
data int n,
data int dist_id,
array[]real params,
data real pwindow )

Definition at line 343 of file primarycensored.stan.

References primarycensored_uniform_lcdf_from_terms(), and primarycensored_uniform_terms().

Referenced by primarycensored_lcdf_vectorized().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_apply_truncation()

real primarycensored_apply_truncation ( real log_cdf,
real log_cdf_L,
real log_normalizer,
real L )

Definition at line 488 of file primarycensored.stan.

Referenced by primarycensored_analytical_lcdf(), primarycensored_cdf(), and primarycensored_lcdf().

Here is the caller graph for this function:

◆ primarycensored_cdf()

real primarycensored_cdf ( data real d,
data int dist_id,
array[]real params,
data real pwindow,
data real L,
data real D,
data int primary_id,
array[]real primary_params )

◆ primarycensored_gamma_uniform_lcdf()

real primarycensored_gamma_uniform_lcdf ( data real d,
real q,
array[]real params,
data real pwindow )

Definition at line 177 of file primarycensored.stan.

Referenced by primarycensored_analytical_lcdf_raw().

Here is the caller graph for this function:

◆ primarycensored_gamma_uniform_terms()

vector primarycensored_gamma_uniform_terms ( real t,
array[]real params )

Definition at line 160 of file primarycensored.stan.

Referenced by primarycensored_uniform_terms().

Here is the caller graph for this function:

◆ primarycensored_gengamma_uniform_lcdf()

real primarycensored_gengamma_uniform_lcdf ( data real d,
real q,
array[]real params,
data real pwindow )

Definition at line 248 of file primarycensored.stan.

References primarycensored_gengamma_uniform_terms(), and primarycensored_uniform_lcdf_from_terms().

Referenced by primarycensored_analytical_lcdf_raw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_gengamma_uniform_terms()

vector primarycensored_gengamma_uniform_terms ( real t,
array[]real params )

Definition at line 233 of file primarycensored.stan.

Referenced by primarycensored_gengamma_uniform_lcdf(), and primarycensored_uniform_terms().

Here is the caller graph for this function:

◆ primarycensored_lcdf()

real primarycensored_lcdf ( data real d,
data int dist_id,
array[]real params,
data real pwindow,
data real L,
data real D,
data int primary_id,
array[]real primary_params )

◆ primarycensored_lcdf_vectorized()

vector primarycensored_lcdf_vectorized ( data int start,
data int n,
data int dist_id,
array[]real params,
data real pwindow,
data int primary_id,
array[]real primary_params )

Definition at line 705 of file primarycensored.stan.

References check_for_analytical_vectorized(), dist_has_positive_support(), primarycensored_analytical_lcdf_vectorized(), and primarycensored_lcdf().

Referenced by primarycensored_sone_lpmf_vectorized().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_log_normalizer()

real primarycensored_log_normalizer ( real log_cdf_D,
real log_cdf_L,
real L )

◆ primarycensored_lognormal_uniform_lcdf()

real primarycensored_lognormal_uniform_lcdf ( data real d,
real q,
array[]real params,
data real pwindow )

Definition at line 200 of file primarycensored.stan.

References primarycensored_lognormal_uniform_terms(), and primarycensored_uniform_lcdf_from_terms().

Referenced by primarycensored_analytical_lcdf_raw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_lognormal_uniform_terms()

vector primarycensored_lognormal_uniform_terms ( real t,
array[]real params )

Definition at line 185 of file primarycensored.stan.

Referenced by primarycensored_lognormal_uniform_lcdf(), and primarycensored_uniform_terms().

Here is the caller graph for this function:

◆ primarycensored_lpmf()

real primarycensored_lpmf ( data int d,
data int dist_id,
array[]real params,
data real pwindow,
data real d_upper,
data real L,
data real D,
data int primary_id,
array[]real primary_params )

Definition at line 637 of file primarycensored.stan.

References dist_has_positive_support(), primarycensored_lcdf(), and primarycensored_log_normalizer().

Here is the call graph for this function:

◆ primarycensored_ode()

vector primarycensored_ode ( real t,
vector y,
array[]real theta,
array[]real x_r,
array[]int x_i )

Definition at line 456 of file primarycensored.stan.

References dist_lcdf(), and primary_lpdf().

Referenced by primarycensored_cdf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_sone_lpmf_vectorized()

vector primarycensored_sone_lpmf_vectorized ( data int max_delay,
data real L,
data real D,
data int dist_id,
array[]real params,
data real pwindow,
data int primary_id,
array[]real primary_params )

Definition at line 727 of file primarycensored.stan.

References dist_has_positive_support(), primarycensored_lcdf(), primarycensored_lcdf_vectorized(), and primarycensored_log_normalizer().

Referenced by primarycensored_sone_pmf_vectorized().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_sone_pmf_vectorized()

vector primarycensored_sone_pmf_vectorized ( data int max_delay,
data real L,
data real D,
data int dist_id,
array[]real params,
data real pwindow,
data int primary_id,
array[]real primary_params )

Definition at line 816 of file primarycensored.stan.

References primarycensored_sone_lpmf_vectorized().

Referenced by discretised_pmf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_truncation_bounds()

vector primarycensored_truncation_bounds ( data real L,
data real D,
data int dist_id,
array[]real params,
data real pwindow,
data int primary_id,
array[]real primary_params )

Definition at line 496 of file primarycensored.stan.

References dist_has_positive_support(), and primarycensored_lcdf().

Referenced by primarycensored_analytical_lcdf(), primarycensored_cdf(), and primarycensored_lcdf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_uniform_lcdf_from_terms()

real primarycensored_uniform_lcdf_from_terms ( vector terms_d,
vector terms_q,
data real pwindow )

Definition at line 148 of file primarycensored.stan.

Referenced by primarycensored_analytical_lcdf_vectorized(), primarycensored_gengamma_uniform_lcdf(), and primarycensored_lognormal_uniform_lcdf().

Here is the caller graph for this function:

◆ primarycensored_uniform_terms()

vector primarycensored_uniform_terms ( real t,
data int dist_id,
array[]real params )

Definition at line 330 of file primarycensored.stan.

References primarycensored_gamma_uniform_terms(), primarycensored_gengamma_uniform_terms(), primarycensored_lognormal_uniform_terms(), and primarycensored_weibull_uniform_terms().

Referenced by primarycensored_analytical_lcdf_vectorized().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ primarycensored_weibull_uniform_lcdf()

real primarycensored_weibull_uniform_lcdf ( data real d,
real q,
array[]real params,
data real pwindow )

Definition at line 225 of file primarycensored.stan.

Referenced by primarycensored_analytical_lcdf_raw().

Here is the caller graph for this function:

◆ primarycensored_weibull_uniform_terms()

vector primarycensored_weibull_uniform_terms ( real t,
array[]real params )

Definition at line 213 of file primarycensored.stan.

References log_weibull_g().

Referenced by primarycensored_uniform_terms().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pstep_lcdf()

real pstep_lcdf ( real t,
vector boundaries,
vector pmf )

Definition at line 118 of file primarycensored.stan.

Referenced by dist_lcdf(), and phazard_lcdf().

Here is the caller graph for this function: