Nothing
test_that("Uniform distribution", {
dist <- dist_uniform(-2, 4)
expect_equal(format(dist), "U(-2, 4)")
# quantiles
expect_equal(quantile(dist, 0.1), stats::qunif(0.1, -2, 4))
expect_equal(quantile(dist, 0.5), stats::qunif(0.5, -2, 4))
# pdf
expect_equal(density(dist, 0), stats::dunif(0, -2, 4))
expect_equal(density(dist, 3), stats::dunif(3, -2, 4))
# cdf
expect_equal(cdf(dist, 0), stats::punif(0, -2, 4))
expect_equal(cdf(dist, 3), stats::punif(3, -2, 4))
# F(Finv(a)) ~= a
expect_equal(cdf(dist, quantile(dist, 0.4246)), 0.4246, tolerance = 1e-3)
# stats
expect_equal(mean(dist), 0.5*(-2 + 4))
expect_equal(variance(dist), (4+2)^2/12)
})
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.