Nothing
## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## ----setup--------------------------------------------------------------------
set.seed(1)
library(nisone)
## -----------------------------------------------------------------------------
ci1(x = 2, A = 1, type = "x", family = "cauchy")
ci1(x = 2, A = 1, type = "x", family = "normal")
ci1(x = 2, A = 1, type = "x", family = "uniform")
## -----------------------------------------------------------------------------
ci1(x = 2, A = 1, type = "ave", family = "cauchy")
ci1(x = 2, A = 1, type = "ave", family = "normal")
ci1(x = 2, A = 1, type = "ave", family = "uniform")
## -----------------------------------------------------------------------------
wc_width(alpha = 0.05, center = "ave", family = "normal")
## -----------------------------------------------------------------------------
bci1(x = 1, A = 0)
ci1(x = 1, A = 0)
## -----------------------------------------------------------------------------
blevel(level = 0.7, nu = 0.8)
## -----------------------------------------------------------------------------
n <- 2
mu <- 10
sigma <- 4
A <- 5
x <- rnorm(n = n, mean = mu, sd = sigma)
aug_t(x = x, A = A)
t.test(x)$conf.int
## -----------------------------------------------------------------------------
tstat <- mean(x) / (sd(x) / length(x))
bft(t = tstat, nu = length(x) - 1, nd = length(x))
## -----------------------------------------------------------------------------
x_aug <- c(x, A)
tstat <- mean(x_aug) / (sd(x_aug) / length(x_aug))
bft(t = tstat, nu = length(x_aug) - 1, nd = length(x_aug))
## -----------------------------------------------------------------------------
museq <- seq(-2, 5, length.out = 500)
X <- 2
A <- 0.75
density <- dinvnorm(x = museq - A, imean = 1 / (X - A), isd = 1 / abs(X - A))
graphics::plot(
museq,
density,
type = "l",
xlab = expression(mu),
ylab = "Posterior Density"
)
## -----------------------------------------------------------------------------
qinvnorm(p = c(0.025, 0.975), imean = 1 / (X - A), isd = 1 / abs(X - A)) + A
## -----------------------------------------------------------------------------
bci1(x = X, A = A)
## -----------------------------------------------------------------------------
dn1post(x = 10, obs = X, A = A, nu = 1, fam = "normal")
dinvnorm(x = 10 - A, imean = 1 / (X - A), isd = 1 / abs(X - A))
qn1post(p = c(0.025, 0.975), A = A, obs = X, nu = 1, fam = "normal")
qinvnorm(p = c(0.025, 0.975), imean = 1 / (X - A), isd = 1 / abs(X - A)) + A
## -----------------------------------------------------------------------------
set.seed(50)
qginvnorm(p = 0.025, alpha = 4, mu = 0.5, tau = 1)
pginvnorm(q = -1.345, alpha = 4, mu = 0.5, tau = 1)
samp <- rginvnorm(n = 1000, alpha = 4, mu = 0.5, tau = 1)
x <- seq(min(samp), max(samp), length.out = 500)
y <- dginvnorm(x = x, alpha = 4, mu = 0.5, tau = 1)
modes <- xginvnorm(alpha = 4, mu = 0.5, tau = 1)
hist(
samp,
freq = FALSE,
breaks = 100,
xlab = "x",
main = "Generalized Inverse Normal Density")
lines(x, y, col = "#E69F00")
abline(v = modes, col = "#56B4E9", lty = 2)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.