Package 'greta.censored'

Title: Censored Distributions for 'greta'
Description: Provides additional censored distributions for use with 'greta', a probabilistic programming framework for Bayesian modeling. Includes censored versions of Normal, Log-Normal, Student's T, Gamma, Exponential, Weibull, Pareto, and Beta distributions with support for right, left, and interval censoring. For details on 'greta', see Golding (2019) <doi:10.21105/joss.01601>. The methods are implemented using 'TensorFlow' and 'TensorFlow Probability' for efficient computation.
Authors: Mlen-Too Wesley [aut, cre]
Maintainer: Mlen-Too Wesley <[email protected]>
License: Apache License 2.0
Version: 0.1.0
Built: 2024-11-29 13:56:09 UTC
Source: CRAN

Help Index


Beta Censored Distribution

Description

Creates a censored beta distribution for use with greta.

Usage

beta_censored(
  alpha,
  beta,
  is_censored,
  censor = "right",
  lower = NULL,
  upper = NULL,
  dim = length(is_censored)
)

Arguments

alpha

Shape parameter for successes.

beta

Shape parameter for failures.

is_censored

Logical vector indicating whether each observation is censored.

censor

Type of censoring: one of 'right', 'left', 'interval'.

lower

Lower bound for interval censoring (optional).

upper

Upper bound for interval censoring (optional).

dim

Dimension of the data (optional, defaults to length of alpha).

Value

A greta censored beta distribution node.


Exponential Censored Distribution

Description

Creates a censored exponential distribution for use with greta.

Usage

exponential_censored(
  rate,
  is_censored,
  censor = "right",
  lower = NULL,
  upper = NULL,
  dim = length(is_censored)
)

Arguments

rate

Rate parameter of the exponential distribution.

is_censored

Logical vector indicating whether each observation is censored.

censor

Type of censoring: one of 'right', 'left', 'interval'.

lower

Lower bound for interval censoring (optional).

upper

Upper bound for interval censoring (optional).

dim

Dimension of the data (optional, defaults to length of rate).

Value

A greta censored exponential distribution node.


Gamma Censored Distribution

Description

Creates a censored gamma distribution for use with greta.

Usage

gamma_censored(
  shape,
  rate,
  is_censored,
  censor = "right",
  lower = NULL,
  upper = NULL,
  dim = length(is_censored)
)

Arguments

shape

Shape parameter of the gamma distribution.

rate

Rate parameter of the gamma distribution (reciprocal of scale).

is_censored

Logical vector indicating whether each observation is censored.

censor

Type of censoring: one of 'right', 'left', 'interval'.

lower

Lower bound for interval censoring (optional).

upper

Upper bound for interval censoring (optional).

dim

Dimension of the data (optional, defaults to length of shape).

Value

A greta censored gamma distribution node.


Censored Distributions for 'greta'

Description

Provides additional censored distributions for use with Greta, a probabilistic programming framework for Bayesian modeling. Includes censored versions of Normal, Log-Normal, Student's t, Gamma, Exponential, Weibull, Pareto, and Beta distributions with support for right, left, and interval censoring.

Author(s)

Maintainer: Mlen-Too Wesley [email protected]

See Also

Useful links:

Examples

# add a simple example here to introduce the package!

Log-Normal Censored Distribution

Description

Creates a censored log-normal distribution for use with greta.

Usage

lognormal_censored(
  meanlog,
  sdlog,
  is_censored,
  censor = "right",
  lower = NULL,
  upper = NULL,
  dim = length(is_censored)
)

Arguments

meanlog

Mean of the log-transformed normal distribution.

sdlog

Standard deviation of the log-transformed normal distribution.

is_censored

Logical vector indicating whether each observation is censored.

censor

Type of censoring: one of 'right', 'left', 'interval'.

lower

Lower bound for interval censoring (optional).

upper

Upper bound for interval censoring (optional).

dim

Dimension of the data (optional, defaults to length of meanlog).

Value

A greta censored log-normal distribution node.


Normal Censored Distribution

Description

Creates a censored normal distribution for use with greta.

Usage

normal_censored(
  mean,
  sd,
  is_censored,
  censor = "right",
  lower = NULL,
  upper = NULL,
  dim = length(is_censored)
)

Arguments

mean

Mean of the normal distribution.

sd

Standard deviation of the normal distribution.

is_censored

Logical vector indicating whether each observation is censored.

censor

Type of censoring: one of 'right', 'left', 'interval'.

lower

Lower bound for interval censoring (optional).

upper

Upper bound for interval censoring (optional).

dim

Dimension of the data (optional, defaults to length of mean).

Value

A greta censored normal distribution node.


Pareto Censored Distribution

Description

Creates a censored Pareto distribution for use with greta.

Usage

pareto_censored(
  scale,
  alpha,
  is_censored,
  censor = "right",
  lower = NULL,
  upper = NULL,
  dim = length(is_censored)
)

Arguments

scale

Minimum value of the Pareto distribution.

alpha

Shape parameter of the Pareto distribution.

is_censored

Logical vector indicating whether each observation is censored.

censor

Type of censoring: one of 'right', 'left', 'interval'.

lower

Lower bound for interval censoring (optional).

upper

Upper bound for interval censoring (optional).

dim

Dimension of the data (optional, defaults to length of scale).

Value

A greta censored Pareto distribution node.


Student's t Censored Distribution

Description

Creates a censored Student's t distribution for use with greta.

Usage

student_censored(
  df,
  loc,
  scale,
  is_censored,
  censor = "right",
  lower = NULL,
  upper = NULL,
  dim = length(is_censored)
)

Arguments

df

Degrees of freedom for the Student's t distribution.

loc

Location parameter (mean).

scale

Scale parameter.

is_censored

Logical vector indicating whether each observation is censored.

censor

Type of censoring: one of 'right', 'left', 'interval'.

lower

Lower bound for interval censoring (optional).

upper

Upper bound for interval censoring (optional).

dim

Dimension of the data (optional, defaults to length of df).

Value

A greta censored Student's t distribution node.


Weibull Censored Distribution

Description

Creates a censored Weibull distribution for use with greta.

Usage

weibull_censored(
  shape,
  scale,
  is_censored,
  censor = "right",
  lower = NULL,
  upper = NULL,
  dim = length(is_censored)
)

Arguments

shape

Shape parameter of the Weibull distribution.

scale

Scale parameter of the Weibull distribution.

is_censored

Logical vector indicating whether each observation is censored.

censor

Type of censoring: one of 'right', 'left', 'interval'.

lower

Lower bound for interval censoring (optional).

upper

Upper bound for interval censoring (optional).

dim

Dimension of the data (optional, defaults to length of shape).

Value

A greta censored Weibull distribution node.