stan-dev / stan-dev/math

censored weibull function

Open
#57 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature good first issue new function
Dominant language
C++
Stars
839
Forks
220
Avg merge
2d 4h
Merged PRs (30d)
14

Description

From @bob-carpenter on December 4, 2014 2:48

Aki Vehtari suggested building in a function that behaves like some R survival analysis packages:

real weibull_right_censored_log(real y, real sigma, real alpha, int z) {
  if (z == 0) return weibull_log(y,alpha,sigma);
  else return weibull_ccdf_log(y,alpha,sigma);
}

The int value z is used as an indicator as to whether the event was right censored at y or whether it was an ordinary outcome.

Aki also mentioned that it's common to have a vector of censored outcomes, all censored at the same place.

Copied from original issue: stan-dev/stan#1153

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the existing weibull_log and weibull_ccdf_log implementations and their tests, then review how distribution functions are exposed in the Stan Math Library. Implement the requested right-censored Weibull behavior for the event indicator, and determine from nearby APIs how shared censoring points should be represented. Done means both ordinary and right-censored outcomes have the expected log-probability behavior with coverage for the supported interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.