Skip to content

Checking whether lower/upper bounds are finite breaks backward compatibility #2367

@andrjohns

Description

@andrjohns

Description

The lb_constrain and ub_constrain functions were recently updated to check that the provided limits are finite, however this is breaking some stan_surv models in the rstanarm package.

The stan_surv function uses a conditional to determine whether some parameters should be lower-bounded at zero or at negative_infinity() (i.e., unrestricted):

  /**
  * Return the lower bound for the baseline hazard parameters
  *
  * @param type An integer indicating the type of baseline hazard
  * @return A real
  */
  real coefs_lb(int type) {
    real lb;
    if (type == 2) // B-splines, on log haz scale
      lb = negative_infinity();
    else if (type == 3) // piecewise constant, on log haz scale
      lb = negative_infinity();
    else
      lb = 0;
    return lb;
  }

The recent updates to the constrains is then causing these stan_surv models to fail: https://discourse.mc-stan.org/t/stan-surv-crashes-r-repeatedly/20715/11

Current Version:

v4.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions