Title: | Censored Distributions for 'greta' |
Version: | 0.1.0 |
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. |
License: | Apache License 2.0 |
URL: | https://github.com/mtwesley/greta.censored |
BugReports: | https://github.com/mtwesley/greta.censored/issues |
Depends: | greta (≥ 0.4.2), R (≥ 3.1.0) |
Imports: | glue, reticulate, tensorflow (≥ 2.7.0) |
Suggests: | devtools, VGAM, knitr, rmarkdown, testthat (≥ 3.1.0), roxygen2, styler, pkgdown |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
Language: | en-GB |
RoxygenNote: | 7.3.2 |
SystemRequirements: | Python (>= 3.7.0) with header files and shared library; TensorFlow (>= v2.0.0; https://www.tensorflow.org/); TensorFlow Probability (v0.8.0; https://www.tensorflow.org/probability/) |
NeedsCompilation: | no |
Packaged: | 2024-11-28 15:02:55 UTC; mtwesley |
Author: | Mlen-Too Wesley [aut, cre] |
Maintainer: | Mlen-Too Wesley <mlen.too.wesley@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-11-29 09:30:06 UTC |
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 mlen.too.wesley@gmail.com
See Also
Useful links:
Report bugs at https://github.com/mtwesley/greta.censored/issues
Examples
# add a simple example here to introduce the package!
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 |
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 |
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 |
Value
A greta censored gamma distribution node.
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 |
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 |
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 |
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 |
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 |
Value
A greta censored Weibull distribution node.