## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.width = 6, fig.height = 5)

## -----------------------------------------------------------------------------
library(UnitTrans)
trans_list()

## -----------------------------------------------------------------------------
detect_transformations("gamma", c(shape = 3, rate = 1))
check_domain("norm", c(0, 1), "rational")$message

## -----------------------------------------------------------------------------
set.seed(1)
x <- rtrans(300, "gamma", c(2, 1), "rational")
summary(x)

## -----------------------------------------------------------------------------
fit <- fit_trans(x, "gamma", "rational")
summary(fit)

## -----------------------------------------------------------------------------
res <- fit_all(x, c("gamma", "lnorm", "weibull"), criterion = "AIC")
res
best <- best_model(res)

## -----------------------------------------------------------------------------
plot(best)

## -----------------------------------------------------------------------------
gof_trans(best, B = 50, seed = 1)

## -----------------------------------------------------------------------------
confint(best)
confint(best, method = "profile")
head(residuals(best))
summary_trans(best$dist, best$coef, best$trans)
hazard_trans(c(.2, .5, .8), best$dist, best$coef, best$trans)

## -----------------------------------------------------------------------------
simulation_study(best$dist, best$coef, best$trans, n = c(50, 100), R = 20, seed = 1)

