diff --git a/.github/workflows/UpdateRefs.yml b/.github/workflows/UpdateRefs.yml new file mode 100644 index 0000000000..dc9177111f --- /dev/null +++ b/.github/workflows/UpdateRefs.yml @@ -0,0 +1,48 @@ +name: UpdateRefs + +on: + schedule: + - cron: '00 00 * * *' + workflow_dispatch: + +jobs: + UpdateRefs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: '4' + - uses: r-lib/actions/setup-renv@v2 + with: + working-directory: 'test/refs' + - name: Update renv + run: renv::update() + shell: Rscript {0} + working-directory: test/ref + - name: Check for changes of R environment + id: check + shell: bash + run: | + output=$(git diff --name-only -- test/ref) + if [ "$output" != "" ]; then + >&1 echo "The R environment was updated" + echo "changed=true" >> "$GITHUB_OUTPUT" + else + echo "changed=false" >> "$GITHUB_OUTPUT" + fi + - name: Regenerate references + if: steps.check.outputs.changed + run: Rscript gendref.R + working-directory: test/ref + - name: Create pull request + if: steps.check.outputs.changed + uses: peter-evans/create-pull-request@7 + with: + token: ${{ secrets.DOCUMENTER_KEY }} + commit-message: "🤖 Automatic update of R references" + title: "🤖 Automatic update of R references" + body: |- + This pull request updates all packages and references in the `test/ref` directory. + delete-branch: true + add-paths: test/ref diff --git a/test/ref/.Rprofile b/test/ref/.Rprofile new file mode 100644 index 0000000000..81b960f5c6 --- /dev/null +++ b/test/ref/.Rprofile @@ -0,0 +1 @@ +source("renv/activate.R") diff --git a/test/ref/continuous/betaprime.R b/test/ref/continuous/betaprime.R index 763d036874..d8abea5c9c 100644 --- a/test/ref/continuous/betaprime.R +++ b/test/ref/continuous/betaprime.R @@ -25,8 +25,8 @@ BetaPrime <- R6Class("BetaPrime", sqrt((b - 2) / (a * (a + b - 1))) } else { NaN }) }, - pdf = function(x, log=FALSE){ dbetapr(x, self$alpha, self$beta, log=log) }, - cdf = function(x) { pbetapr(x, self$alpha, self$beta) }, - quan = function(v) { qbetapr(v, self$alpha, self$beta) } + pdf = function(x, log=FALSE){ extraDistr::dbetapr(x, self$alpha, self$beta, log=log) }, + cdf = function(x) { extraDistr::pbetapr(x, self$alpha, self$beta) }, + quan = function(v) { extraDistr::qbetapr(v, self$alpha, self$beta) } ) ) diff --git a/test/ref/continuous/gamma.R b/test/ref/continuous/gamma.R index 13eeef4088..de0f806dfa 100644 --- a/test/ref/continuous/gamma.R +++ b/test/ref/continuous/gamma.R @@ -31,4 +31,4 @@ Gamma <- R6Class("Gamma", ) ) -Erlang = list(new = Gamma$new) +Erlang = R6Class("Erlang", inherit = Gamma) diff --git a/test/ref/continuous/generalizedextremevalue.R b/test/ref/continuous/generalizedextremevalue.R index 1c7ec1d9dd..074862e745 100644 --- a/test/ref/continuous/generalizedextremevalue.R +++ b/test/ref/continuous/generalizedextremevalue.R @@ -60,8 +60,8 @@ GeneralizedExtremeValue <- R6Class("GeneralizedExtremeValue", entropy = ent) } }, - pdf = function(x, log=FALSE) { dgev(x, self$mu, self$sigma, self$xi, log=log) }, - cdf = function(x) { pgev(x, self$mu, self$sigma, self$xi) }, - quan = function(v) { qgev(v, self$mu, self$sigma, self$xi) } + pdf = function(x, log=FALSE) { extraDistr::dgev(x, self$mu, self$sigma, self$xi, log=log) }, + cdf = function(x) { extraDistr::pgev(x, self$mu, self$sigma, self$xi) }, + quan = function(v) { extraDistr::qgev(v, self$mu, self$sigma, self$xi) } ) ) diff --git a/test/ref/continuous/generalizedpareto.R b/test/ref/continuous/generalizedpareto.R index 6367713c06..c0d28cdb01 100644 --- a/test/ref/continuous/generalizedpareto.R +++ b/test/ref/continuous/generalizedpareto.R @@ -46,8 +46,8 @@ GeneralizedPareto <- R6Class("GeneralizedPareto", } else { Inf } ) }, - pdf = function(x, log=FALSE) { dgpd(x, self$mu, self$sigma, self$xi, log=log) }, - cdf = function(x) { pgpd(x, self$mu, self$sigma, self$xi) }, - quan = function(v) { qgpd(v, self$mu, self$sigma, self$xi) } + pdf = function(x, log=FALSE) { extraDistr::dgpd(x, self$mu, self$sigma, self$xi, log=log) }, + cdf = function(x) { extraDistr::pgpd(x, self$mu, self$sigma, self$xi) }, + quan = function(v) { extraDistr::qgpd(v, self$mu, self$sigma, self$xi) } ) ) diff --git a/test/ref/continuous/gumbel.R b/test/ref/continuous/gumbel.R index debbb7aa84..9f8d65ad0c 100644 --- a/test/ref/continuous/gumbel.R +++ b/test/ref/continuous/gumbel.R @@ -23,8 +23,8 @@ Gumbel <- R6Class("Gumbel", skewness = 1.13954709940464866, kurtosis = 2.4) }, - pdf = function(x, log=FALSE){ dgumbel(x, self$mu, self$beta, log=log) }, - cdf = function(x){ pgumbel(x, self$mu, self$beta) }, - quan = function(v){ qgumbel(v, self$mu, self$beta) } + pdf = function(x, log=FALSE){ extraDistr::dgumbel(x, self$mu, self$beta, log=log) }, + cdf = function(x){ extraDistr::pgumbel(x, self$mu, self$beta) }, + quan = function(v){ extraDistr::qgumbel(v, self$mu, self$beta) } ) ) diff --git a/test/ref/continuous/inversegamma.R b/test/ref/continuous/inversegamma.R index d5317e3fee..4a9774fb57 100644 --- a/test/ref/continuous/inversegamma.R +++ b/test/ref/continuous/inversegamma.R @@ -29,8 +29,8 @@ InverseGamma <- R6Class("InverseGamma", } else { NaN }, entropy = a + log(b) + lgamma(a) - (1 + a) * digamma(a)) }, - pdf = function(x, log=FALSE){ dinvgamma(x, self$alpha, self$beta, log=log) }, - cdf = function(x){ pinvgamma(x, self$alpha, self$beta) }, - quan = function(v){ qinvgamma(v, self$alpha, self$beta) } + pdf = function(x, log=FALSE){ extraDistr::dinvgamma(x, self$alpha, self$beta, log=log) }, + cdf = function(x){ extraDistr::pinvgamma(x, self$alpha, self$beta) }, + quan = function(v){ extraDistr::qinvgamma(v, self$alpha, self$beta) } ) ) diff --git a/test/ref/continuous/johnsonsu.R b/test/ref/continuous/johnsonsu.R index 18da14a48c..353cd4df7c 100644 --- a/test/ref/continuous/johnsonsu.R +++ b/test/ref/continuous/johnsonsu.R @@ -1,5 +1,3 @@ -library("ExtDist") - JohnsonSU <- R6Class("JohnsonSU", inherit = ContinuousDistribution, public = list(names = c("xi", "lambda", "gamma", "delta"), @@ -16,7 +14,7 @@ JohnsonSU <- R6Class("JohnsonSU", supp = function() { c(-Inf, Inf) }, properties = function() { list() }, pdf = function(x, log = FALSE) { - p <- dJohnsonSU(x, xi = self$xi, lambda = self$lambda, gamma = self$gamma, delta = self$delta) + p <- ExtDist::dJohnsonSU(x, xi = self$xi, lambda = self$lambda, gamma = self$gamma, delta = self$delta) if (log) { result <- log(p) } else { @@ -25,10 +23,10 @@ JohnsonSU <- R6Class("JohnsonSU", return(result) }, cdf = function(x) { - pJohnsonSU(x, xi = self$xi, lambda = self$lambda, gamma = self$gamma, delta = self$delta) + ExtDist::pJohnsonSU(x, xi = self$xi, lambda = self$lambda, gamma = self$gamma, delta = self$delta) }, quan = function(x) { - qJohnsonSU(x, xi = self$xi, lambda = self$lambda, gamma = self$gamma, delta = self$delta) + ExtDist::qJohnsonSU(x, xi = self$xi, lambda = self$lambda, gamma = self$gamma, delta = self$delta) } ) ) diff --git a/test/ref/continuous/kumaraswamy.R b/test/ref/continuous/kumaraswamy.R index f323399017..576b101db4 100644 --- a/test/ref/continuous/kumaraswamy.R +++ b/test/ref/continuous/kumaraswamy.R @@ -9,6 +9,6 @@ Kumaraswamy <- R6Class("Kumaraswamy", }, supp=function() { c(0, 1) }, properties=function() { list() }, - pdf=function(x, log=FALSE) { dkumar(x, self$a, self$b, log=log) }, - cdf=function(x) { pkumar(x, self$a, self$b) }, - quan=function(x) { qkumar(x, self$a, self$b) })) + pdf=function(x, log=FALSE) { extraDistr::dkumar(x, self$a, self$b, log=log) }, + cdf=function(x) { extraDistr::pkumar(x, self$a, self$b) }, + quan=function(x) { extraDistr::qkumar(x, self$a, self$b) })) diff --git a/test/ref/continuous/laplace.R b/test/ref/continuous/laplace.R index 379981ccb8..6aa144ebc7 100644 --- a/test/ref/continuous/laplace.R +++ b/test/ref/continuous/laplace.R @@ -23,8 +23,8 @@ Laplace <- R6Class("Laplace", kurtosis = 3, entropy = 1 + log(2 * b)) }, - pdf = function(x, log=FALSE){ dlaplace(x, self$mu, self$beta, log=log) }, - cdf = function(x){ plaplace(x, self$mu, self$beta) }, - quan = function(v){ qlaplace(v, self$mu, self$beta) } + pdf = function(x, log=FALSE){ extraDistr::dlaplace(x, self$mu, self$beta, log=log) }, + cdf = function(x){ extraDistr::plaplace(x, self$mu, self$beta) }, + quan = function(v){ extraDistr::qlaplace(v, self$mu, self$beta) } ) ) diff --git a/test/ref/continuous/lindley.R b/test/ref/continuous/lindley.R index cf112567fd..c2892629ba 100644 --- a/test/ref/continuous/lindley.R +++ b/test/ref/continuous/lindley.R @@ -1,5 +1,3 @@ -library("LindleyR") - Lindley <- R6Class("Lindley", inherit=ContinuousDistribution, public=list(names=c("theta"), @@ -7,6 +5,6 @@ Lindley <- R6Class("Lindley", initialize=function(theta=1) { self$theta <- theta }, supp=function() { c(0, Inf) }, properties=function() { list() }, - pdf=function(x, log=FALSE) { dlindley(x, self$theta, log=log) }, - cdf=function(x) { plindley(x, self$theta) }, - quan=function(x) { qlindley(x, self$theta) })) + pdf=function(x, log=FALSE) { new.dist::dLd(x, self$theta, log=log) }, + cdf=function(x) { new.dist::pLd(x, self$theta) }, + quan=function(x) { new.dist::qLd(x, self$theta) })) diff --git a/test/ref/continuous/normal.R b/test/ref/continuous/normal.R index 4d678a20ea..ed7f5fcc3b 100644 --- a/test/ref/continuous/normal.R +++ b/test/ref/continuous/normal.R @@ -27,8 +27,11 @@ Normal <- R6Class("Normal", ) ) -NormalCanon = list( - new = function(c1=0, c2=1) { - Normal$new(c1/c2, 1/sqrt(c2)) - } +NormalCanon = R6Class("NormalCanon", + inherit = Normal, + public = list( + initialize = function(c1=0, c2=1) { + super$initialize(c1/c2, 1/sqrt(c2)) + } + ) ) diff --git a/test/ref/continuous/pareto.R b/test/ref/continuous/pareto.R index 1241537d0c..be8b922c36 100644 --- a/test/ref/continuous/pareto.R +++ b/test/ref/continuous/pareto.R @@ -30,8 +30,8 @@ Pareto <- R6Class("Pareto", } else { NaN }, entropy = (1 + 1 / a) + log(b / a)) }, - pdf = function(x, log=FALSE){ dpareto(x, self$alpha, self$beta, log=log) }, - cdf = function(x){ ppareto(x, self$alpha, self$beta) }, - quan = function(v){ qpareto(v, self$alpha, self$beta) } + pdf = function(x, log=FALSE){ extraDistr::dpareto(x, self$alpha, self$beta, log=log) }, + cdf = function(x){ extraDistr::ppareto(x, self$alpha, self$beta) }, + quan = function(v){ extraDistr::qpareto(v, self$alpha, self$beta) } ) ) diff --git a/test/ref/continuous/rayleigh.R b/test/ref/continuous/rayleigh.R index 2df3f3e4d1..871a2f72d2 100644 --- a/test/ref/continuous/rayleigh.R +++ b/test/ref/continuous/rayleigh.R @@ -19,8 +19,8 @@ Rayleigh <- R6Class("Rayleigh", kurtosis = 0.245089300687638, entropy = 0.94203424217079 + log(s)) }, - pdf = function(x, log=FALSE) { drayleigh(x, self$sigma, log=log) }, - cdf = function(x){ prayleigh(x, self$sigma) }, - quan = function(v){ qrayleigh(v, self$sigma) } + pdf = function(x, log=FALSE) { extraDistr::drayleigh(x, self$sigma, log=log) }, + cdf = function(x){ extraDistr::prayleigh(x, self$sigma) }, + quan = function(v){ extraDistr::qrayleigh(v, self$sigma) } ) ) diff --git a/test/ref/continuous/studentizedrange.R b/test/ref/continuous/studentizedrange.R index 53636fcd05..b8737c3cc0 100644 --- a/test/ref/continuous/studentizedrange.R +++ b/test/ref/continuous/studentizedrange.R @@ -14,6 +14,13 @@ StudentizedRange <- R6Class("StudentizedRange", d1 <- self$nu k <- self$k }, + pdf = function(x, log=FALSE) { + if (log) { + ptukey(x, self$k, self$nu, log=TRUE) + log(pracma::fderiv(ptukey, x, n=1, nmeans=self$k, df=self$nu, log=TRUE)) + } else { + pracma::fderiv(ptukey, x, n=1, nmeans=self$k, df=self$nu, log=FALSE) + } + }, cdf = function(x) { ptukey(x, self$k, self$nu) }, quan = function(v) { qtukey(v, self$k, self$nu) } ) diff --git a/test/ref/continuous/triangulardist.R b/test/ref/continuous/triangulardist.R index 72c431d7b1..6774547e9f 100644 --- a/test/ref/continuous/triangulardist.R +++ b/test/ref/continuous/triangulardist.R @@ -30,14 +30,17 @@ TriangularDist = R6Class("TriangularDist", kurtosis = -0.6, entropy = 0.5 + log((b - a) / 2)) }, - pdf = function(x, log=FALSE) { dtriang(x, self$a, self$b, self$c, log=log) }, - cdf = function(x) { ptriang(x, self$a, self$b, self$c) }, - quan = function(v) { qtriang(v, self$a, self$b, self$c) } + pdf = function(x, log=FALSE) { extraDistr::dtriang(x, self$a, self$b, self$c, log=log) }, + cdf = function(x) { extraDistr::ptriang(x, self$a, self$b, self$c) }, + quan = function(v) { extraDistr::qtriang(v, self$a, self$b, self$c) } ) ) -SymTriangularDist = list( - new = function(u=0, s=1) { - TriangularDist$new(u-s, u+s, u) - } +SymTriangularDist = R6Class("SymTriangularDist", + inherit = TriangularDist, + public = list( + initialize = function(u=0, s=1) { + super$initialize(u-s, u+s, u) + } + ) ) diff --git a/test/ref/continuous/truncatednormal.R b/test/ref/continuous/truncatednormal.R index 93190af026..3a44346644 100644 --- a/test/ref/continuous/truncatednormal.R +++ b/test/ref/continuous/truncatednormal.R @@ -13,6 +13,17 @@ TruncatedNormal <- R6Class("TruncatedNormal", self$a <- a self$b <- b }, + dtype = "Distributions.Truncated{<:Normal}", + expr = function() { + str <- paste0("truncated(Normal(", self$mu, ", ", self$sigma, ")") + if (!is.infinite(self$a)) { + str <- paste0(str, ", lower=", self$a) + } + if (!is.infinite(self$b)) { + str <- paste0(str, ", upper=", self$b) + } + paste0(str, ")") + }, supp = function() { c(self$a, self$b) }, properties = function() { u <- self$mu @@ -31,8 +42,8 @@ TruncatedNormal <- R6Class("TruncatedNormal", var = s^2 * (1 + v1 - ((pa - pb) / Z)^2), entropy = (log(2*pi) + 1) / 2 + log(s) + log(Z) + v1 / 2) }, - pdf = function(x, log=FALSE) { dtnorm(x, self$mu, self$sigma, self$a, self$b, log=log) }, - cdf = function(x) { ptnorm(x, self$mu, self$sigma, self$a, self$b) }, - quan = function(v) { qtnorm(v, self$mu, self$sigma, self$a, self$b) } + pdf = function(x, log=FALSE) { extraDistr::dtnorm(x, self$mu, self$sigma, self$a, self$b, log=log) }, + cdf = function(x) { extraDistr::ptnorm(x, self$mu, self$sigma, self$a, self$b) }, + quan = function(v) { extraDistr::qtnorm(v, self$mu, self$sigma, self$a, self$b) } ) ) diff --git a/test/ref/continuous_test.lst b/test/ref/continuous_test.lst index d403be3e65..0ada1b1834 100644 --- a/test/ref/continuous_test.lst +++ b/test/ref/continuous_test.lst @@ -195,11 +195,11 @@ TriangularDist(-4, 14, 3) TriangularDist(2, 2000, 500) TriangularDist(1, 3, 2) -truncated(Normal(0, 1), lower = -2, upper = 2) -truncated(Normal(3, 10), lower = 7, upper = 8) -truncated(Normal(27, 3), lower = 0) -truncated(Normal(-5, 1), upper = -10) -truncated(Normal(1.8, 1.2), upper = 0) +TruncatedNormal(0, 1, -2, 2) +TruncatedNormal(3, 10, 7, 8) +TruncatedNormal(27, 3, 0, Inf) +TruncatedNormal(-5, 1, -Inf, -10) +TruncatedNormal(1.8, 1.2, -Inf, 0) Uniform() Uniform(0.0, 2.0) diff --git a/test/ref/continuous_test.ref.json b/test/ref/continuous_test.ref.json index ae86f2e8a7..b230de5561 100644 --- a/test/ref/continuous_test.ref.json +++ b/test/ref/continuous_test.ref.json @@ -16,7 +16,7 @@ }, "points": [ { "x": 0.0244717418524232, "pdf": 2.06014485920193, "logpdf": 0.722776300330094, "cdf": 0.1 }, - { "x": 0.0954915028125263, "pdf": 1.08308224795475, "logpdf": 0.0798109096917669, "cdf": 0.2 }, + { "x": 0.0954915028125263, "pdf": 1.08308224795475, "logpdf": 0.0798109096917671, "cdf": 0.2 }, { "x": 0.206107373853763, "pdf": 0.786905314466773, "logpdf": -0.239647349789113, "cdf": 0.3 }, { "x": 0.345491502812526, "pdf": 0.669381641847676, "logpdf": -0.401400915367836, "cdf": 0.4 }, { "x": 0.5, "pdf": 0.636619772367581, "logpdf": -0.451582705289455, "cdf": 0.5 }, @@ -84,7 +84,7 @@ }, "points": [ { "x": 1.03670761277863, "pdf": 1.37342990613462, "logpdf": 0.31731119222193, "cdf": 0.0999999999999999 }, - { "x": 1.14323725421879, "pdf": 0.722054831969832, "logpdf": -0.325654198416398, "cdf": 0.2 }, + { "x": 1.14323725421879, "pdf": 0.722054831969833, "logpdf": -0.325654198416397, "cdf": 0.2 }, { "x": 1.30916106078065, "pdf": 0.524603542977849, "logpdf": -0.645112457897278, "cdf": 0.3 }, { "x": 1.51823725421879, "pdf": 0.446254427898451, "logpdf": -0.806866023476001, "cdf": 0.4 }, { "x": 1.75, "pdf": 0.424413181578388, "logpdf": -0.857047813397619, "cdf": 0.5 }, @@ -185,13 +185,13 @@ "points": [ { "x": 0.200908878856905, "pdf": 1.23577221447207, "logpdf": 0.211696049553224, "cdf": 0.1 }, { "x": 0.268649154220668, "pdf": 1.69394579675222, "logpdf": 0.527060598523267, "cdf": 0.2 }, - { "x": 0.323323884628771, "pdf": 1.9434320871918, "logpdf": 0.664455527139938, "cdf": 0.3 }, + { "x": 0.323323884628771, "pdf": 1.94343208719179, "logpdf": 0.664455527139937, "cdf": 0.3 }, { "x": 0.373079731905029, "pdf": 2.05774471206542, "logpdf": 0.721610583101998, "cdf": 0.4 }, { "x": 0.421407190690713, "pdf": 2.06383146877165, "logpdf": 0.724564191558637, "cdf": 0.5 }, { "x": 0.470784219077961, "pdf": 1.97103076052561, "logpdf": 0.678556634606698, "cdf": 0.6 }, - { "x": 0.52394180120125, "pdf": 1.77704119320141, "logpdf": 0.574949730221453, "cdf": 0.7 }, + { "x": 0.52394180120125, "pdf": 1.77704119320141, "logpdf": 0.574949730221452, "cdf": 0.7 }, { "x": 0.585394235302173, "pdf": 1.46539309874241, "logpdf": 0.382123533262465, "cdf": 0.8 }, - { "x": 0.666805613472185, "pdf": 0.986830975502619, "logpdf": -0.0132565049709661, "cdf": 0.9 } + { "x": 0.666805613472185, "pdf": 0.986830975502619, "logpdf": -0.0132565049709659, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.200908878856905 }, @@ -216,9 +216,9 @@ "entropy": -1.00185006317986 }, "points": [ - { "x": 0.450408986406964, "pdf": 1.92207569343411, "logpdf": 0.65340569241264, "cdf": 0.1 }, + { "x": 0.450408986406964, "pdf": 1.92207569343411, "logpdf": 0.653405692412643, "cdf": 0.1 }, { "x": 0.490792148791672, "pdf": 3.03868067422372, "logpdf": 1.11142343247556, "cdf": 0.2 }, - { "x": 0.520036464616096, "pdf": 3.77243652111319, "logpdf": 1.3277210847756, "cdf": 0.3 }, + { "x": 0.520036464616096, "pdf": 3.7724365211132, "logpdf": 1.3277210847756, "cdf": 0.3 }, { "x": 0.544979340484751, "pdf": 4.20761769997006, "logpdf": 1.43689662054066, "cdf": 0.399999999999998 }, { "x": 0.56816746281972, "pdf": 4.37510374567492, "logpdf": 1.47593023282555, "cdf": 0.499999999999999 }, { "x": 0.591157103749861, "pdf": 4.28061668740684, "logpdf": 1.45409708505706, "cdf": 0.600000000000001 }, @@ -246,9 +246,8 @@ "skewness": "nan" }, "points": [ - { "x": -2.25, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, { "x": 0.111111111111111, "pdf": 0.81, "logpdf": -0.210721031315653, "cdf": 0.1 }, - { "x": 0.25, "pdf": 0.64, "logpdf": -0.446287102628419, "cdf": 0.2 }, + { "x": 0.25, "pdf": 0.64, "logpdf": -0.44628710262842, "cdf": 0.2 }, { "x": 0.428571428571429, "pdf": 0.49, "logpdf": -0.713349887877465, "cdf": 0.3 }, { "x": 0.666666666666667, "pdf": 0.36, "logpdf": -1.02165124753198, "cdf": 0.4 }, { "x": 1, "pdf": 0.25, "logpdf": -1.38629436111989, "cdf": 0.5 }, @@ -277,20 +276,19 @@ "skewness": "nan" }, "points": [ - { "x": -1.1, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, - { "x": 0.327380392063096, "pdf": 0.587833314908085, "logpdf": -0.531311849318481, "cdf": 0.0999999999999999 }, + { "x": 0.327380392063096, "pdf": 0.587833314908086, "logpdf": -0.53131184931848, "cdf": 0.1 }, { "x": 0.484996937482641, "pdf": 0.658030311168427, "logpdf": -0.418504283112295, "cdf": 0.2 }, - { "x": 0.638856233828343, "pdf": 0.631949513759434, "logpdf": -0.458945771318154, "cdf": 0.3 }, - { "x": 0.805882437162724, "pdf": 0.561730222875392, "logpdf": -0.57673357481079, "cdf": 0.4 }, + { "x": 0.638856233828344, "pdf": 0.631949513759434, "logpdf": -0.458945771318155, "cdf": 0.3 }, + { "x": 0.805882437162724, "pdf": 0.561730222875392, "logpdf": -0.576733574810789, "cdf": 0.4 }, { "x": 1, "pdf": 0.46875, "logpdf": -0.757685701697516, "cdf": 0.5 }, { "x": 1.24087578272671, "pdf": 0.364813728610322, "logpdf": -1.0083683882381, "cdf": 0.6 }, { "x": 1.56529739720548, "pdf": 0.257922160383563, "logpdf": -1.35509744352199, "cdf": 0.7 }, { "x": 2.06186868970856, "pdf": 0.154783225178392, "logpdf": -1.86572968817904, "cdf": 0.8 }, - { "x": 3.05455068245892, "pdf": 0.0630027526495122, "logpdf": -2.76457686069571, "cdf": 0.9 } + { "x": 3.05455068245892, "pdf": 0.0630027526495123, "logpdf": -2.76457686069571, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.327380392063096 }, - { "q": 0.25, "x": 0.561124660856966 }, + { "q": 0.25, "x": 0.561124660856967 }, { "q": 0.50, "x": 1 }, { "q": 0.75, "x": 1.78213518271104 }, { "q": 0.90, "x": 3.05455068245892 } @@ -308,14 +306,13 @@ "skewness": 3.77964473009227 }, "points": [ - { "x": -0.5, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, - { "x": 0.204294636157736, "pdf": 0.990469738310319, "logpdf": -0.0095759652432958, "cdf": 0.1 }, + { "x": 0.204294636157736, "pdf": 0.99046973831032, "logpdf": -0.00957596524329496, "cdf": 0.1 }, { "x": 0.295884792987577, "pdf": 1.15585522685566, "logpdf": 0.144840526123439, "cdf": 0.2 }, - { "x": 0.381863826960538, "pdf": 1.1515541180368, "logpdf": 0.141112437035115, "cdf": 0.3 }, - { "x": 0.471856262330269, "pdf": 1.06141579369696, "logpdf": 0.0596036713621556, "cdf": 0.4 }, - { "x": 0.572614086766568, "pdf": 0.920314071090908, "logpdf": -0.0830402855759461, "cdf": 0.5 }, - { "x": 0.692663500853701, "pdf": 0.747599271987077, "logpdf": -0.29088817720126, "cdf": 0.6 }, - { "x": 0.846908516786903, "pdf": 0.556287405744374, "logpdf": -0.586470201480597, "cdf": 0.7 }, + { "x": 0.381863826960538, "pdf": 1.1515541180368, "logpdf": 0.141112437035114, "cdf": 0.3 }, + { "x": 0.471856262330269, "pdf": 1.06141579369696, "logpdf": 0.0596036713621553, "cdf": 0.4 }, + { "x": 0.572614086766568, "pdf": 0.920314071090908, "logpdf": -0.0830402855759464, "cdf": 0.5 }, + { "x": 0.692663500853701, "pdf": 0.747599271987077, "logpdf": -0.290888177201261, "cdf": 0.6 }, + { "x": 0.846908516786903, "pdf": 0.556287405744373, "logpdf": -0.586470201480598, "cdf": 0.7 }, { "x": 1.06935556977693, "pdf": 0.357069379011074, "logpdf": -1.02982517711727, "cdf": 0.8 }, { "x": 1.47634918046834, "pdf": 0.161834984593639, "logpdf": -1.82117807650869, "cdf": 0.9 } ], @@ -339,8 +336,7 @@ "skewness": "nan" }, "points": [ - { "x": -1.2, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, - { "x": 0.677346533753464, "pdf": 0.352736649513716, "logpdf": -1.04203353584362, "cdf": 0.0999999999999999 }, + { "x": 0.677346533753464, "pdf": 0.352736649513716, "logpdf": -1.04203353584362, "cdf": 0.1 }, { "x": 0.935142648771728, "pdf": 0.408316452836159, "logpdf": -0.89571278551902, "cdf": 0.2 }, { "x": 1.18076507695768, "pdf": 0.398999386838309, "logpdf": -0.918795398839548, "cdf": 0.3 }, { "x": 1.44370245980553, "pdf": 0.358685216232159, "logpdf": -1.02531011014645, "cdf": 0.4 }, @@ -348,7 +344,7 @@ { "x": 2.11928945281236, "pdf": 0.236322456343819, "logpdf": -1.44255806611032, "cdf": 0.6 }, { "x": 2.6187345577075, "pdf": 0.167919601156772, "logpdf": -1.78426997867046, "cdf": 0.7 }, { "x": 3.37969379873466, "pdf": 0.101192594621986, "logpdf": -2.29072970047832, "cdf": 0.8 }, - { "x": 4.89489111808056, "pdf": 0.0413385405174654, "logpdf": -3.1859600297188, "cdf": 0.9 } + { "x": 4.89489111808056, "pdf": 0.0413385405174653, "logpdf": -3.1859600297188, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.677346533753464 }, @@ -463,7 +459,7 @@ { "x": 6.92231646282475, "pdf": 0.0303958893917744, "logpdf": -3.4934478970885, "cdf": 0.1 }, { "x": 8.62361807952883, "pdf": 0.109973360937722, "logpdf": -2.20751711581184, "cdf": 0.2 }, { "x": 9.27345747199464, "pdf": 0.208336525246069, "logpdf": -1.56860059685008, "cdf": 0.3 }, - { "x": 9.67508030376709, "pdf": 0.287913996792016, "logpdf": -1.24509346569264, "cdf": 0.4 }, + { "x": 9.6750803037671, "pdf": 0.287913996792016, "logpdf": -1.24509346569264, "cdf": 0.4 }, { "x": 10, "pdf": 0.318309886183791, "logpdf": -1.1447298858494, "cdf": 0.5 }, { "x": 10.3249196962329, "pdf": 0.287913996792016, "logpdf": -1.24509346569264, "cdf": 0.6 }, { "x": 10.7265425280054, "pdf": 0.208336525246069, "logpdf": -1.56860059685008, "cdf": 0.7 }, @@ -594,8 +590,8 @@ { "x": 1.19316899181771, "pdf": 0.557444739603243, "logpdf": -0.584391902348656, "cdf": 0.300000000000005 }, { "x": 1.36717533747093, "pdf": 0.58573844627794, "logpdf": -0.534881926452974, "cdf": 0.400000000000006 }, { "x": 1.53817225445506, "pdf": 0.578342764900265, "logpdf": -0.547588567217368, "cdf": 0.500000000000007 }, - { "x": 1.71643994159481, "pdf": 0.538822163511994, "logpdf": -0.618369700340214, "cdf": 0.600000000000007 }, - { "x": 1.91438522329503, "pdf": 0.467931357190301, "logpdf": -0.759433666492275, "cdf": 0.700000000000007 }, + { "x": 1.71643994159481, "pdf": 0.538822163511994, "logpdf": -0.618369700340214, "cdf": 0.600000000000006 }, + { "x": 1.91438522329503, "pdf": 0.467931357190301, "logpdf": -0.759433666492275, "cdf": 0.700000000000006 }, { "x": 2.15444370455287, "pdf": 0.363658479936229, "logpdf": -1.0115400937033, "cdf": 0.800000000000006 }, { "x": 2.50027771080942, "pdf": 0.219000328717657, "logpdf": -1.5186820481729, "cdf": 0.900000000000004 } ], @@ -624,17 +620,17 @@ "points": [ { "x": 2.51073615889532, "pdf": 0.278374021224021, "logpdf": -1.27878966944484, "cdf": 0.100000000000005 }, { "x": 2.79415956571222, "pdf": 0.425688925109737, "logpdf": -0.854046422202356, "cdf": 0.200000000000009 }, - { "x": 3.00570733574317, "pdf": 0.51441561667688, "logpdf": -0.664723747505402, "cdf": 0.300000000000011 }, - { "x": 3.1909201460945, "pdf": 0.559444590469643, "logpdf": -0.580810790147498, "cdf": 0.400000000000012 }, - { "x": 3.36753951386235, "pdf": 0.567007447752384, "logpdf": -0.567382839974897, "cdf": 0.500000000000013 }, - { "x": 3.5473705708056, "pdf": 0.539628933142288, "logpdf": -0.61687353647466, "cdf": 0.600000000000013 }, - { "x": 3.74314041526926, "pdf": 0.477303193463643, "logpdf": -0.739603364308312, "cdf": 0.700000000000013 }, + { "x": 3.00570733574317, "pdf": 0.51441561667688, "logpdf": -0.664723747505401, "cdf": 0.300000000000011 }, + { "x": 3.1909201460945, "pdf": 0.559444590469643, "logpdf": -0.580810790147499, "cdf": 0.400000000000013 }, + { "x": 3.36753951386235, "pdf": 0.567007447752383, "logpdf": -0.567382839974897, "cdf": 0.500000000000014 }, + { "x": 3.5473705708056, "pdf": 0.539628933142288, "logpdf": -0.61687353647466, "cdf": 0.600000000000014 }, + { "x": 3.74314041526926, "pdf": 0.477303193463643, "logpdf": -0.739603364308312, "cdf": 0.700000000000012 }, { "x": 3.9764288277168, "pdf": 0.377194145541082, "logpdf": -0.974995249178167, "cdf": 0.800000000000011 }, { "x": 4.30689537680027, "pdf": 0.230959922047039, "logpdf": -1.46551108114466, "cdf": 0.900000000000007 } ], "quans": [ { "q": 0.10, "x": 2.51073615889532 }, - { "q": 0.25, "x": 2.90489565494803 }, + { "q": 0.25, "x": 2.90489565494802 }, { "q": 0.50, "x": 3.36753951386235 }, { "q": 0.75, "x": 3.85297335457182 }, { "q": 0.90, "x": 4.30689537680027 } @@ -658,7 +654,7 @@ { "x": 0.0641847546673016, "pdf": 1.52495342837914, "logpdf": 0.421963870825278, "cdf": 0.2 }, { "x": 0.148471861832546, "pdf": 0.96127518959084, "logpdf": -0.0394945534696447, "cdf": 0.3 }, { "x": 0.274995897728456, "pdf": 0.66302874572827, "logpdf": -0.410936932679951, "cdf": 0.4 }, - { "x": 0.454936423119573, "pdf": 0.471136251650563, "logpdf": -0.752607945163568, "cdf": 0.5 }, + { "x": 0.454936423119573, "pdf": 0.471136251650564, "logpdf": -0.752607945163568, "cdf": 0.5 }, { "x": 0.708326300800794, "pdf": 0.332645980448108, "logpdf": -1.10067647629395, "cdf": 0.6 }, { "x": 1.07419417085759, "pdf": 0.224962624339573, "logpdf": -1.49182100462252, "cdf": 0.7 }, { "x": 1.64237441514982, "pdf": 0.136942076035706, "logpdf": -1.98819724521934, "cdf": 0.8 }, @@ -692,7 +688,7 @@ { "x": 6.42264556024192, "pdf": 0.111227165823687, "logpdf": -2.1961806300257, "cdf": 0.4 }, { "x": 7.34412149770179, "pdf": 0.104904134633087, "logpdf": -2.25470834936058, "cdf": 0.5 }, { "x": 8.35052546775366, "pdf": 0.0932344934947167, "logpdf": -2.37263752388675, "cdf": 0.6 }, - { "x": 9.52445819307184, "pdf": 0.0769200908111192, "logpdf": -2.56498817767048, "cdf": 0.7 }, + { "x": 9.52445819307183, "pdf": 0.0769200908111192, "logpdf": -2.56498817767048, "cdf": 0.7 }, { "x": 11.0300914303031, "pdf": 0.0562745696655546, "logpdf": -2.87751253921006, "cdf": 0.8 }, { "x": 13.3615661365117, "pdf": 0.0311798227953189, "logpdf": -3.467984098649, "cdf": 0.9 } ], @@ -722,9 +718,9 @@ { "x": 14.5784392170705, "pdf": 0.0546598494483073, "logpdf": -2.90662585281628, "cdf": 0.2 }, { "x": 16.2658564850128, "pdf": 0.0630004394086364, "logpdf": -2.76461357787467, "cdf": 0.3 }, { "x": 17.8088294731942, "pdf": 0.0658441513113916, "logpdf": -2.72046467309139, "cdf": 0.4 }, - { "x": 19.3374292294283, "pdf": 0.0643363238452001, "logpdf": -2.74363089518532, "cdf": 0.5 }, - { "x": 20.9513683777637, "pdf": 0.0590631641338378, "logpdf": -2.82914782919732, "cdf": 0.6 }, - { "x": 22.7745450736464, "pdf": 0.050298470529975, "logpdf": -2.98978060929749, "cdf": 0.7 }, + { "x": 19.3374292294283, "pdf": 0.0643363238452, "logpdf": -2.74363089518532, "cdf": 0.500000000000001 }, + { "x": 20.9513683777637, "pdf": 0.0590631641338377, "logpdf": -2.82914782919732, "cdf": 0.6 }, + { "x": 22.7745450736464, "pdf": 0.0502984705299751, "logpdf": -2.98978060929749, "cdf": 0.7 }, { "x": 25.0375056396374, "pdf": 0.0380567135760359, "logpdf": -3.2686777693438, "cdf": 0.8 }, { "x": 28.4119805843056, "pdf": 0.0219718891652458, "logpdf": -3.81799140787796, "cdf": 0.9 } ], @@ -752,7 +748,6 @@ "kurtosis": -0.593762875598279 }, "points": [ - { "x": -1.1, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, { "x": -0.482188327829739, "pdf": 0.527963910509893, "logpdf": -0.638727348918953, "cdf": 0.0999999999999984 }, { "x": -0.327366978501695, "pdf": 0.758071937470324, "logpdf": -0.276976993528483, "cdf": 0.2 }, { "x": -0.207158552620695, "pdf": 0.897797338567873, "logpdf": -0.107810917031801, "cdf": 0.300000000000004 }, @@ -761,8 +756,7 @@ { "x": 0.100839124027597, "pdf": 0.975119293165484, "logpdf": -0.0251954635040822, "cdf": 0.6 }, { "x": 0.207158552620696, "pdf": 0.897797338567872, "logpdf": -0.107810917031802, "cdf": 0.699999999999996 }, { "x": 0.327366978501695, "pdf": 0.758071937470324, "logpdf": -0.276976993528483, "cdf": 0.8 }, - { "x": 0.482188327829739, "pdf": 0.527963910509893, "logpdf": -0.638727348918953, "cdf": 0.900000000000001 }, - { "x": 1.1, "pdf": 0, "logpdf": "-inf", "cdf": 1 } + { "x": 0.482188327829739, "pdf": 0.527963910509893, "logpdf": -0.638727348918953, "cdf": 0.900000000000001 } ], "quans": [ { "q": 0.10, "x": -0.482188327829739 }, @@ -788,7 +782,6 @@ "kurtosis": -0.593762875598279 }, "points": [ - { "x": -1, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, { "x": 1.01781167217026, "pdf": 0.527963910509893, "logpdf": -0.638727348918953, "cdf": 0.0999999999999984 }, { "x": 1.1726330214983, "pdf": 0.758071937470324, "logpdf": -0.276976993528483, "cdf": 0.2 }, { "x": 1.2928414473793, "pdf": 0.897797338567873, "logpdf": -0.107810917031801, "cdf": 0.300000000000004 }, @@ -797,8 +790,7 @@ { "x": 1.6008391240276, "pdf": 0.975119293165484, "logpdf": -0.0251954635040823, "cdf": 0.6 }, { "x": 1.7071585526207, "pdf": 0.897797338567872, "logpdf": -0.107810917031802, "cdf": 0.699999999999996 }, { "x": 1.8273669785017, "pdf": 0.758071937470324, "logpdf": -0.276976993528483, "cdf": 0.8 }, - { "x": 1.98218832782974, "pdf": 0.527963910509894, "logpdf": -0.638727348918952, "cdf": 0.900000000000001 }, - { "x": 3, "pdf": 0, "logpdf": "-inf", "cdf": 1 } + { "x": 1.98218832782974, "pdf": 0.527963910509894, "logpdf": -0.638727348918952, "cdf": 0.900000000000001 } ], "quans": [ { "q": 0.10, "x": 1.01781167217026 }, @@ -824,7 +816,6 @@ "kurtosis": -0.593762875598279 }, "points": [ - { "x": -0.9, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, { "x": 0.64987268207673, "pdf": 0.188558539467819, "logpdf": -1.66834676610011, "cdf": 0.0999999999999984 }, { "x": 1.08337246019525, "pdf": 0.270739977667973, "logpdf": -1.30659641070964, "cdf": 0.2 }, { "x": 1.41995605266205, "pdf": 0.320641906631383, "logpdf": -1.13743033421296, "cdf": 0.300000000000004 }, @@ -833,8 +824,7 @@ { "x": 2.28234954727727, "pdf": 0.348256890416244, "logpdf": -1.05481488068524, "cdf": 0.6 }, { "x": 2.58004394733795, "pdf": 0.320641906631383, "logpdf": -1.13743033421296, "cdf": 0.699999999999996 }, { "x": 2.91662753980475, "pdf": 0.270739977667973, "logpdf": -1.30659641070964, "cdf": 0.8 }, - { "x": 3.35012731792327, "pdf": 0.188558539467819, "logpdf": -1.66834676610011, "cdf": 0.900000000000001 }, - { "x": 5, "pdf": 0, "logpdf": "-inf", "cdf": 1 } + { "x": 3.35012731792327, "pdf": 0.188558539467819, "logpdf": -1.66834676610011, "cdf": 0.900000000000001 } ], "quans": [ { "q": 0.10, "x": 0.64987268207673 }, @@ -846,7 +836,7 @@ }, { "expr": "Erlang()", - "dtype": "Gamma", + "dtype": "Erlang", "minimum": 0, "maximum": "inf", "properties": { @@ -880,7 +870,7 @@ }, { "expr": "Erlang(3)", - "dtype": "Gamma", + "dtype": "Erlang", "minimum": 0, "maximum": "inf", "properties": { @@ -898,7 +888,7 @@ { "x": 1.53504420264464, "pdf": 0.253834441669019, "logpdf": -1.37107302893315, "cdf": 0.2 }, { "x": 1.91377579412706, "pdf": 0.270153035539892, "logpdf": -1.30876668225735, "cdf": 0.3 }, { "x": 2.28507690400338, "pdf": 0.265690089907115, "logpdf": -1.32542472496572, "cdf": 0.4 }, - { "x": 2.67406031372356, "pdf": 0.246594146292466, "logpdf": -1.40001142619598, "cdf": 0.5 }, + { "x": 2.67406031372356, "pdf": 0.246594146292465, "logpdf": -1.40001142619598, "cdf": 0.5 }, { "x": 3.10537859726335, "pdf": 0.216048037768763, "logpdf": -1.53225449894693, "cdf": 0.6 }, { "x": 3.61556766586599, "pdf": 0.175833615330865, "logpdf": -1.73821709852388, "cdf": 0.7 }, { "x": 4.27902986012533, "pdf": 0.126853245329128, "logpdf": -2.06472440927414, "cdf": 0.8 }, @@ -914,7 +904,7 @@ }, { "expr": "Erlang(3, 1.0)", - "dtype": "Gamma", + "dtype": "Erlang", "minimum": 0, "maximum": "inf", "properties": { @@ -932,7 +922,7 @@ { "x": 1.53504420264464, "pdf": 0.253834441669019, "logpdf": -1.37107302893315, "cdf": 0.2 }, { "x": 1.91377579412706, "pdf": 0.270153035539892, "logpdf": -1.30876668225735, "cdf": 0.3 }, { "x": 2.28507690400338, "pdf": 0.265690089907115, "logpdf": -1.32542472496572, "cdf": 0.4 }, - { "x": 2.67406031372356, "pdf": 0.246594146292466, "logpdf": -1.40001142619598, "cdf": 0.5 }, + { "x": 2.67406031372356, "pdf": 0.246594146292465, "logpdf": -1.40001142619598, "cdf": 0.5 }, { "x": 3.10537859726335, "pdf": 0.216048037768763, "logpdf": -1.53225449894693, "cdf": 0.6 }, { "x": 3.61556766586599, "pdf": 0.175833615330865, "logpdf": -1.73821709852388, "cdf": 0.7 }, { "x": 4.27902986012533, "pdf": 0.126853245329128, "logpdf": -2.06472440927414, "cdf": 0.8 }, @@ -948,7 +938,7 @@ }, { "expr": "Erlang(5, 2.0)", - "dtype": "Gamma", + "dtype": "Erlang", "minimum": 0, "maximum": "inf", "properties": { @@ -963,10 +953,10 @@ }, "points": [ { "x": 4.86518205192533, "pdf": 0.0640581370612566, "logpdf": -2.74796421637827, "cdf": 0.1 }, - { "x": 6.17907925603939, "pdf": 0.086409965319977, "logpdf": -2.44865227047161, "cdf": 0.2 }, + { "x": 6.17907925603939, "pdf": 0.0864099653199771, "logpdf": -2.44865227047161, "cdf": 0.2 }, { "x": 7.26721816592761, "pdf": 0.0959522578241127, "logpdf": -2.34390452554825, "cdf": 0.3 }, - { "x": 8.29547176094109, "pdf": 0.0974236354704824, "logpdf": -2.32868643380379, "cdf": 0.4 }, - { "x": 9.34181776559197, "pdf": 0.0928569449561913, "logpdf": -2.37669519639106, "cdf": 0.5 }, + { "x": 8.29547176094109, "pdf": 0.0974236354704823, "logpdf": -2.32868643380379, "cdf": 0.4 }, + { "x": 9.34181776559197, "pdf": 0.0928569449561914, "logpdf": -2.37669519639105, "cdf": 0.5 }, { "x": 10.4732362313955, "pdf": 0.0833159261523607, "logpdf": -2.48511555777943, "cdf": 0.6 }, { "x": 11.780722627394, "pdf": 0.0693705420895148, "logpdf": -2.66829296714934, "cdf": 0.7 }, { "x": 13.4419575749731, "pdf": 0.0512394973828035, "logpdf": -2.97124461108049, "cdf": 0.8 }, @@ -1124,7 +1114,7 @@ "skewness": "nan" }, "points": [ - { "x": 0.374765576124361, "pdf": 0.585032515202638, "logpdf": -0.536087851751906, "cdf": 0.1 }, + { "x": 0.374765576124361, "pdf": 0.585032515202638, "logpdf": -0.536087851751907, "cdf": 0.1 }, { "x": 0.531187881211128, "pdf": 0.669560401745661, "logpdf": -0.40113389873347, "cdf": 0.2 }, { "x": 0.681456696679789, "pdf": 0.650432643707868, "logpdf": -0.430117531805273, "cdf": 0.3 }, { "x": 0.84308653435514, "pdf": 0.582473178551035, "logpdf": -0.540472140008353, "cdf": 0.4 }, @@ -1142,19 +1132,6 @@ { "q": 0.90, "x": 2.9830356142905 } ] }, -{ - "expr": "FDist(30, 40)", - "dtype": "FDist", - "minimum": 0, - "maximum": "inf", - "properties": { - "kurtosis": 2.2442906574394463 - }, - "points": [ - ], - "quans": [ - ] -}, { "expr": "Frechet()", "dtype": "Frechet", @@ -1306,9 +1283,9 @@ "mean": 1.00989927718532, "median": 1.00612724390735, "mode": 0.999724549577582, - "var": 0.000477787376792493, - "skewness": 1.24257800850493, - "kurtosis": 2.92767901972826, + "var": 0.000477787376792937, + "skewness": 1.24257800846067, + "kurtosis": 2.92767902360239, "entropy": -2.50750863623888 }, "points": [ @@ -1451,14 +1428,14 @@ }, "points": [ { "x": 0.531811608389612, "pdf": 0.312460386727212, "logpdf": -1.16327758031364, "cdf": 0.1 }, - { "x": 0.824388309032984, "pdf": 0.361496861145729, "logpdf": -1.01750192028207, "cdf": 0.2 }, + { "x": 0.824388309032985, "pdf": 0.361496861145729, "logpdf": -1.01750192028207, "cdf": 0.2 }, { "x": 1.09734921070349, "pdf": 0.366245374672153, "logpdf": -1.0044517476121, "cdf": 0.3 }, { "x": 1.37642134206289, "pdf": 0.34751952047394, "logpdf": -1.05693444152926, "cdf": 0.4 }, { "x": 1.67834699001666, "pdf": 0.313317691149163, "logpdf": -1.16053761549671, "cdf": 0.5 }, { "x": 2.02231324532466, "pdf": 0.267651044901194, "logpdf": -1.31807121816683, "cdf": 0.6 }, - { "x": 2.4392164832802, "pdf": 0.212770829792642, "logpdf": -1.5475396089528, "cdf": 0.7 }, + { "x": 2.43921648328021, "pdf": 0.212770829792642, "logpdf": -1.5475396089528, "cdf": 0.7 }, { "x": 2.99430834700212, "pdf": 0.149928752959168, "logpdf": -1.89759507799696, "cdf": 0.8 }, - { "x": 3.88972016986743, "pdf": 0.0795489319376099, "logpdf": -2.5313829505913, "cdf": 0.9 } + { "x": 3.88972016986743, "pdf": 0.07954893193761, "logpdf": -2.5313829505913, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.531811608389612 }, @@ -1522,7 +1499,7 @@ { "x": 1.53504420264464, "pdf": 0.253834441669019, "logpdf": -1.37107302893315, "cdf": 0.2 }, { "x": 1.91377579412706, "pdf": 0.270153035539892, "logpdf": -1.30876668225735, "cdf": 0.3 }, { "x": 2.28507690400338, "pdf": 0.265690089907115, "logpdf": -1.32542472496572, "cdf": 0.4 }, - { "x": 2.67406031372356, "pdf": 0.246594146292466, "logpdf": -1.40001142619598, "cdf": 0.5 }, + { "x": 2.67406031372356, "pdf": 0.246594146292465, "logpdf": -1.40001142619598, "cdf": 0.5 }, { "x": 3.10537859726335, "pdf": 0.216048037768763, "logpdf": -1.53225449894693, "cdf": 0.6 }, { "x": 3.61556766586599, "pdf": 0.175833615330865, "logpdf": -1.73821709852388, "cdf": 0.7 }, { "x": 4.27902986012533, "pdf": 0.126853245329128, "logpdf": -2.06472440927414, "cdf": 0.8 }, @@ -1596,7 +1573,7 @@ { "x": 1.95761518897122, "pdf": 0.156565690737548, "logpdf": -1.85427960795023, "cdf": 0.6 }, { "x": 2.80367325205713, "pdf": 0.0890519109435885, "logpdf": -2.41853581025618, "cdf": 0.7 }, { "x": 4.48142011772455, "pdf": 0.0398344355944939, "logpdf": -3.22302352483324, "cdf": 0.8 }, - { "x": 9.4912215810299, "pdf": 0.00999075443371475, "logpdf": -4.60609517028272, "cdf": 0.9 } + { "x": 9.4912215810299, "pdf": 0.00999075443371476, "logpdf": -4.60609517028272, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.434294481903252 }, @@ -1668,7 +1645,7 @@ { "x": 0.994209642457738, "pdf": 0.146394198326218, "logpdf": -1.92145230715945, "cdf": 0.6 }, { "x": 1.91648808333715, "pdf": 0.080328656510008, "logpdf": -2.52162885357205, "cdf": 0.7 }, { "x": 3.82421463819962, "pdf": 0.0342860222134833, "logpdf": -3.37301752350919, "cdf": 0.8 }, - { "x": 9.89682636932353, "pdf": 0.00797748641271692, "logpdf": -4.83113190301396, "cdf": 0.9 } + { "x": 9.89682636932353, "pdf": 0.00797748641271693, "logpdf": -4.83113190301396, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": -0.545870655521596 }, @@ -1734,7 +1711,7 @@ "points": [ { "x": -0.737875134909166, "pdf": 0.295719794214892, "logpdf": -1.2183429141717, "cdf": 0.1 }, { "x": -0.443475507422073, "pdf": 0.371284219821805, "logpdf": -0.990787418508857, "cdf": 0.2 }, - { "x": -0.180552786778971, "pdf": 0.381876501249586, "logpdf": -0.96265801780486, "cdf": 0.3 }, + { "x": -0.180552786778971, "pdf": 0.381876501249586, "logpdf": -0.962658017804861, "cdf": 0.3 }, { "x": 0.0885780393597739, "pdf": 0.357028818917274, "logpdf": -1.02993877520214, "cdf": 0.4 }, { "x": 0.387421948771033, "pdf": 0.310486773072553, "logpdf": -1.16961397731611, "cdf": 0.5 }, { "x": 0.744194583123536, "pdf": 0.250556530443018, "logpdf": -1.38407071348575, "cdf": 0.6 }, @@ -1804,20 +1781,20 @@ "entropy": 1.23039788328251 }, "points": [ - { "x": -1.32810308885079, "pdf": 0.759582757280745, "logpdf": -0.274986000037371, "cdf": 0.0999999999999999 }, + { "x": -1.32810308885079, "pdf": 0.759582757280746, "logpdf": -0.274986000037371, "cdf": 0.1 }, { "x": -1.20698746428479, "pdf": 0.856522459323705, "logpdf": -0.154874739350778, "cdf": 0.2 }, - { "x": -1.08783144522846, "pdf": 0.807491452091782, "logpdf": -0.213822809586206, "cdf": 0.3 }, + { "x": -1.08783144522846, "pdf": 0.807491452091782, "logpdf": -0.213822809586205, "cdf": 0.3 }, { "x": -0.955122525140851, "pdf": 0.695573867023301, "logpdf": -0.363018066179418, "cdf": 0.4 }, - { "x": -0.795031843135267, "pdf": 0.556314958535246, "logpdf": -0.586420672930663, "cdf": 0.5 }, + { "x": -0.795031843135268, "pdf": 0.556314958535246, "logpdf": -0.586420672930663, "cdf": 0.5 }, { "x": -0.586365790121951, "pdf": 0.409654306198247, "logpdf": -0.892441630553441, "cdf": 0.6 }, { "x": -0.28645843182849, "pdf": 0.269007382254187, "logpdf": -1.31301645643274, "cdf": 0.7 }, { "x": 0.216262122916378, "pdf": 0.14516266328479, "logpdf": -1.92990034956949, "cdf": 0.8 }, - { "x": 1.38189648920178, "pdf": 0.0491538030591322, "logpdf": -3.01280105879779, "cdf": 0.9 } + { "x": 1.38189648920178, "pdf": 0.0491538030591321, "logpdf": -3.01280105879779, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": -1.32810308885079 }, { "q": 0.25, "x": -1.14830981829152 }, - { "q": 0.50, "x": -0.795031843135267 }, + { "q": 0.50, "x": -0.795031843135268 }, { "q": 0.75, "x": -0.0735018833126749 }, { "q": 0.90, "x": 1.38189648920178 } ] @@ -1839,7 +1816,7 @@ }, "points": [ { "x": 0.111111111111111, "pdf": 0.81, "logpdf": -0.210721031315653, "cdf": 0.1 }, - { "x": 0.25, "pdf": 0.64, "logpdf": -0.446287102628419, "cdf": 0.2 }, + { "x": 0.25, "pdf": 0.64, "logpdf": -0.44628710262842, "cdf": 0.2 }, { "x": 0.428571428571429, "pdf": 0.49, "logpdf": -0.713349887877465, "cdf": 0.3 }, { "x": 0.666666666666667, "pdf": 0.36, "logpdf": -1.02165124753198, "cdf": 0.4 }, { "x": 1, "pdf": 0.25, "logpdf": -1.38629436111989, "cdf": 0.5 }, @@ -1873,7 +1850,7 @@ }, "points": [ { "x": 0.111111111111111, "pdf": 0.81, "logpdf": -0.210721031315653, "cdf": 0.1 }, - { "x": 0.25, "pdf": 0.64, "logpdf": -0.446287102628419, "cdf": 0.2 }, + { "x": 0.25, "pdf": 0.64, "logpdf": -0.44628710262842, "cdf": 0.2 }, { "x": 0.428571428571429, "pdf": 0.49, "logpdf": -0.713349887877465, "cdf": 0.3 }, { "x": 0.666666666666667, "pdf": 0.36, "logpdf": -1.02165124753198, "cdf": 0.4 }, { "x": 1, "pdf": 0.25, "logpdf": -1.38629436111989, "cdf": 0.5 }, @@ -1941,7 +1918,7 @@ }, "points": [ { "x": 0.111111111111111, "pdf": 0.81, "logpdf": -0.210721031315653, "cdf": 0.1 }, - { "x": 0.25, "pdf": 0.64, "logpdf": -0.446287102628419, "cdf": 0.2 }, + { "x": 0.25, "pdf": 0.64, "logpdf": -0.44628710262842, "cdf": 0.2 }, { "x": 0.428571428571429, "pdf": 0.49, "logpdf": -0.713349887877465, "cdf": 0.3 }, { "x": 0.666666666666667, "pdf": 0.36, "logpdf": -1.02165124753198, "cdf": 0.4 }, { "x": 1, "pdf": 0.25, "logpdf": -1.38629436111989, "cdf": 0.5 }, @@ -1977,12 +1954,12 @@ { "x": 0.0117283950617284, "pdf": 7.29, "logpdf": 1.98650354602057, "cdf": 0.1 }, { "x": 0.028125, "pdf": 5.12, "logpdf": 1.63315443905142, "cdf": 0.2 }, { "x": 0.0520408163265306, "pdf": 3.43, "logpdf": 1.23256026117785, "cdf": 0.3 }, - { "x": 0.0888888888888889, "pdf": 2.16, "logpdf": 0.770108221696074, "cdf": 0.4 }, - { "x": 0.15, "pdf": 1.25, "logpdf": 0.22314355131421, "cdf": 0.5 }, - { "x": 0.2625, "pdf": 0.64, "logpdf": -0.446287102628419, "cdf": 0.6 }, + { "x": 0.0888888888888889, "pdf": 2.16, "logpdf": 0.770108221696073, "cdf": 0.4 }, + { "x": 0.15, "pdf": 1.25, "logpdf": 0.223143551314209, "cdf": 0.5 }, + { "x": 0.2625, "pdf": 0.64, "logpdf": -0.44628710262842, "cdf": 0.6 }, { "x": 0.505555555555556, "pdf": 0.27, "logpdf": -1.30933331998376, "cdf": 0.7 }, { "x": 1.2, "pdf": 0.0799999999999999, "logpdf": -2.52572864430826, "cdf": 0.8 }, - { "x": 4.95, "pdf": 0.00999999999999999, "logpdf": -4.60517018598809, "cdf": 0.9 } + { "x": 4.95, "pdf": 0.01, "logpdf": -4.60517018598809, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.0117283950617284 }, @@ -2009,7 +1986,7 @@ }, "points": [ { "x": 1.11111111111111, "pdf": 0.81, "logpdf": -0.210721031315653, "cdf": 0.1 }, - { "x": 1.25, "pdf": 0.64, "logpdf": -0.446287102628419, "cdf": 0.2 }, + { "x": 1.25, "pdf": 0.64, "logpdf": -0.44628710262842, "cdf": 0.2 }, { "x": 1.42857142857143, "pdf": 0.49, "logpdf": -0.713349887877465, "cdf": 0.3 }, { "x": 1.66666666666667, "pdf": 0.36, "logpdf": -1.02165124753198, "cdf": 0.4 }, { "x": 2, "pdf": 0.25, "logpdf": -1.38629436111989, "cdf": 0.5 }, @@ -2043,7 +2020,7 @@ }, "points": [ { "x": -1.44135802469136, "pdf": 1.458, "logpdf": 0.377065633586466, "cdf": 0.1 }, - { "x": -1.359375, "pdf": 1.024, "logpdf": 0.0237165266173161, "cdf": 0.2 }, + { "x": -1.359375, "pdf": 1.024, "logpdf": 0.023716526617316, "cdf": 0.2 }, { "x": -1.23979591836735, "pdf": 0.686, "logpdf": -0.376877651256252, "cdf": 0.3 }, { "x": -1.05555555555556, "pdf": 0.432, "logpdf": -0.839329690738027, "cdf": 0.4 }, { "x": -0.75, "pdf": 0.25, "logpdf": -1.38629436111989, "cdf": 0.5 }, @@ -2221,7 +2198,7 @@ { "x": 1.95761518897122, "pdf": 0.156565690737548, "logpdf": -1.85427960795023, "cdf": 0.6 }, { "x": 2.80367325205713, "pdf": 0.0890519109435885, "logpdf": -2.41853581025618, "cdf": 0.7 }, { "x": 4.48142011772455, "pdf": 0.0398344355944939, "logpdf": -3.22302352483324, "cdf": 0.8 }, - { "x": 9.4912215810299, "pdf": 0.00999075443371475, "logpdf": -4.60609517028272, "cdf": 0.9 } + { "x": 9.4912215810299, "pdf": 0.00999075443371476, "logpdf": -4.60609517028272, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.434294481903252 }, @@ -2249,14 +2226,14 @@ }, "points": [ { "x": 0.257087902555747, "pdf": 1.20356921493822, "logpdf": 0.185291487960948, "cdf": 0.0999999999999999 }, - { "x": 0.333966941314241, "pdf": 1.34424357894406, "logpdf": 0.295831460013378, "cdf": 0.2 }, + { "x": 0.333966941314241, "pdf": 1.34424357894406, "logpdf": 0.295831460013377, "cdf": 0.2 }, { "x": 0.409967711703564, "pdf": 1.26593900050033, "logpdf": 0.235814139702018, "cdf": 0.3 }, - { "x": 0.494483237110709, "pdf": 1.09462609165755, "logpdf": 0.0904128361488257, "cdf": 0.4 }, + { "x": 0.494483237110709, "pdf": 1.09462609165755, "logpdf": 0.0904128361488254, "cdf": 0.4 }, { "x": 0.595824347377698, "pdf": 0.882568505589825, "logpdf": -0.124918866456804, "cdf": 0.5 }, { "x": 0.726521719360489, "pdf": 0.658388141767927, "logpdf": -0.417960640462019, "cdf": 0.6 }, { "x": 0.911286936051029, "pdf": 0.441023630341812, "logpdf": -0.818656821429314, "cdf": 0.7 }, { "x": 1.21302059847623, "pdf": 0.245679081175552, "logpdf": -1.40372914278024, "cdf": 0.8 }, - { "x": 1.88036512220581, "pdf": 0.0883711673127126, "logpdf": -2.42620952416171, "cdf": 0.9 } + { "x": 1.88036512220581, "pdf": 0.0883711673127127, "logpdf": -2.42620952416171, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.257087902555747 }, @@ -2291,7 +2268,7 @@ { "x": 1.95761518897122, "pdf": 0.156565690737548, "logpdf": -1.85427960795023, "cdf": 0.6 }, { "x": 2.80367325205713, "pdf": 0.0890519109435885, "logpdf": -2.41853581025618, "cdf": 0.7 }, { "x": 4.48142011772455, "pdf": 0.0398344355944939, "logpdf": -3.22302352483324, "cdf": 0.8 }, - { "x": 9.4912215810299, "pdf": 0.00999075443371475, "logpdf": -4.60609517028272, "cdf": 0.9 } + { "x": 9.4912215810299, "pdf": 0.00999075443371476, "logpdf": -4.60609517028272, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.434294481903252 }, @@ -2323,7 +2300,7 @@ { "x": 1.66116709016507, "pdf": 0.217432577033469, "logpdf": -1.52586646716115, "cdf": 0.3 }, { "x": 2.18271333587458, "pdf": 0.167917741063695, "logpdf": -1.78428105601561, "cdf": 0.4 }, { "x": 2.88539008177793, "pdf": 0.12011325347955, "logpdf": -2.11932020228322, "cdf": 0.5 }, - { "x": 3.91523037794243, "pdf": 0.078282845368774, "logpdf": -2.54742678851018, "cdf": 0.6 }, + { "x": 3.91523037794243, "pdf": 0.0782828453687741, "logpdf": -2.54742678851018, "cdf": 0.6 }, { "x": 5.60734650411426, "pdf": 0.0445259554717942, "logpdf": -3.11168299081612, "cdf": 0.7 }, { "x": 8.9628402354491, "pdf": 0.0199172177972469, "logpdf": -3.91617070539319, "cdf": 0.8 }, { "x": 18.9824431620598, "pdf": 0.00499537721685738, "logpdf": -5.29924235084266, "cdf": 0.9 } @@ -2354,14 +2331,14 @@ }, "points": [ { "x": 0.257087902555747, "pdf": 1.20356921493822, "logpdf": 0.185291487960948, "cdf": 0.0999999999999999 }, - { "x": 0.333966941314241, "pdf": 1.34424357894406, "logpdf": 0.295831460013378, "cdf": 0.2 }, + { "x": 0.333966941314241, "pdf": 1.34424357894406, "logpdf": 0.295831460013377, "cdf": 0.2 }, { "x": 0.409967711703564, "pdf": 1.26593900050033, "logpdf": 0.235814139702018, "cdf": 0.3 }, - { "x": 0.494483237110709, "pdf": 1.09462609165755, "logpdf": 0.0904128361488257, "cdf": 0.4 }, + { "x": 0.494483237110709, "pdf": 1.09462609165755, "logpdf": 0.0904128361488254, "cdf": 0.4 }, { "x": 0.595824347377698, "pdf": 0.882568505589825, "logpdf": -0.124918866456804, "cdf": 0.5 }, { "x": 0.726521719360489, "pdf": 0.658388141767927, "logpdf": -0.417960640462019, "cdf": 0.6 }, { "x": 0.911286936051029, "pdf": 0.441023630341812, "logpdf": -0.818656821429314, "cdf": 0.7 }, { "x": 1.21302059847623, "pdf": 0.245679081175552, "logpdf": -1.40372914278024, "cdf": 0.8 }, - { "x": 1.88036512220581, "pdf": 0.0883711673127126, "logpdf": -2.42620952416171, "cdf": 0.9 } + { "x": 1.88036512220581, "pdf": 0.0883711673127127, "logpdf": -2.42620952416171, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.257087902555747 }, @@ -2455,7 +2432,7 @@ { "x": 0.219096451665759, "pdf": 1.16784160332433, "logpdf": 0.155157261617497, "cdf": 0.0999999999999999 }, { "x": 0.29970413970745, "pdf": 1.26623114744795, "logpdf": 0.236044887978669, "cdf": 0.2 }, { "x": 0.380795333444316, "pdf": 1.18384031440294, "logpdf": 0.168763657773985, "cdf": 0.3 }, - { "x": 0.470924569641255, "pdf": 1.03148189891909, "logpdf": 0.0309965050660294, "cdf": 0.4 }, + { "x": 0.470924569641255, "pdf": 1.03148189891909, "logpdf": 0.0309965050660296, "cdf": 0.4 }, { "x": 0.57737911535724, "pdf": 0.850344404377658, "logpdf": -0.162113829940907, "cdf": 0.5 }, { "x": 0.710440546984018, "pdf": 0.660370755622942, "logpdf": -0.414953850740811, "cdf": 0.6 }, { "x": 0.888740534511917, "pdf": 0.472869394786203, "logpdf": -0.748936049578017, "cdf": 0.7 }, @@ -2492,14 +2469,14 @@ { "x": 1.37935538440006, "pdf": 0.237813022075351, "logpdf": -1.43627053560512, "cdf": 0.6 }, { "x": 1.90567301434916, "pdf": 0.151559800433906, "logpdf": -1.88677500957906, "cdf": 0.7 }, { "x": 2.79557537872124, "pdf": 0.0829683199534052, "logpdf": -2.48929643135505, "cdf": 0.8 }, - { "x": 4.71652208375224, "pdf": 0.032028740699793, "logpdf": -3.44112163240644, "cdf": 0.9 } + { "x": 4.71652208375225, "pdf": 0.032028740699793, "logpdf": -3.44112163240644, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.287665872979501 }, { "q": 0.25, "x": 0.50122683623004 }, { "q": 0.50, "x": 1.02845978458437 }, { "q": 0.75, "x": 2.28417398145666 }, - { "q": 0.90, "x": 4.71652208375224 } + { "q": 0.90, "x": 4.71652208375225 } ] }, { @@ -2990,7 +2967,7 @@ }, "points": [ { "x": 2.58584313134885, "pdf": 0.0666666666666667, "logpdf": -2.70805020110221, "cdf": 0.1 }, - { "x": 3.62556390218877, "pdf": 0.133333333333333, "logpdf": -2.01490302054226, "cdf": 0.2 }, + { "x": 3.62556390218877, "pdf": 0.133333333333333, "logpdf": -2.01490302054227, "cdf": 0.2 }, { "x": 4.23376156435101, "pdf": 0.2, "logpdf": -1.6094379124341, "cdf": 0.3 }, { "x": 4.66528467302868, "pdf": 0.266666666666667, "logpdf": -1.32175583998232, "cdf": 0.4 }, { "x": 5, "pdf": 0.333333333333333, "logpdf": -1.09861228866811, "cdf": 0.5 }, @@ -3022,7 +2999,6 @@ "median": 2.19810933831773 }, "points": [ - { "x": -0.9, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, { "x": 0.369611509468195, "pdf": 0.458976595137631, "logpdf": -0.77875606120723, "cdf": 0.1 }, { "x": 0.608874560377745, "pdf": 0.369386695839305, "logpdf": -0.99591122746031, "cdf": 0.2 }, { "x": 0.930930391478152, "pdf": 0.259582823741195, "logpdf": -1.34867946066629, "cdf": 0.3 }, @@ -3056,9 +3032,8 @@ "median": 4.19810933831773 }, "points": [ - { "x": 1.8, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, { "x": 2.3696115094682, "pdf": 0.458976595137631, "logpdf": -0.77875606120723, "cdf": 0.1 }, - { "x": 2.60887456037774, "pdf": 0.369386695839305, "logpdf": -0.995911227460309, "cdf": 0.2 }, + { "x": 2.60887456037774, "pdf": 0.369386695839305, "logpdf": -0.99591122746031, "cdf": 0.2 }, { "x": 2.93093039147815, "pdf": 0.259582823741195, "logpdf": -1.34867946066629, "cdf": 0.3 }, { "x": 3.41177872241855, "pdf": 0.166897186553012, "logpdf": -1.79037730553844, "cdf": 0.4 }, { "x": 4.19810933831773, "pdf": 0.097509726832746, "logpdf": -2.32780314356713, "cdf": 0.5 }, @@ -3090,9 +3065,8 @@ "median": 19.5848747065419 }, "points": [ - { "x": 1.8, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, { "x": 4.95689207574556, "pdf": 0.0573720743922038, "logpdf": -2.85819760288707, "cdf": 0.1 }, - { "x": 6.87099648302196, "pdf": 0.0461733369799131, "logpdf": -3.07535276914015, "cdf": 0.2 }, + { "x": 6.87099648302196, "pdf": 0.0461733369799131, "logpdf": -3.07535276914014, "cdf": 0.2 }, { "x": 9.44744313182521, "pdf": 0.0324478529676494, "logpdf": -3.42812100234613, "cdf": 0.3 }, { "x": 13.2942297793484, "pdf": 0.0208621483191266, "logpdf": -3.86981884721828, "cdf": 0.4 }, { "x": 19.5848747065419, "pdf": 0.0121887158540933, "logpdf": -4.40724468524697, "cdf": 0.5 }, @@ -3124,8 +3098,7 @@ "median": 9.59432801495319 }, "points": [ - { "x": 2.8, "pdf": 0, "logpdf": "-inf", "cdf": 0 }, - { "x": 4.10883452840458, "pdf": 0.15299219837921, "logpdf": -1.87736834987534, "cdf": 0.1 }, + { "x": 4.10883452840459, "pdf": 0.15299219837921, "logpdf": -1.87736834987534, "cdf": 0.1 }, { "x": 4.82662368113323, "pdf": 0.123128898613102, "logpdf": -2.09452351612842, "cdf": 0.2 }, { "x": 5.79279117443446, "pdf": 0.0865276079137316, "logpdf": -2.4472917493344, "cdf": 0.3 }, { "x": 7.23533616725564, "pdf": 0.0556323955176708, "logpdf": -2.88898959420655, "cdf": 0.4 }, @@ -3136,48 +3109,13 @@ { "x": 192.98435303105, "pdf": 0.000261797212923288, "logpdf": -8.2479403503691, "cdf": 0.9 } ], "quans": [ - { "q": 0.10, "x": 4.10883452840458 }, + { "q": 0.10, "x": 4.10883452840459 }, { "q": 0.25, "x": 5.26705329015292 }, { "q": 0.50, "x": 9.5943280149532 }, { "q": 0.75, "x": 32.5476129654731 }, { "q": 0.90, "x": 192.98435303105 } ] }, -{ - "expr": "Logistic()", - "dtype": "Logistic", - "minimum": "-inf", - "maximum": "inf", - "properties": { - "location": 0, - "scale": 1, - "mean": 0, - "median": 0, - "mode": 0, - "var": 3.28986813369645, - "skewness": 0, - "kurtosis": 1.2, - "entropy": 2 - }, - "points": [ - { "x": -2.19722457733622, "pdf": 0.09, "logpdf": -2.40794560865187, "cdf": 0.1 }, - { "x": -1.38629436111989, "pdf": 0.16, "logpdf": -1.83258146374831, "cdf": 0.2 }, - { "x": -0.847297860387203, "pdf": 0.21, "logpdf": -1.56064774826467, "cdf": 0.3 }, - { "x": -0.405465108108164, "pdf": 0.24, "logpdf": -1.42711635564015, "cdf": 0.4 }, - { "x": 0, "pdf": 0.25, "logpdf": -1.38629436111989, "cdf": 0.5 }, - { "x": 0.405465108108164, "pdf": 0.24, "logpdf": -1.42711635564015, "cdf": 0.6 }, - { "x": 0.847297860387204, "pdf": 0.21, "logpdf": -1.56064774826467, "cdf": 0.7 }, - { "x": 1.38629436111989, "pdf": 0.16, "logpdf": -1.83258146374831, "cdf": 0.8 }, - { "x": 2.19722457733622, "pdf": 0.09, "logpdf": -2.40794560865187, "cdf": 0.9 } - ], - "quans": [ - { "q": 0.10, "x": -2.19722457733622 }, - { "q": 0.25, "x": -1.09861228866811 }, - { "q": 0.50, "x": 0 }, - { "q": 0.75, "x": 1.09861228866811 }, - { "q": 0.90, "x": 2.19722457733622 } - ] -}, { "expr": "Lindley()", "dtype": "Lindley", @@ -3186,7 +3124,7 @@ "properties": { }, "points": [ - { "x": 0.201229322235454, "pdf": 0.491137556224262, "logpdf": -0.711031035180873, "cdf": 0.1 }, + { "x": 0.201229322235454, "pdf": 0.491137556224262, "logpdf": -0.711031035180873, "cdf": 0.0999999999999998 }, { "x": 0.409355765160304, "pdf": 0.467961032750689, "logpdf": -0.759370249884304, "cdf": 0.2 }, { "x": 0.630825401024496, "pdf": 0.433923809718651, "logpdf": -0.834886313936738, "cdf": 0.3 }, { "x": 0.873054028699824, "pdf": 0.391162994497697, "logpdf": -0.938630940138138, "cdf": 0.4 }, @@ -3215,10 +3153,10 @@ { "x": 0.544019554971776, "pdf": 0.196051062631011, "logpdf": -1.6293801300544, "cdf": 0.0999999999999999 }, { "x": 1.04307224421496, "pdf": 0.202130669036478, "logpdf": -1.59884091429709, "cdf": 0.2 }, { "x": 1.5435367816863, "pdf": 0.195934998738978, "logpdf": -1.62997231384287, "cdf": 0.3 }, - { "x": 2.07183011333304, "pdf": 0.181699507555922, "logpdf": -1.70540101378774, "cdf": 0.4 }, + { "x": 2.07183011333304, "pdf": 0.181699507555922, "logpdf": -1.70540101378774, "cdf": 0.400000000000001 }, { "x": 2.65368480453801, "pdf": 0.161562102012007, "logpdf": -1.82286567765105, "cdf": 0.5 }, { "x": 3.32408881228643, "pdf": 0.136749781372001, "logpdf": -1.98960243642355, "cdf": 0.6 }, - { "x": 4.14298158855248, "pdf": 0.10800073172794, "logpdf": -2.22561727662217, "cdf": 0.7 }, + { "x": 4.14298158855248, "pdf": 0.10800073172794, "logpdf": -2.22561727662216, "cdf": 0.7 }, { "x": 5.23954037209116, "pdf": 0.0757268013786986, "logpdf": -2.58062313392393, "cdf": 0.8 }, { "x": 7.01639138849524, "pdf": 0.0400163645647015, "logpdf": -3.21846679441503, "cdf": 0.9 } ], @@ -3242,18 +3180,18 @@ { "x": 0.237615294552685, "pdf": 0.77989414577674, "logpdf": -0.248597079050649, "cdf": 0.2 }, { "x": 0.372143951935997, "pdf": 0.706662569042456, "logpdf": -0.347201998525827, "cdf": 0.3 }, { "x": 0.522280435214869, "pdf": 0.625895614615692, "logpdf": -0.468571671601523, "cdf": 0.4 }, - { "x": 0.694246765710091, "pdf": 0.538217563107918, "logpdf": -0.619492408171021, "cdf": 0.5 }, + { "x": 0.694246765710091, "pdf": 0.538217563107918, "logpdf": -0.61949240817102, "cdf": 0.5 }, { "x": 0.89826450068756, "pdf": 0.444050395936119, "logpdf": -0.811817218630417, "cdf": 0.6 }, { "x": 1.15323211442359, "pdf": 0.343613202710769, "logpdf": -1.06823866495725, "cdf": 0.7 }, { "x": 1.50109080206919, "pdf": 0.236863853380854, "logpdf": -1.44026976122003, "cdf": 0.8 }, - { "x": 2.07401891659104, "pdf": 0.12326693255173, "logpdf": -2.09340309170877, "cdf": 0.9 } + { "x": 2.07401891659103, "pdf": 0.12326693255173, "logpdf": -2.09340309170877, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.114556971437579 }, { "q": 0.25, "x": 0.30322247911811 }, { "q": 0.50, "x": 0.694246765710091 }, { "q": 0.75, "x": 1.31109339979007 }, - { "q": 0.90, "x": 2.07401891659104 } + { "q": 0.90, "x": 2.07401891659103 } ] }, { @@ -3264,24 +3202,59 @@ "properties": { }, "points": [ - { "x": 0.0465620413518296, "pdf": 2.04777663835177, "logpdf": 0.716754637924627, "cdf": 0.1 }, + { "x": 0.0465620413518293, "pdf": 2.04777663835177, "logpdf": 0.716754637924627, "cdf": 0.0999999999999996 }, { "x": 0.0980294998228117, "pdf": 1.84109209665868, "logpdf": 0.610358926343917, "cdf": 0.2 }, - { "x": 0.155708594360887, "pdf": 1.62989906665426, "logpdf": 0.488518090603404, "cdf": 0.3 }, + { "x": 0.155708594360887, "pdf": 1.62989906665426, "logpdf": 0.488518090603403, "cdf": 0.3 }, { "x": 0.221505053392774, "pdf": 1.41410780366481, "logpdf": 0.34649880478381, "cdf": 0.4 }, { "x": 0.298361440425077, "pdf": 1.19357014066527, "logpdf": 0.176948933955783, "cdf": 0.5 }, - { "x": 0.391185596605387, "pdf": 0.968051255886061, "logpdf": -0.0324702428118596, "cdf": 0.6 }, + { "x": 0.391185596605387, "pdf": 0.968051255886061, "logpdf": -0.03247024281186, "cdf": 0.6 }, { "x": 0.509131699567543, "pdf": 0.737174657514306, "logpdf": -0.304930430453559, "cdf": 0.7 }, { "x": 0.672626102659318, "pdf": 0.500297086565447, "logpdf": -0.692553183880015, "cdf": 0.8 }, { "x": 0.94630688386014, "pdf": 0.256133428755212, "logpdf": -1.36205676420823, "cdf": 0.9 } ], "quans": [ - { "q": 0.10, "x": 0.0465620413518296 }, + { "q": 0.10, "x": 0.0465620413518293 }, { "q": 0.25, "x": 0.125991234674835 }, { "q": 0.50, "x": 0.298361440425077 }, { "q": 0.75, "x": 0.583010462004234 }, { "q": 0.90, "x": 0.94630688386014 } ] }, +{ + "expr": "Logistic()", + "dtype": "Logistic", + "minimum": "-inf", + "maximum": "inf", + "properties": { + "location": 0, + "scale": 1, + "mean": 0, + "median": 0, + "mode": 0, + "var": 3.28986813369645, + "skewness": 0, + "kurtosis": 1.2, + "entropy": 2 + }, + "points": [ + { "x": -2.19722457733622, "pdf": 0.09, "logpdf": -2.40794560865187, "cdf": 0.1 }, + { "x": -1.38629436111989, "pdf": 0.16, "logpdf": -1.83258146374831, "cdf": 0.2 }, + { "x": -0.847297860387203, "pdf": 0.21, "logpdf": -1.56064774826467, "cdf": 0.3 }, + { "x": -0.405465108108164, "pdf": 0.24, "logpdf": -1.42711635564015, "cdf": 0.4 }, + { "x": 0, "pdf": 0.25, "logpdf": -1.38629436111989, "cdf": 0.5 }, + { "x": 0.405465108108164, "pdf": 0.24, "logpdf": -1.42711635564015, "cdf": 0.6 }, + { "x": 0.847297860387204, "pdf": 0.21, "logpdf": -1.56064774826467, "cdf": 0.7 }, + { "x": 1.38629436111989, "pdf": 0.16, "logpdf": -1.83258146374831, "cdf": 0.8 }, + { "x": 2.19722457733622, "pdf": 0.09, "logpdf": -2.40794560865187, "cdf": 0.9 } + ], + "quans": [ + { "q": 0.10, "x": -2.19722457733622 }, + { "q": 0.25, "x": -1.09861228866811 }, + { "q": 0.50, "x": 0 }, + { "q": 0.75, "x": 1.09861228866811 }, + { "q": 0.90, "x": 2.19722457733622 } + ] +}, { "expr": "Logistic(2.0)", "dtype": "Logistic", @@ -3405,7 +3378,7 @@ }, "points": [ { "x": -1.29583686600433, "pdf": 0.06, "logpdf": -2.81341071676004, "cdf": 0.1 }, - { "x": -0.0794415416798357, "pdf": 0.106666666666667, "logpdf": -2.23804657185647, "cdf": 0.2 }, + { "x": -0.0794415416798359, "pdf": 0.106666666666667, "logpdf": -2.23804657185647, "cdf": 0.2 }, { "x": 0.729053209419195, "pdf": 0.14, "logpdf": -1.96611285637283, "cdf": 0.3 }, { "x": 1.39180233783775, "pdf": 0.16, "logpdf": -1.83258146374831, "cdf": 0.4 }, { "x": 2, "pdf": 0.166666666666667, "logpdf": -1.79175946922805, "cdf": 0.5 }, @@ -3441,11 +3414,11 @@ "points": [ { "x": 1.70416313399567, "pdf": 0.06, "logpdf": -2.81341071676004, "cdf": 0.1 }, { "x": 2.92055845832016, "pdf": 0.106666666666667, "logpdf": -2.23804657185647, "cdf": 0.2 }, - { "x": 3.72905320941919, "pdf": 0.14, "logpdf": -1.96611285637283, "cdf": 0.3 }, + { "x": 3.7290532094192, "pdf": 0.14, "logpdf": -1.96611285637283, "cdf": 0.3 }, { "x": 4.39180233783775, "pdf": 0.16, "logpdf": -1.83258146374831, "cdf": 0.4 }, { "x": 5, "pdf": 0.166666666666667, "logpdf": -1.79175946922805, "cdf": 0.5 }, { "x": 5.60819766216225, "pdf": 0.16, "logpdf": -1.83258146374831, "cdf": 0.6 }, - { "x": 6.27094679058081, "pdf": 0.14, "logpdf": -1.96611285637283, "cdf": 0.7 }, + { "x": 6.2709467905808, "pdf": 0.14, "logpdf": -1.96611285637283, "cdf": 0.7 }, { "x": 7.07944154167984, "pdf": 0.106666666666667, "logpdf": -2.23804657185647, "cdf": 0.8 }, { "x": 8.29583686600433, "pdf": 0.06, "logpdf": -2.81341071676004, "cdf": 0.9 } ], @@ -3481,7 +3454,7 @@ { "x": 0.776198414156351, "pdf": 0.497736824052618, "logpdf": -0.697683807402524, "cdf": 0.4 }, { "x": 1, "pdf": 0.398942280401433, "logpdf": -0.918938533204673, "cdf": 0.5 }, { "x": 1.28833038275001, "pdf": 0.29987846182141, "logpdf": -1.20437801367412, "cdf": 0.6 }, - { "x": 1.689445743484, "pdf": 0.205802770252364, "logpdf": -1.58083699477694, "cdf": 0.7 }, + { "x": 1.689445743484, "pdf": 0.205802770252365, "logpdf": -1.58083699477694, "cdf": 0.7 }, { "x": 2.32012539450432, "pdf": 0.120666719596688, "logpdf": -2.11472291717798, "cdf": 0.8 }, { "x": 3.60222447927916, "pdf": 0.0487194323790742, "logpdf": -3.02167730632418, "cdf": 0.9 } ], @@ -3547,7 +3520,7 @@ "entropy": 2.11208571376462 }, "points": [ - { "x": 0.0770652255151965, "pdf": 1.1386350377829, "logpdf": 0.129830209749675, "cdf": 0.1 }, + { "x": 0.0770652255151966, "pdf": 1.1386350377829, "logpdf": 0.129830209749675, "cdf": 0.1 }, { "x": 0.185770643217291, "pdf": 0.753514967594595, "logpdf": -0.283006397019187, "cdf": 0.2 }, { "x": 0.350357567203613, "pdf": 0.496196809698148, "logpdf": -0.700782637212765, "cdf": 0.3 }, { "x": 0.602483978138834, "pdf": 0.320624736520241, "logpdf": -1.13748388482667, "cdf": 0.4 }, @@ -3555,10 +3528,10 @@ { "x": 1.65979517511678, "pdf": 0.116382593252712, "logpdf": -2.15087229736987, "cdf": 0.6 }, { "x": 2.85422692017622, "pdf": 0.060908369222901, "logpdf": -2.79838468804493, "cdf": 0.7 }, { "x": 5.38298184622382, "pdf": 0.0260043530152533, "logpdf": -3.64949133131084, "cdf": 0.8 }, - { "x": 12.976021199118, "pdf": 0.00676240926395895, "logpdf": -4.99637605242873, "cdf": 0.9 } + { "x": 12.976021199118, "pdf": 0.00676240926395896, "logpdf": -4.99637605242873, "cdf": 0.9 } ], "quans": [ - { "q": 0.10, "x": 0.0770652255151965 }, + { "q": 0.10, "x": 0.0770652255151966 }, { "q": 0.25, "x": 0.259504950265071 }, { "q": 0.50, "x": 1 }, { "q": 0.75, "x": 3.85349103737154 }, @@ -3591,7 +3564,7 @@ { "x": 4.51179106348394, "pdf": 0.042814763367891, "logpdf": -3.15087229736987, "cdf": 0.6 }, { "x": 7.75859317141365, "pdf": 0.0224069368323847, "logpdf": -3.79838468804493, "cdf": 0.7 }, { "x": 14.6324617355151, "pdf": 0.0095664668552763, "logpdf": -4.64949133131084, "cdf": 0.8 }, - { "x": 35.2724826312618, "pdf": 0.0024877513409978, "logpdf": -5.99637605242873, "cdf": 0.9 } + { "x": 35.2724826312618, "pdf": 0.00248775134099781, "logpdf": -5.99637605242873, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.209485002124057 }, @@ -3691,13 +3664,13 @@ "entropy": 5.11208571376462 }, "points": [ - { "x": 1.54789643257926, "pdf": 0.0566893004721425, "logpdf": -2.87016979025032, "cdf": 0.1 }, + { "x": 1.54789643257926, "pdf": 0.0566893004721425, "logpdf": -2.87016979025033, "cdf": 0.1 }, { "x": 3.73130311358522, "pdf": 0.0375153012078409, "logpdf": -3.28300639701919, "cdf": 0.2 }, { "x": 7.03711985238637, "pdf": 0.0247041844883576, "logpdf": -3.70078263721276, "cdf": 0.3 }, { "x": 12.1012141885365, "pdf": 0.0159629656775616, "logpdf": -4.13748388482667, "cdf": 0.4 }, { "x": 20.0855369231877, "pdf": 0.00993108329458884, "logpdf": -4.61208571376462, "cdf": 0.5 }, { "x": 33.3378772747368, "pdf": 0.00579434812710208, "logpdf": -5.15087229736987, "cdf": 0.6 }, - { "x": 57.3286801923558, "pdf": 0.00303244914267567, "logpdf": -5.79838468804493, "cdf": 0.7 }, + { "x": 57.3286801923557, "pdf": 0.00303244914267567, "logpdf": -5.79838468804493, "cdf": 0.7 }, { "x": 108.120080629177, "pdf": 0.00129468050143249, "logpdf": -6.64949133131084, "cdf": 0.8 }, { "x": 260.630352910951, "pdf": 0.000336680532356201, "logpdf": -7.99637605242873, "cdf": 0.9 } ], @@ -3718,7 +3691,7 @@ }, "points": [ { "x": 0.195800105659092, "pdf": 0.944774545697881, "logpdf": -0.0568089559332488, "cdf": 0.1 }, - { "x": 0.287140725416741, "pdf": 1.22814557534333, "logpdf": 0.20550536939537, "cdf": 0.2 }, + { "x": 0.28714072541674, "pdf": 1.22814557534333, "logpdf": 0.20550536939537, "cdf": 0.2 }, { "x": 0.363257491090568, "pdf": 1.38780891754292, "logpdf": 0.327726185131295, "cdf": 0.3 }, { "x": 0.432931077147732, "pdf": 1.47301055752462, "logpdf": 0.387308304817075, "cdf": 0.4 }, { "x": 0.5, "pdf": 1.5, "logpdf": 0.405465108108164, "cdf": 0.5 }, @@ -3749,9 +3722,9 @@ { "x": 0.368628966462477, "pdf": 2.12650943038401, "logpdf": 0.754481870399112, "cdf": 0.4 }, { "x": 0.414847473500024, "pdf": 2.18251243306587, "logpdf": 0.780476705423697, "cdf": 0.5 }, { "x": 0.46105701138432, "pdf": 2.12692575883792, "logpdf": 0.754677631442467, "cdf": 0.6 }, - { "x": 0.509871068674536, "pdf": 1.95142066715322, "logpdf": 0.66855765457199, "cdf": 0.700000000000001 }, + { "x": 0.509871068674536, "pdf": 1.95142066715322, "logpdf": 0.668557654571991, "cdf": 0.700000000000001 }, { "x": 0.56541078033985, "pdf": 1.63175006246741, "logpdf": 0.489653096815652, "cdf": 0.8 }, - { "x": 0.638212815185811, "pdf": 1.10522722144183, "logpdf": 0.100050944094808, "cdf": 0.9 } + { "x": 0.638212815185811, "pdf": 1.10522722144183, "logpdf": 0.100050944094809, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.193870119404858 }, @@ -3777,7 +3750,7 @@ { "x": 3.94643750167458, "pdf": 0.10709787289727, "logpdf": -2.23401216262884, "cdf": 0.600000000000008 }, { "x": 4.9946567337436, "pdf": 0.0842322588552878, "logpdf": -2.4741773093095, "cdf": 0.700000000000014 }, { "x": 6.40130242206003, "pdf": 0.0590456510866664, "logpdf": -2.82944438703285, "cdf": 0.799999999999995 }, - { "x": 8.67540582385963, "pdf": 0.0313508391245823, "logpdf": -3.46251424592705, "cdf": 0.899999999999996 } + { "x": 8.67540582385963, "pdf": 0.0313508391245824, "logpdf": -3.46251424592705, "cdf": 0.899999999999996 } ], "quans": [ { "q": 0.10, "x": 0.546766795340643 }, @@ -3795,14 +3768,14 @@ "properties": { }, "points": [ - { "x": 1.61595070739896, "pdf": 0.0786741022349444, "logpdf": -2.54244124715563, "cdf": 0.0999999999999991 }, - { "x": 2.77886250694842, "pdf": 0.0915012372242328, "logpdf": -2.39140278521576, "cdf": 0.199999999999997 }, + { "x": 1.61595070739896, "pdf": 0.0786741022349443, "logpdf": -2.54244124715563, "cdf": 0.0999999999999991 }, + { "x": 2.77886250694842, "pdf": 0.0915012372242327, "logpdf": -2.39140278521576, "cdf": 0.199999999999997 }, { "x": 3.84566512234196, "pdf": 0.0948095426743713, "logpdf": -2.35588521366509, "cdf": 0.299999999999995 }, { "x": 4.91053310560757, "pdf": 0.0921946767716494, "logpdf": -2.38385288575176, "cdf": 0.400000000000017 }, { "x": 6.03441301933412, "pdf": 0.0852056630192023, "logpdf": -2.46268737999419, "cdf": 0.499999999999981 }, { "x": 7.28309744000934, "pdf": 0.0746456739363692, "logpdf": -2.59500270796393, "cdf": 0.599999999999998 }, - { "x": 8.75775630334963, "pdf": 0.0609394869559841, "logpdf": -2.79787392429847, "cdf": 0.700000000000011 }, - { "x": 10.6662785912555, "pdf": 0.0442449828676327, "logpdf": -3.1180132954788, "cdf": 0.799999999999988 }, + { "x": 8.75775630334963, "pdf": 0.0609394869559842, "logpdf": -2.79787392429847, "cdf": 0.700000000000011 }, + { "x": 10.6662785912555, "pdf": 0.0442449828676327, "logpdf": -3.11801329547879, "cdf": 0.799999999999988 }, { "x": 13.6401872679707, "pdf": 0.0243990824652702, "logpdf": -3.71320975127239, "cdf": 0.899999999999995 } ], "quans": [ @@ -3826,16 +3799,16 @@ { "x": 0.985703490149552, "pdf": 0.229355047082203, "logpdf": -1.47248405215448, "cdf": 0.3 }, { "x": 1.48726998231228, "pdf": 0.172787050069873, "logpdf": -1.75569536714573, "cdf": 0.4 }, { "x": 2.17537879605034, "pdf": 0.121971765167082, "logpdf": -2.10396569409035, "cdf": 0.5 }, - { "x": 3.19393247639241, "pdf": 0.0789044688243703, "logpdf": -2.5395174136421, "cdf": 0.6 }, + { "x": 3.19393247639241, "pdf": 0.0789044688243704, "logpdf": -2.5395174136421, "cdf": 0.6 }, { "x": 4.87693809735564, "pdf": 0.0446903336156, "logpdf": -3.10799805095835, "cdf": 0.7 }, - { "x": 8.22485665053881, "pdf": 0.0199448462682582, "logpdf": -3.91478450143797, "cdf": 0.8 }, + { "x": 8.22485665053881, "pdf": 0.0199448462682582, "logpdf": -3.91478450143797, "cdf": 0.800000000000001 }, { "x": 18.2380180778327, "pdf": 0.00499686780462496, "logpdf": -5.29894400191798, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.279556526211129 }, { "q": 0.25, "x": 0.78055835039822 }, { "q": 0.50, "x": 2.17537879605034 }, - { "q": 0.75, "x": 6.21776022114888 }, + { "q": 0.75, "x": 6.21776022114892 }, { "q": 0.90, "x": 18.2380180778327 } ] }, @@ -3847,18 +3820,18 @@ "properties": { }, "points": [ - { "x": 0.676226178346596, "pdf": 0.363284023168657, "logpdf": -1.01257031768688, "cdf": 0.0999999999999999 }, - { "x": 0.920225441946682, "pdf": 0.442310863348146, "logpdf": -0.815742333369127, "cdf": 0.2 }, - { "x": 1.14202400976415, "pdf": 0.451445989390235, "logpdf": -0.795299538108548, "cdf": 0.3 }, - { "x": 1.36952102404472, "pdf": 0.423230447459441, "logpdf": -0.859838455233391, "cdf": 0.399999999999999 }, + { "x": 0.676226178346595, "pdf": 0.363284023168657, "logpdf": -1.01257031768688, "cdf": 0.1 }, + { "x": 0.920225441946681, "pdf": 0.442310863348145, "logpdf": -0.815742333369127, "cdf": 0.2 }, + { "x": 1.14202400976414, "pdf": 0.451445989390234, "logpdf": -0.795299538108549, "cdf": 0.3 }, + { "x": 1.36952102404472, "pdf": 0.423230447459442, "logpdf": -0.85983845523339, "cdf": 0.399999999999999 }, { "x": 1.62045444179597, "pdf": 0.371834517843844, "logpdf": -0.989306368187457, "cdf": 0.5 }, - { "x": 1.91587032582728, "pdf": 0.305365880028165, "logpdf": -1.18624461467814, "cdf": 0.6 }, - { "x": 2.29158399283585, "pdf": 0.229392154602269, "logpdf": -1.47232227451306, "cdf": 0.7 }, + { "x": 1.91587032582728, "pdf": 0.305365880028165, "logpdf": -1.18624461467814, "cdf": 0.600000000000001 }, + { "x": 2.29158399283584, "pdf": 0.22939215460227, "logpdf": -1.47232227451306, "cdf": 0.699999999999999 }, { "x": 2.82848922745051, "pdf": 0.148532255393536, "logpdf": -1.90695313628835, "cdf": 0.8 }, - { "x": 3.8021507049777, "pdf": 0.0679064336065869, "logpdf": -2.68962449770452, "cdf": 0.9 } + { "x": 3.8021507049777, "pdf": 0.0679064336065868, "logpdf": -2.68962449770453, "cdf": 0.9 } ], "quans": [ - { "q": 0.10, "x": 0.676226178346596 }, + { "q": 0.10, "x": 0.676226178346595 }, { "q": 0.25, "x": 1.03165301851391 }, { "q": 0.50, "x": 1.62045444179597 }, { "q": 0.75, "x": 2.53107457272549 }, @@ -3881,7 +3854,7 @@ { "x": 2.82714606612362, "pdf": 0.177727266169747, "logpdf": -1.7275051162576, "cdf": 0.599999999999995 }, { "x": 3.49437161043539, "pdf": 0.12476612376153, "logpdf": -2.08131430411297, "cdf": 0.700000000000003 }, { "x": 4.53691036664227, "pdf": 0.0724058364392939, "logpdf": -2.62546836903718, "cdf": 0.800000000000006 }, - { "x": 6.75266844907998, "pdf": 0.0270194247813273, "logpdf": -3.61119923530262, "cdf": 0.900000000000001 } + { "x": 6.75266844907998, "pdf": 0.0270194247813272, "logpdf": -3.61119923530263, "cdf": 0.900000000000001 } ], "quans": [ { "q": 0.10, "x": 0.728144257934645 }, @@ -3903,11 +3876,11 @@ { "x": 1.1600210174982, "pdf": 0.276618231869001, "logpdf": -1.28511694771909, "cdf": 0.200000000000001 }, { "x": 1.48567598152903, "pdf": 0.33316721668675, "logpdf": -1.09911076282546, "cdf": 0.299999999999986 }, { "x": 1.77359136138836, "pdf": 0.356813362871894, "logpdf": -1.03054242698237, "cdf": 0.399999999999984 }, - { "x": 2.05369115111952, "pdf": 0.352964232008489, "logpdf": -1.04138855293763, "cdf": 0.500000000000021 }, - { "x": 2.34725731128643, "pdf": 0.324863660093204, "logpdf": -1.12434969207577, "cdf": 0.599999999999982 }, + { "x": 2.05369115111952, "pdf": 0.352964232008488, "logpdf": -1.04138855293763, "cdf": 0.500000000000021 }, + { "x": 2.34725731128643, "pdf": 0.324863660093206, "logpdf": -1.12434969207577, "cdf": 0.599999999999982 }, { "x": 2.67972324525383, "pdf": 0.274536721214713, "logpdf": -1.29267025206263, "cdf": 0.700000000000018 }, { "x": 3.09851805508524, "pdf": 0.20316299881645, "logpdf": -1.59374667229738, "cdf": 0.800000000000011 }, - { "x": 3.74663357026378, "pdf": 0.111205123560073, "logpdf": -2.19637882304657, "cdf": 0.899999999999989 } + { "x": 3.74663357026378, "pdf": 0.111205123560073, "logpdf": -2.19637882304658, "cdf": 0.899999999999989 } ], "quans": [ { "q": 0.10, "x": 0.720022992312494 }, @@ -4006,14 +3979,14 @@ { "x": -2.4933057937284, "pdf": 0.19317126674843, "logpdf": -1.64417809109827, "cdf": 0.6 }, { "x": -1.95119897458392, "pdf": 0.173846307100037, "logpdf": -1.74958366262885, "cdf": 0.7 }, { "x": -1.31675753285417, "pdf": 0.139980960203904, "logpdf": -1.96624886416502, "cdf": 0.8 }, - { "x": -0.436896868910798, "pdf": 0.0877491659662434, "logpdf": -2.43327292133953, "cdf": 0.9 } + { "x": -0.436896868910799, "pdf": 0.0877491659662434, "logpdf": -2.43327292133953, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": -5.5631031310892 }, { "q": 0.25, "x": -4.34897950039216 }, { "q": 0.50, "x": -3 }, { "q": 0.75, "x": -1.65102049960784 }, - { "q": 0.90, "x": -0.436896868910798 } + { "q": 0.90, "x": -0.436896868910799 } ] }, { @@ -4065,11 +4038,11 @@ { "x": 2.35190850897177, "pdf": 0.233203530145277, "logpdf": -1.45584368677614, "cdf": 0.199999783309633 }, { "x": 2.74680416245533, "pdf": 0.268576649925171, "logpdf": -1.31461893119169, "cdf": 0.300000275527422 }, { "x": 3.11163681442573, "pdf": 0.275629500469336, "logpdf": -1.28869770468091, "cdf": 0.400000377712696 }, - { "x": 3.4819646258047, "pdf": 0.261462866302658, "logpdf": -1.34146300822719, "cdf": 0.499999964932221 }, + { "x": 3.4819646258047, "pdf": 0.261462866302657, "logpdf": -1.34146300822719, "cdf": 0.499999964932221 }, { "x": 3.88683500198609, "pdf": 0.230732098109458, "logpdf": -1.46649798993289, "cdf": 0.600003161322329 }, { "x": 4.36535877158736, "pdf": 0.186792594573179, "logpdf": -1.67775639758575, "cdf": 0.700000515839226 }, { "x": 4.99538878616374, "pdf": 0.132222863415873, "logpdf": -2.0232664208608, "cdf": 0.800003368148728 }, - { "x": 6.01645845503095, "pdf": 0.0691756972306329, "logpdf": -2.67110567413142, "cdf": 0.899999998289034 } + { "x": 6.01645845503095, "pdf": 0.0691756972306328, "logpdf": -2.67110567413142, "cdf": 0.899999998289034 } ], "quans": [ { "q": 0.10, "x": 1.8435240366951 }, @@ -4081,7 +4054,7 @@ }, { "expr": "NormalCanon()", - "dtype": "Normal", + "dtype": "NormalCanon", "minimum": "-inf", "maximum": "inf", "properties": { @@ -4114,7 +4087,7 @@ }, { "expr": "NormalCanon(0.0, 1.0)", - "dtype": "Normal", + "dtype": "NormalCanon", "minimum": "-inf", "maximum": "inf", "properties": { @@ -4147,7 +4120,7 @@ }, { "expr": "NormalCanon(-1.0, 2.5)", - "dtype": "Normal", + "dtype": "NormalCanon", "minimum": "-inf", "maximum": "inf", "properties": { @@ -4160,13 +4133,13 @@ "entropy": 0.960793167267595 }, "points": [ - { "x": -1.2105243772151, "pdf": 0.277487227233459, "logpdf": -1.2819803748425, "cdf": 0.0999999999999999 }, + { "x": -1.2105243772151, "pdf": 0.277487227233459, "logpdf": -1.2819803748425, "cdf": 0.1 }, { "x": -0.932288005050196, "pdf": 0.442658663301725, "logpdf": -0.814956317667992, "cdf": 0.2 }, { "x": -0.731660005263496, "pdf": 0.549750293245218, "logpdf": -0.598291116131823, "cdf": 0.3 }, { "x": -0.560230776902943, "pdf": 0.610861181424988, "logpdf": -0.492885544601246, "cdf": 0.4 }, { "x": -0.4, "pdf": 0.63078313050504, "logpdf": -0.460793167267595, "cdf": 0.5 }, { "x": -0.239769223097057, "pdf": 0.610861181424988, "logpdf": -0.492885544601246, "cdf": 0.6 }, - { "x": -0.0683399947365035, "pdf": 0.549750293245218, "logpdf": -0.598291116131823, "cdf": 0.7 }, + { "x": -0.0683399947365036, "pdf": 0.549750293245218, "logpdf": -0.598291116131823, "cdf": 0.7 }, { "x": 0.132288005050196, "pdf": 0.442658663301725, "logpdf": -0.814956317667992, "cdf": 0.8 }, { "x": 0.410524377215101, "pdf": 0.277487227233459, "logpdf": -1.2819803748425, "cdf": 0.9 } ], @@ -4180,7 +4153,7 @@ }, { "expr": "NormalCanon(2.0, 0.8)", - "dtype": "Normal", + "dtype": "NormalCanon", "minimum": "-inf", "maximum": "inf", "properties": { @@ -4266,8 +4239,8 @@ { "x": 1.05409255338946, "pdf": 1.70762993649092, "logpdf": 0.535106407073206, "cdf": 0.1 }, { "x": 1.11803398874989, "pdf": 1.43108350559987, "logpdf": 0.358431853588631, "cdf": 0.2 }, { "x": 1.19522860933439, "pdf": 1.17132403714771, "logpdf": 0.158134764651847, "cdf": 0.3 }, - { "x": 1.29099444873581, "pdf": 0.92951600308978, "logpdf": -0.0730912550890407, "cdf": 0.4 }, - { "x": 1.41421356237309, "pdf": 0.707106781186548, "logpdf": -0.346573590279972, "cdf": 0.5 }, + { "x": 1.29099444873581, "pdf": 0.92951600308978, "logpdf": -0.0730912550890406, "cdf": 0.4 }, + { "x": 1.4142135623731, "pdf": 0.707106781186548, "logpdf": -0.346573590279972, "cdf": 0.5 }, { "x": 1.58113883008419, "pdf": 0.505964425626941, "logpdf": -0.681288917251287, "cdf": 0.6 }, { "x": 1.82574185835055, "pdf": 0.3286335345031, "logpdf": -1.11281202592896, "cdf": 0.7 }, { "x": 2.23606797749979, "pdf": 0.178885438199983, "logpdf": -1.72100968809121, "cdf": 0.8 }, @@ -4299,7 +4272,7 @@ }, "points": [ { "x": 1.58113883008419, "pdf": 1.13841995766062, "logpdf": 0.129641298965041, "cdf": 0.1 }, - { "x": 1.67705098312484, "pdf": 0.95405567039991, "logpdf": -0.0470332545195338, "cdf": 0.2 }, + { "x": 1.67705098312484, "pdf": 0.95405567039991, "logpdf": -0.0470332545195339, "cdf": 0.2 }, { "x": 1.79284291400159, "pdf": 0.780882691431804, "logpdf": -0.247330343456318, "cdf": 0.3 }, { "x": 1.93649167310371, "pdf": 0.619677335393187, "logpdf": -0.478556363197205, "cdf": 0.4 }, { "x": 2.12132034355964, "pdf": 0.471404520791032, "logpdf": -0.752038698388137, "cdf": 0.5 }, @@ -4335,10 +4308,10 @@ "points": [ { "x": 2.07148833730257, "pdf": 1.3034106692176, "logpdf": 0.264984420564396, "cdf": 0.0999999999999998 }, { "x": 2.15443469003188, "pdf": 1.11398132006707, "logpdf": 0.107940373022552, "cdf": 0.2 }, - { "x": 2.25249576088721, "pdf": 0.93229920182973, "logpdf": -0.0701014838101464, "cdf": 0.3 }, + { "x": 2.25249576088721, "pdf": 0.93229920182973, "logpdf": -0.0701014838101459, "cdf": 0.3 }, { "x": 2.37126220299338, "pdf": 0.759089398771574, "logpdf": -0.275635723579823, "cdf": 0.4 }, { "x": 2.51984209978975, "pdf": 0.595275394488075, "logpdf": -0.518731132638429, "cdf": 0.5 }, - { "x": 2.71441761659491, "pdf": 0.442083779836846, "logpdf": -0.816255867724043, "cdf": 0.6 }, + { "x": 2.71441761659491, "pdf": 0.442083779836846, "logpdf": -0.816255867724042, "cdf": 0.6 }, { "x": 2.98760316437144, "pdf": 0.301244827536976, "logpdf": -1.19983196432642, "cdf": 0.7 }, { "x": 3.41995189335339, "pdf": 0.175441064292772, "logpdf": -1.74045210847064, "cdf": 0.8 }, { "x": 4.30886938006377, "pdf": 0.0696238325041917, "logpdf": -2.66464834921723, "cdf": 0.9 } @@ -4441,7 +4414,7 @@ "kurtosis": 0.76195423693023 }, "points": [ - { "x": 0.872206385795335, "pdf": 0.0924266554239228, "logpdf": -2.38133986332257, "cdf": 0.1 }, + { "x": 0.872206385795336, "pdf": 0.0924266554239229, "logpdf": -2.38133986332257, "cdf": 0.100000000000001 }, { "x": 1.67223102018988, "pdf": 0.161232689191114, "logpdf": -1.82490668292265, "cdf": 0.2 }, { "x": 2.20370021746836, "pdf": 0.215410750762552, "logpdf": -1.53520860481569, "cdf": 0.3 }, { "x": 2.6271970087856, "pdf": 0.255519396518254, "logpdf": -1.36445695629713, "cdf": 0.4 }, @@ -4452,7 +4425,7 @@ { "x": 5.12779361420466, "pdf": 0.0924266554239229, "logpdf": -2.38133986332257, "cdf": 0.9 } ], "quans": [ - { "q": 0.10, "x": 0.872206385795335 }, + { "q": 0.10, "x": 0.872206385795336 }, { "q": 0.25, "x": 1.95708306892598 }, { "q": 0.50, "x": 3 }, { "q": 0.75, "x": 4.04291693107402 }, @@ -4475,14 +4448,13 @@ "entropy": 0.94203424217079 }, "points": [ - { "x": -0.1, "pdf": 0.0, "logpdf": "-inf", "cdf": 0.0 }, { "x": 0.459043605026421, "pdf": 0.413139244523779, "logpdf": -0.883970589034076, "cdf": 0.1 }, { "x": 0.668047230836577, "pdf": 0.534437784669262, "logpdf": -0.626539954413995, "cdf": 0.2 }, { "x": 0.844600430900592, "pdf": 0.591220301630414, "logpdf": -0.525566570238121, "cdf": 0.3 }, { "x": 1.01076765259479, "pdf": 0.606460591556874, "logpdf": -0.500115529532079, "cdf": 0.4 }, { "x": 1.17741002251547, "pdf": 0.588705011257737, "logpdf": -0.529830050570805, "cdf": 0.5 }, { "x": 1.35372872605567, "pdf": 0.541491490422269, "logpdf": -0.61342792748956, "cdf": 0.6 }, - { "x": 1.55175565365552, "pdf": 0.465526696096656, "logpdf": -0.76458583461478, "cdf": 0.7 }, + { "x": 1.55175565365552, "pdf": 0.465526696096656, "logpdf": -0.764585834614781, "cdf": 0.7 }, { "x": 1.7941225779941, "pdf": 0.35882451559882, "logpdf": -1.02492182449057, "cdf": 0.8 }, { "x": 2.14596602628935, "pdf": 0.214596602628935, "logpdf": -1.5389952800901, "cdf": 0.9 } ], @@ -4510,16 +4482,15 @@ "entropy": 2.0406465308389 }, "points": [ - { "x": -0.1, "pdf": 0.0, "logpdf": "-inf", "cdf": 0.0 }, { "x": 1.37713081507926, "pdf": 0.137713081507926, "logpdf": -1.98258287770219, "cdf": 0.1 }, { "x": 2.00414169250973, "pdf": 0.178145928223087, "logpdf": -1.7251522430821, "cdf": 0.2 }, { "x": 2.53380129270177, "pdf": 0.197073433876805, "logpdf": -1.62417885890623, "cdf": 0.3 }, { "x": 3.03230295778437, "pdf": 0.202153530518958, "logpdf": -1.59872781820019, "cdf": 0.4 }, { "x": 3.53223006754642, "pdf": 0.196235003752579, "logpdf": -1.62844233923891, "cdf": 0.5 }, - { "x": 4.06118617816701, "pdf": 0.180497163474089, "logpdf": -1.71204021615767, "cdf": 0.6 }, + { "x": 4.06118617816701, "pdf": 0.18049716347409, "logpdf": -1.71204021615767, "cdf": 0.6 }, { "x": 4.65526696096656, "pdf": 0.155175565365552, "logpdf": -1.86319812328289, "cdf": 0.7 }, { "x": 5.3823677339823, "pdf": 0.119608171866273, "logpdf": -2.12353411315868, "cdf": 0.8 }, - { "x": 6.43789807886804, "pdf": 0.0715322008763115, "logpdf": -2.63760756875821, "cdf": 0.9 } + { "x": 6.43789807886804, "pdf": 0.0715322008763116, "logpdf": -2.63760756875821, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 1.37713081507926 }, @@ -4545,9 +4516,8 @@ "entropy": 3.02147578385063 }, "points": [ - { "x": -0.1, "pdf": 0.0, "logpdf": "-inf", "cdf": 0.0 }, { "x": 3.67234884021137, "pdf": 0.0516424055654723, "logpdf": -2.96341213071391, "cdf": 0.1 }, - { "x": 5.34437784669262, "pdf": 0.0668047230836577, "logpdf": -2.70598149609383, "cdf": 0.2 }, + { "x": 5.34437784669262, "pdf": 0.0668047230836578, "logpdf": -2.70598149609383, "cdf": 0.2 }, { "x": 6.75680344720473, "pdf": 0.0739025377038018, "logpdf": -2.60500811191796, "cdf": 0.3 }, { "x": 8.08614122075832, "pdf": 0.0758075739446092, "logpdf": -2.57955707121191, "cdf": 0.4 }, { "x": 9.4192801801238, "pdf": 0.0735881264072172, "logpdf": -2.60927159225064, "cdf": 0.5 }, @@ -4581,8 +4551,8 @@ { "x": 1.47547909178815, "pdf": 0.489049243270422, "logpdf": -0.715292092592867, "cdf": 0.500000000000012 }, { "x": 1.6862862997492, "pdf": 0.455970051392373, "logpdf": -0.785328148395677, "cdf": 0.599999999999999 }, { "x": 1.91973949265777, "pdf": 0.397730897577084, "logpdf": -0.921979639122226, "cdf": 0.700000000000003 }, - { "x": 2.2010753309479, "pdf": 0.311617302264047, "logpdf": -1.16597943936394, "cdf": 0.800000000000009 }, - { "x": 2.6019473978067, "pdf": 0.190248024171792, "logpdf": -1.65942666772506, "cdf": 0.900000000000001 } + { "x": 2.2010753309479, "pdf": 0.311617302264047, "logpdf": -1.16597943936394, "cdf": 0.800000000000008 }, + { "x": 2.6019473978067, "pdf": 0.190248024171792, "logpdf": -1.65942666772506, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 0.58680768479231 }, @@ -4602,14 +4572,14 @@ "shape": 12.5 }, "points": [ - { "x": 3.83337182711774, "pdf": 0.178067275660391, "logpdf": -1.72559384694809, "cdf": 0.1 }, + { "x": 3.83337182711774, "pdf": 0.17806727566039, "logpdf": -1.72559384694809, "cdf": 0.1 }, { "x": 4.26739311906375, "pdf": 0.283509558779568, "logpdf": -1.26050943934722, "cdf": 0.199999999999999 }, - { "x": 4.5808282949603, "pdf": 0.351696201209667, "logpdf": -1.04498754078411, "cdf": 0.299999999999981 }, - { "x": 4.84891183432576, "pdf": 0.390461020883228, "logpdf": -0.940427133165443, "cdf": 0.400000000000014 }, - { "x": 5.0996760375676, "pdf": 0.402913231155499, "logpdf": -0.909034047523853, "cdf": 0.499999999999981 }, - { "x": 5.35060611077152, "pdf": 0.389944217738904, "logpdf": -0.941751581527125, "cdf": 0.599999999999959 }, - { "x": 5.61923787901142, "pdf": 0.350723907317018, "logpdf": -1.04775595388, "cdf": 0.699999999999992 }, - { "x": 5.93381683616078, "pdf": 0.282226926437332, "logpdf": -1.26504382796596, "cdf": 0.799999999999998 }, + { "x": 4.5808282949603, "pdf": 0.351696201209667, "logpdf": -1.04498754078411, "cdf": 0.29999999999998 }, + { "x": 4.84891183432576, "pdf": 0.390461020883229, "logpdf": -0.940427133165439, "cdf": 0.400000000000014 }, + { "x": 5.0996760375676, "pdf": 0.402913231155501, "logpdf": -0.90903404752385, "cdf": 0.499999999999982 }, + { "x": 5.35060611077152, "pdf": 0.389944217738905, "logpdf": -0.941751581527122, "cdf": 0.59999999999996 }, + { "x": 5.61923787901142, "pdf": 0.350723907317018, "logpdf": -1.04775595388, "cdf": 0.699999999999993 }, + { "x": 5.93381683616078, "pdf": 0.282226926437332, "logpdf": -1.26504382796596, "cdf": 0.799999999999999 }, { "x": 6.37038420267928, "pdf": 0.17678589781236, "logpdf": -1.73281589546462, "cdf": 0.899999999999982 } ], "quans": [ @@ -4630,15 +4600,15 @@ "shape": 50 }, "points": [ - { "x": 8.77189934889994, "pdf": 0.17602367421233, "logpdf": -1.73713678041993, "cdf": 0.0999999999999889 }, - { "x": 9.21055856310058, "pdf": 0.280747347661651, "logpdf": -1.27030013273982, "cdf": 0.200000000000031 }, - { "x": 9.52691154521682, "pdf": 0.348625118414454, "logpdf": -1.05375809337315, "cdf": 0.299999999999978 }, - { "x": 9.79725334900319, "pdf": 0.387340667844654, "logpdf": -0.948450694502043, "cdf": 0.40000000000009 }, - { "x": 10.0499586252229, "pdf": 0.399938412039171, "logpdf": -0.91644471363081, "cdf": 0.500000000000001 }, + { "x": 8.77189934889994, "pdf": 0.17602367421233, "logpdf": -1.73713678041993, "cdf": 0.0999999999999888 }, + { "x": 9.21055856310058, "pdf": 0.280747347661655, "logpdf": -1.27030013273981, "cdf": 0.20000000000003 }, + { "x": 9.52691154521682, "pdf": 0.348625118414454, "logpdf": -1.05375809337315, "cdf": 0.299999999999977 }, + { "x": 9.79725334900319, "pdf": 0.387340667844654, "logpdf": -0.948450694502043, "cdf": 0.400000000000091 }, + { "x": 10.0499586252229, "pdf": 0.399938412039171, "logpdf": -0.91644471363081, "cdf": 0.500000000000002 }, { "x": 10.3026851248306, "pdf": 0.387275589795634, "logpdf": -0.948618721053336, "cdf": 0.599999999999961 }, { "x": 10.5730967493158, "pdf": 0.348503584620269, "logpdf": -1.05410676298003, "cdf": 0.700000000000032 }, { "x": 10.8895938007392, "pdf": 0.280589475189091, "logpdf": -1.27086262025283, "cdf": 0.799999999999942 }, - { "x": 11.3285661035151, "pdf": 0.175871273888067, "logpdf": -1.73800294990951, "cdf": 0.900000000000024 } + { "x": 11.3285661035151, "pdf": 0.175871273888064, "logpdf": -1.73800294990953, "cdf": 0.90000000000003 } ], "quans": [ { "q": 0.10, "x": 8.77189934889994 }, @@ -4653,25 +4623,25 @@ "dtype": "StudentizedRange", "minimum": 0, "maximum": "inf", - "properties": { }, + "properties": { + }, "points": [ - { "x": 0.0, "pdf": 0.5000000000000004, "logpdf": -0.6931471805599444, "cdf": 0.0 }, - { "x": 0.20100224988048365, "pdf": 0.4925191719208159, "logpdf": -0.7082218913696572, "cdf": 0.09999999520103714 }, - { "x": 0.4082370100074992, "pdf": 0.4703035900074208, "logpdf": -0.7543768566190174, "cdf": 0.2000000000048061 }, - { "x": 0.6289520699025762, "pdf": 0.43404584546549957, "logpdf": -0.8346051157475529, "cdf": 0.300000000020783 }, - { "x": 0.8728421115162694, "pdf": 0.38494259221026045, "logpdf": -0.9546610669547051, "cdf": 0.40000000842384564 }, - { "x": 1.1546543213445166, "pdf": 0.324769275374005, "logpdf": -1.1246402706924363, "cdf": 0.4999999999699054 }, - { "x": 1.4999238201448957, "pdf": 0.2560140417563777, "logpdf": -1.362522985395964, "cdf": 0.5999999997041576 }, - { "x": 1.9602521087686784, "pdf": 0.18212554447925455, "logpdf": -1.7030590248802717, "cdf": 0.6999999997682319 }, - { "x": 2.666345409145909, "pdf": 0.10802498429568883, "logpdf": -2.2253927425407873, "cdf": 0.8000000103371314 }, - { "x": 4.128182667712375, "pdf": 0.04144124614618361, "logpdf": -3.1834786103878714, "cdf": 0.8999999982629001 } + { "x": 0.201002249880484, "pdf": 0.492532167250121, "logpdf": -0.708195505973292, "cdf": 0.0999999952010371 }, + { "x": 0.408237010007499, "pdf": 0.470316586550376, "logpdf": -0.754349222556142, "cdf": 0.200000000004806 }, + { "x": 0.628952069902577, "pdf": 0.434058844224106, "logpdf": -0.834575168254664, "cdf": 0.300000000020783 }, + { "x": 0.872842111516269, "pdf": 0.384955594506707, "logpdf": -0.954627290262469, "cdf": 0.400000008423846 }, + { "x": 1.15465432134452, "pdf": 0.324782283182991, "logpdf": -1.12460021902237, "cdf": 0.499999999969905 }, + { "x": 1.4999238201449, "pdf": 0.256027058446819, "logpdf": -1.36247214301486, "cdf": 0.599999999704158 }, + { "x": 1.96025210876868, "pdf": 0.182138576599837, "logpdf": -1.7029874717405, "cdf": 0.699999999768232 }, + { "x": 2.66634540914591, "pdf": 0.1080380482147, "logpdf": -2.225271815626, "cdf": 0.800000010337131 }, + { "x": 4.12818266771238, "pdf": 0.0414544080020556, "logpdf": -3.18316105802878, "cdf": 0.8999999982629 } ], "quans": [ - { "q": 0.10, "x": 0.20100224988048365 }, - { "q": 0.25, "x": 0.5163829936644125 }, - { "q": 0.50, "x": 1.1546543213445166 }, - { "q": 0.75, "x": 2.267582936012756 }, - { "q": 0.90, "x": 4.128182667712375 } + { "q": 0.10, "x": 0.201002249880484 }, + { "q": 0.25, "x": 0.516382993664413 }, + { "q": 0.50, "x": 1.15465432134452 }, + { "q": 0.75, "x": 2.26758293601276 }, + { "q": 0.90, "x": 4.12818266771238 } ] }, { @@ -4679,24 +4649,24 @@ "dtype": "StudentizedRange", "minimum": 0, "maximum": "inf", - "properties": { }, + "properties": { + }, "points": [ - { "x": 0.0, "pdf": 0.0, "logpdf": "-inf", "cdf": 0.0 }, - { "x": 1.918640114616004, "pdf": 0.22449646640186174, "logpdf": -1.4938953117817777, "cdf": 0.09999999828380725 }, - { "x": 2.2951520489729482, "pdf": 0.29897049969185024, "logpdf": -1.207410373696947, "cdf": 0.19999999965013568 }, - { "x": 2.613597114339812, "pdf": 0.32318275500942223, "logpdf": -1.1295373107840359, "cdf": 0.2999999996818188 }, - { "x": 2.9240799675362346, "pdf": 0.31685123359472334, "logpdf": -1.1493229099119264, "cdf": 0.4000000039024921 }, - { "x": 3.252642573844199, "pdf": 0.2892840928158184, "logpdf": -1.240346053593641, "cdf": 0.5000000005795643 }, - { "x": 3.625458243991159, "pdf": 0.24610712829913106, "logpdf": -1.401988356953281, "cdf": 0.5999999782972751 }, - { "x": 4.083350406150488, "pdf": 0.19133910117668898, "logpdf": -1.6537080262622827, "cdf": 0.6999999999595075 }, - { "x": 4.714986019558959, "pdf": 0.1284098925431489, "logpdf": -2.052527845965495, "cdf": 0.799999999646387 }, - { "x": 5.81590304535329, "pdf": 0.061221679192982346, "logpdf": -2.7932539170108748, "cdf": 0.8999999979593181 } + { "x": 1.918640114616, "pdf": 0.224496466485447, "logpdf": -1.49389531139856, "cdf": 0.0999999982838072 }, + { "x": 2.29515204897295, "pdf": 0.298970499597904, "logpdf": -1.20741037399742, "cdf": 0.199999999650136 }, + { "x": 2.61359711433981, "pdf": 0.323182754483207, "logpdf": -1.12953731240634, "cdf": 0.299999999681819 }, + { "x": 2.92407996753624, "pdf": 0.316851232986386, "logpdf": -1.14932291181993, "cdf": 0.400000003902492 }, + { "x": 3.2526425738442, "pdf": 0.289284092096334, "logpdf": -1.24034605607828, "cdf": 0.500000000579564 }, + { "x": 3.62545824399116, "pdf": 0.246107127484871, "logpdf": -1.40198836026471, "cdf": 0.599999978297275 }, + { "x": 4.08335040615049, "pdf": 0.191339101290866, "logpdf": -1.65370802566591, "cdf": 0.699999999959507 }, + { "x": 4.71498601955896, "pdf": 0.128409892027461, "logpdf": -2.05252784998085, "cdf": 0.799999999646387 }, + { "x": 5.81590304535329, "pdf": 0.061221679375775, "logpdf": -2.79325391402404, "cdf": 0.899999997959318 } ], "quans": [ - { "q": 0.10, "x": 1.918640114616004 }, - { "q": 0.25, "x": 2.457412339727293 }, - { "q": 0.50, "x": 3.252642573844199 }, - { "q": 0.75, "x": 4.367900578206566 }, + { "q": 0.10, "x": 1.918640114616 }, + { "q": 0.25, "x": 2.45741233972729 }, + { "q": 0.50, "x": 3.2526425738442 }, + { "q": 0.75, "x": 4.36790057820657 }, { "q": 0.90, "x": 5.81590304535329 } ] }, @@ -4705,30 +4675,30 @@ "dtype": "StudentizedRange", "minimum": 0, "maximum": "inf", - "properties": { }, + "properties": { + }, "points": [ - { "x": 0.0, "pdf": 0.0, "logpdf": "-inf", "cdf": 0.0 }, - { "x": 1.2364260244843674, "pdf": 0.25406104801873935, "logpdf": -1.3701806943117307, "cdf": 0.10000000002113012 }, - { "x": 1.5641362798698113, "pdf": 0.34968736080200435, "logpdf": -1.0507157785399452, "cdf": 0.19999999998150475 }, - { "x": 1.831589452046152, "pdf": 0.3920732428742651, "logpdf": -0.9363066125778504, "cdf": 0.2999999998435957 }, - { "x": 2.0826651474432634, "pdf": 0.39955964503865, "logpdf": -0.9173922256991763, "cdf": 0.39999999999984676 }, - { "x": 2.3378341569158514, "pdf": 0.38041576292613605, "logpdf": -0.9664905114035547, "cdf": 0.5000000000005406 }, - { "x": 2.614732042699226, "pdf": 0.33927358054051543, "logpdf": -1.0809484748256346, "cdf": 0.600000000267473 }, - { "x": 2.9376743203735174, "pdf": 0.2789891288826032, "logpdf": -1.2765824624983935, "cdf": 0.7000000039124995 }, - { "x": 3.3552807052180915, "pdf": 0.20137223247416933, "logpdf": -1.6026001807244679, "cdf": 0.8000000209695605 }, - { "x": 4.018011272902007, "pdf": 0.10754841929865956, "logpdf": -2.2298141207389386, "cdf": 0.8999999999979073 } + { "x": 1.23642602448437, "pdf": 0.254061048012371, "logpdf": -1.37018069432034, "cdf": 0.10000000002113 }, + { "x": 1.56413627986981, "pdf": 0.349687360797267, "logpdf": -1.05071577853324, "cdf": 0.199999999981505 }, + { "x": 1.83158945204615, "pdf": 0.392073242866976, "logpdf": -0.936306612577683, "cdf": 0.299999999843596 }, + { "x": 2.08266514744326, "pdf": 0.399559645044781, "logpdf": -0.917392225663566, "cdf": 0.399999999999847 }, + { "x": 2.33783415691585, "pdf": 0.380415762923086, "logpdf": -0.966490511398442, "cdf": 0.500000000000541 }, + { "x": 2.61473204269923, "pdf": 0.339273580553172, "logpdf": -1.08094847479107, "cdf": 0.600000000267473 }, + { "x": 2.93767432037352, "pdf": 0.278989128903877, "logpdf": -1.27658246242042, "cdf": 0.7000000039125 }, + { "x": 3.3552807052181, "pdf": 0.201372232501741, "logpdf": -1.60260018058792, "cdf": 0.80000002096956 }, + { "x": 4.01801127290202, "pdf": 0.10754841932894, "logpdf": -2.22981412045225, "cdf": 0.899999999997907 } ], "quans": [ - { "q": 0.10, "x": 1.2364260244843674 }, - { "q": 0.25, "x": 1.701638249361135 }, - { "q": 0.50, "x": 2.3378341569158514 }, - { "q": 0.75, "x": 3.129577713370994 }, - { "q": 0.90, "x": 4.018011272902007 } + { "q": 0.10, "x": 1.23642602448437 }, + { "q": 0.25, "x": 1.70163824936114 }, + { "q": 0.50, "x": 2.33783415691585 }, + { "q": 0.75, "x": 3.129577713371 }, + { "q": 0.90, "x": 4.01801127290202 } ] }, { "expr": "SymTriangularDist()", - "dtype": "TriangularDist", + "dtype": "SymTriangularDist", "minimum": -1, "maximum": 1, "properties": { @@ -4761,7 +4731,7 @@ }, { "expr": "SymTriangularDist(3.0)", - "dtype": "TriangularDist", + "dtype": "SymTriangularDist", "minimum": 2, "maximum": 4, "properties": { @@ -4794,7 +4764,7 @@ }, { "expr": "SymTriangularDist(3.0, 0.5)", - "dtype": "TriangularDist", + "dtype": "SymTriangularDist", "minimum": 2.5, "maximum": 3.5, "properties": { @@ -4827,7 +4797,7 @@ }, { "expr": "SymTriangularDist(3.0, 2.0)", - "dtype": "TriangularDist", + "dtype": "SymTriangularDist", "minimum": 1, "maximum": 5, "properties": { @@ -4860,7 +4830,7 @@ }, { "expr": "SymTriangularDist(10.0, 8.0)", - "dtype": "TriangularDist", + "dtype": "SymTriangularDist", "minimum": 2, "maximum": 18, "properties": { @@ -4875,11 +4845,11 @@ "points": [ { "x": 5.57770876399966, "pdf": 0.0559016994374947, "logpdf": -2.88416049789689, "cdf": 0.1 }, { "x": 7.05964425626941, "pdf": 0.0790569415042095, "logpdf": -2.53758690761691, "cdf": 0.2 }, - { "x": 8.19677335393187, "pdf": 0.0968245836551854, "logpdf": -2.33485435356283, "cdf": 0.3 }, - { "x": 9.15541752799933, "pdf": 0.111803398874989, "logpdf": -2.19101331733694, "cdf": 0.4 }, + { "x": 8.19677335393187, "pdf": 0.0968245836551855, "logpdf": -2.33485435356283, "cdf": 0.3 }, + { "x": 9.15541752799933, "pdf": 0.11180339887499, "logpdf": -2.19101331733694, "cdf": 0.4 }, { "x": 10, "pdf": 0.125, "logpdf": -2.07944154167984, "cdf": 0.5 }, - { "x": 10.8445824720007, "pdf": 0.111803398874989, "logpdf": -2.19101331733694, "cdf": 0.6 }, - { "x": 11.8032266460681, "pdf": 0.0968245836551854, "logpdf": -2.33485435356283, "cdf": 0.7 }, + { "x": 10.8445824720007, "pdf": 0.11180339887499, "logpdf": -2.19101331733694, "cdf": 0.6 }, + { "x": 11.8032266460681, "pdf": 0.0968245836551855, "logpdf": -2.33485435356283, "cdf": 0.7 }, { "x": 12.9403557437306, "pdf": 0.0790569415042095, "logpdf": -2.53758690761691, "cdf": 0.8 }, { "x": 14.4222912360003, "pdf": 0.0559016994374947, "logpdf": -2.88416049789689, "cdf": 0.9 } ], @@ -4945,7 +4915,7 @@ { "x": -0.267180865704145, "pdf": 0.363801065870495, "logpdf": -1.01114808307697, "cdf": 0.4 }, { "x": 0, "pdf": 0.379606689822494, "logpdf": -0.968619589054724, "cdf": 0.5 }, { "x": 0.267180865704145, "pdf": 0.363801065870495, "logpdf": -1.01114808307697, "cdf": 0.6 }, - { "x": 0.559429644469361, "pdf": 0.316398093009324, "logpdf": -1.15075407025812, "cdf": 0.7 }, + { "x": 0.559429644469361, "pdf": 0.316398093009323, "logpdf": -1.15075407025812, "cdf": 0.7 }, { "x": 0.919543780240826, "pdf": 0.237555632724973, "logpdf": -1.43735343988555, "cdf": 0.8 }, { "x": 1.47588404882448, "pdf": 0.128289492004318, "logpdf": -2.0534659124737, "cdf": 0.9 } ], @@ -5013,7 +4983,7 @@ { "x": 2.76393202250021, "pdf": 0.357770876399966, "logpdf": -1.02786250753126, "cdf": 0.6 }, { "x": 3.06350832689629, "pdf": 0.309838667696593, "logpdf": -1.17170354375715, "cdf": 0.7 }, { "x": 3.41886116991581, "pdf": 0.25298221281347, "logpdf": -1.37443609781123, "cdf": 0.8 }, - { "x": 3.88196601125011, "pdf": 0.178885438199983, "logpdf": -1.72100968809121, "cdf": 0.9 } + { "x": 3.8819660112501, "pdf": 0.178885438199983, "logpdf": -1.72100968809121, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": 1.11803398874989 }, @@ -5038,7 +5008,7 @@ "entropy": 2.00407739677627 }, "points": [ - { "x": -4.98753882025019, "pdf": 0.0993807989999907, "logpdf": -2.30879635299332, "cdf": 0.1 }, + { "x": -4.98753882025019, "pdf": 0.0993807989999906, "logpdf": -2.30879635299332, "cdf": 0.1 }, { "x": -4.15395010584846, "pdf": 0.140545673785261, "logpdf": -1.96222276271335, "cdf": 0.2 }, { "x": -3.51431498841332, "pdf": 0.172132593164774, "logpdf": -1.75949020865927, "cdf": 0.3 }, { "x": -2.97507764050038, "pdf": 0.198761597999981, "logpdf": -1.61564917243338, "cdf": 0.4 }, @@ -5046,7 +5016,7 @@ { "x": -2.02492235949962, "pdf": 0.198761597999981, "logpdf": -1.61564917243338, "cdf": 0.6 }, { "x": -1.48568501158667, "pdf": 0.172132593164774, "logpdf": -1.75949020865927, "cdf": 0.7 }, { "x": -0.846049894151541, "pdf": 0.140545673785261, "logpdf": -1.96222276271335, "cdf": 0.8 }, - { "x": -0.0124611797498106, "pdf": 0.0993807989999907, "logpdf": -2.30879635299332, "cdf": 0.9 } + { "x": -0.0124611797498106, "pdf": 0.0993807989999906, "logpdf": -2.30879635299332, "cdf": 0.9 } ], "quans": [ { "q": 0.10, "x": -4.98753882025019 }, @@ -5073,7 +5043,7 @@ "points": [ { "x": -0.45035213014023, "pdf": 0.0563436169819011, "logpdf": -2.87628631941282, "cdf": 0.1 }, { "x": 1.01996015920445, "pdf": 0.0796819072889596, "logpdf": -2.52971272913284, "cdf": 0.2 }, - { "x": 2.14817045957576, "pdf": 0.0975900072948533, "logpdf": -2.32698017507876, "cdf": 0.3 }, + { "x": 2.14817045957576, "pdf": 0.0975900072948534, "logpdf": -2.32698017507876, "cdf": 0.3 }, { "x": 3.10045872524903, "pdf": 0.110096376512636, "logpdf": -2.20639914667032, "cdf": 0.4 }, { "x": 4.0501256289338, "pdf": 0.100503781525921, "logpdf": -2.29755992506729, "cdf": 0.5 }, { "x": 5.1005618154852, "pdf": 0.0898933149950989, "logpdf": -2.4091317007244, "cdf": 0.6 }, @@ -5104,12 +5074,12 @@ "entropy": 7.40675477864855 }, "points": [ - { "x": 317.436839953738, "pdf": 0.000634041350494546, "logpdf": -7.36339638405365, "cdf": 0.1 }, + { "x": 317.436839953738, "pdf": 0.000634041350494547, "logpdf": -7.36339638405365, "cdf": 0.1 }, { "x": 448.095057134687, "pdf": 0.000896669876974741, "logpdf": -7.01682279377368, "cdf": 0.2 }, { "x": 551.587075451203, "pdf": 0.000966575191557422, "logpdf": -6.94175146455882, "cdf": 0.3 }, - { "x": 659.030201682379, "pdf": 0.000894874740285366, "logpdf": -7.01882680447245, "cdf": 0.4 }, - { "x": 775.86765421381, "pdf": 0.000816905135659786, "logpdf": -7.10998758286943, "cdf": 0.5 }, - { "x": 905.102744546321, "pdf": 0.000730662165801588, "logpdf": -7.22155935852653, "cdf": 0.6 }, + { "x": 659.030201682379, "pdf": 0.000894874740285366, "logpdf": -7.01882680447245, "cdf": 0.399999999999999 }, + { "x": 775.86765421381, "pdf": 0.000816905135659787, "logpdf": -7.10998758286943, "cdf": 0.5 }, + { "x": 905.10274454632, "pdf": 0.000730662165801588, "logpdf": -7.22155935852653, "cdf": 0.6 }, { "x": 1051.79116224325, "pdf": 0.000632771997168333, "logpdf": -7.36540039475242, "cdf": 0.7 }, { "x": 1225.79072596616, "pdf": 0.000516656172194752, "logpdf": -7.5681329488065, "cdf": 0.8 }, { "x": 1452.55137227316, "pdf": 0.000365331082900794, "logpdf": -7.91470653908648, "cdf": 0.9 } @@ -5156,8 +5126,8 @@ ] }, { - "expr": "truncated(Normal(0, 1), -2, 2)", - "dtype": "Truncated", + "expr": "truncated(Normal(0, 1), lower=-2, upper=2)", + "dtype": "Distributions.Truncated{<:Normal}", "minimum": -2, "maximum": 2, "properties": { @@ -5167,7 +5137,7 @@ "entropy": 1.25924127268724 }, "points": [ - { "x": -1.1840324666939, "pdf": 0.207352079789992, "logpdf": -1.57333706200491, "cdf": 0.1 }, + { "x": -1.1840324666939, "pdf": 0.207352079789991, "logpdf": -1.57333706200491, "cdf": 0.1 }, { "x": -0.793820119128955, "pdf": 0.304999295662937, "logpdf": -1.18744581167924, "cdf": 0.2 }, { "x": -0.498402882421938, "pdf": 0.369142202143524, "logpdf": -0.996573337515531, "cdf": 0.3 }, { "x": -0.241587185141077, "pdf": 0.40593882627822, "logpdf": -0.901552804924477, "cdf": 0.4 }, @@ -5178,7 +5148,7 @@ { "x": 1.18403246669391, "pdf": 0.207352079789991, "logpdf": -1.57333706200491, "cdf": 0.9 } ], "quans": [ - { "q": 0.10, "x": -1.1840324666939 }, + { "q": 0.10, "x": -1.18403246669391 }, { "q": 0.25, "x": -0.639111910871273 }, { "q": 0.50, "x": 0 }, { "q": 0.75, "x": 0.639111910871273 }, @@ -5186,8 +5156,8 @@ ] }, { - "expr": "truncated(Normal(3, 10), 7, 8)", - "dtype": "Truncated", + "expr": "truncated(Normal(3, 10), lower=7, upper=8)", + "dtype": "Distributions.Truncated{<:Normal}", "minimum": 7, "maximum": 8, "properties": { @@ -5199,10 +5169,10 @@ "points": [ { "x": 7.09805852297215, "pdf": 1.01776783630884, "logpdf": 0.0176118334832923, "cdf": 0.100000000000001 }, { "x": 7.19651269368556, "pdf": 1.01362058420087, "logpdf": 0.0135286578304955, "cdf": 0.199999999999999 }, - { "x": 7.29537533996106, "pdf": 1.00937467476651, "logpdf": 0.00933100521608776, "cdf": 0.3 }, + { "x": 7.29537533996106, "pdf": 1.00937467476651, "logpdf": 0.00933100521608798, "cdf": 0.3 }, { "x": 7.39465961002905, "pdf": 1.00502969298341, "logpdf": 0.00501708633171243, "cdf": 0.400000000000001 }, { "x": 7.4943789877185, "pdf": 1.00058521051448, "logpdf": 0.000585039345587852, "cdf": 0.499999999999998 }, - { "x": 7.59454730842354, "pdf": 0.996040785364394, "logpdf": -0.00396707307489423, "cdf": 0.599999999999999 }, + { "x": 7.59454730842354, "pdf": 0.996040785364394, "logpdf": -0.00396707307489423, "cdf": 0.599999999999996 }, { "x": 7.69517877590014, "pdf": 0.991395961519668, "logpdf": -0.00864126691650002, "cdf": 0.7 }, { "x": 7.79628797994963, "pdf": 0.986650268571565, "logpdf": -0.0134396401612308, "cdf": 0.800000000000001 }, { "x": 7.89788991504986, "pdf": 0.981803221320799, "logpdf": -0.0183643763279202, "cdf": 0.899999999999996 } @@ -5216,8 +5186,8 @@ ] }, { - "expr": "truncated(Normal(27, 3); lower=0)", - "dtype": "Truncated", + "expr": "truncated(Normal(27, 3), lower=0)", + "dtype": "Distributions.Truncated{<:Normal}", "minimum": 0, "maximum": "inf", "properties": { @@ -5246,8 +5216,8 @@ ] }, { - "expr": "truncated(Normal(-5, 1); upper=-10)", - "dtype": "Truncated", + "expr": "truncated(Normal(-5, 1), upper=-10)", + "dtype": "Distributions.Truncated{<:Normal}", "minimum": "-inf", "maximum": -10, "properties": { @@ -5258,12 +5228,12 @@ }, "points": [ { "x": -10.42693400305, "pdf": 0.560040332264101, "logpdf": -0.579746475946214, "cdf": 0.100000000000001 }, - { "x": -10.3018092251151, "pdf": 1.09578316963201, "logpdf": 0.0914693310263192, "cdf": 0.199999999999998 }, + { "x": -10.3018092251151, "pdf": 1.09578316963203, "logpdf": 0.0914693310263386, "cdf": 0.200000000000002 }, { "x": -10.2273132809147, "pdf": 1.62199649109402, "logpdf": 0.483657792370302, "cdf": 0.3 }, { "x": -10.1738481177346, "pdf": 2.14193084892864, "logpdf": 0.761707688091102, "cdf": 0.400000000000002 }, { "x": -10.1320183320443, "pdf": 2.65714909851528, "logpdf": 0.977253780564682, "cdf": 0.500000000000001 }, - { "x": -10.0976026562016, "pdf": 3.16857969114006, "logpdf": 1.15328344052719, "cdf": 0.600000000000002 }, - { "x": -10.068334263013, "pdf": 3.67684026594524, "logpdf": 1.3020537599682, "cdf": 0.699999999999992 }, + { "x": -10.0976026562016, "pdf": 3.16857969114003, "logpdf": 1.15328344052718, "cdf": 0.599999999999997 }, + { "x": -10.068334263013, "pdf": 3.67684026594531, "logpdf": 1.30205375996822, "cdf": 0.700000000000005 }, { "x": -10.0428526150057, "pdf": 4.18237226242176, "logpdf": 1.43087861244934, "cdf": 0.799999999999997 }, { "x": -10.0202760209647, "pdf": 4.68550732749968, "logpdf": 1.5444741974477, "cdf": 0.899999999999999 } ], @@ -5276,8 +5246,8 @@ ] }, { - "expr": "truncated(Normal(1.8, 1.2); upper=0)", - "dtype": "Truncated", + "expr": "truncated(Normal(1.8, 1.2), upper=0)", + "dtype": "Distributions.Truncated{<:Normal}", "minimum": "-inf", "maximum": 0, "properties": { @@ -5287,22 +5257,22 @@ "entropy": 0.349323564141645 }, "points": [ - { "x": -1.16878490091852, "pdf": 0.233255103396435, "logpdf": -1.45562255998092, "cdf": 0.1 }, + { "x": -1.16878490091852, "pdf": 0.233255103396434, "logpdf": -1.45562255998092, "cdf": 0.0999999999999999 }, { "x": -0.858650476179243, "pdf": 0.427573529440004, "logpdf": -0.849629006705334, "cdf": 0.2 }, - { "x": -0.663454718666641, "pdf": 0.605033382761349, "logpdf": -0.502471644355619, "cdf": 0.3 }, - { "x": -0.517561964964367, "pdf": 0.770836726272548, "logpdf": -0.260278696622481, "cdf": 0.4 }, - { "x": -0.399562639071722, "pdf": 0.927555061428112, "logpdf": -0.0752031208414592, "cdf": 0.5 }, + { "x": -0.663454718666642, "pdf": 0.605033382761349, "logpdf": -0.50247164435562, "cdf": 0.3 }, + { "x": -0.517561964964367, "pdf": 0.770836726272549, "logpdf": -0.26027869662248, "cdf": 0.4 }, + { "x": -0.399562639071722, "pdf": 0.927555061428112, "logpdf": -0.0752031208414584, "cdf": 0.5 }, { "x": -0.299650093742927, "pdf": 1.07674709635316, "logpdf": 0.0739445482715536, "cdf": 0.600000000000001 }, { "x": -0.212476098817636, "pdf": 1.21946649109182, "logpdf": 0.198413460716842, "cdf": 0.7 }, - { "x": -0.134788421230123, "pdf": 1.35647643255934, "logpdf": 0.304890479253682, "cdf": 0.8 }, - { "x": -0.0644552402816945, "pdf": 1.48835686069009, "logpdf": 0.39767273338989, "cdf": 0.900000000000001 } + { "x": -0.134788421230123, "pdf": 1.35647643255934, "logpdf": 0.304890479253682, "cdf": 0.800000000000001 }, + { "x": -0.0644552402816942, "pdf": 1.48835686069009, "logpdf": 0.397672733389891, "cdf": 0.900000000000001 } ], "quans": [ { "q": 0.10, "x": -1.16878490091852 }, { "q": 0.25, "x": -0.752638100108226 }, { "q": 0.50, "x": -0.399562639071722 }, - { "q": 0.75, "x": -0.172599024451273 }, - { "q": 0.90, "x": -0.0644552402816945 } + { "q": 0.75, "x": -0.172599024451274 }, + { "q": 0.90, "x": -0.0644552402816942 } ] }, { @@ -5423,7 +5393,7 @@ "entropy": -2.30258509299405 }, "points": [ - { "x": 3.01, "pdf": 9.99999999999999, "logpdf": 2.30258509299405, "cdf": 0.0999999999999978 }, + { "x": 3.01, "pdf": 9.99999999999999, "logpdf": 2.30258509299405, "cdf": 0.100000000000002 }, { "x": 3.02, "pdf": 9.99999999999999, "logpdf": 2.30258509299405, "cdf": 0.2 }, { "x": 3.03, "pdf": 9.99999999999999, "logpdf": 2.30258509299405, "cdf": 0.300000000000002 }, { "x": 3.04, "pdf": 9.99999999999999, "logpdf": 2.30258509299405, "cdf": 0.4 }, @@ -5431,7 +5401,7 @@ { "x": 3.06, "pdf": 9.99999999999999, "logpdf": 2.30258509299405, "cdf": 0.6 }, { "x": 3.07, "pdf": 9.99999999999999, "logpdf": 2.30258509299405, "cdf": 0.700000000000002 }, { "x": 3.08, "pdf": 9.99999999999999, "logpdf": 2.30258509299405, "cdf": 0.8 }, - { "x": 3.09, "pdf": 9.99999999999999, "logpdf": 2.30258509299405, "cdf": 0.899999999999998 } + { "x": 3.09, "pdf": 9.99999999999999, "logpdf": 2.30258509299405, "cdf": 0.900000000000002 } ], "quans": [ { "q": 0.10, "x": 3.01 }, @@ -5458,16 +5428,16 @@ { "x": -1.02645317031663, "pdf": 0.210991985207339, "logpdf": -1.55593513102685, "cdf": 0.200000000000053 }, { "x": -0.622605793094718, "pdf": 0.283248751421006, "logpdf": -1.26142978712961, "cdf": 0.300000000008599 }, { "x": -0.296933076815719, "pdf": 0.327079148709122, "logpdf": -1.11755309239102, "cdf": 0.399999999977108 }, - { "x": -8.88178419700125e-16, "pdf": 0.341710488623463, "logpdf": -1.07379142491652, "cdf": 0.5 }, + { "x": -1.33226762955019e-15, "pdf": 0.341710488623463, "logpdf": -1.07379142491652, "cdf": 0.499999999999999 }, { "x": 0.296933076815719, "pdf": 0.327079148709122, "logpdf": -1.11755309239102, "cdf": 0.600000000022892 }, - { "x": 0.622605793094717, "pdf": 0.283248751421006, "logpdf": -1.26142978712961, "cdf": 0.699999999991401 }, + { "x": 0.622605793094718, "pdf": 0.283248751421006, "logpdf": -1.26142978712961, "cdf": 0.699999999991401 }, { "x": 1.02645317031663, "pdf": 0.210991985207339, "logpdf": -1.55593513102685, "cdf": 0.799999999999947 }, { "x": 1.65156171833182, "pdf": 0.115964747028237, "logpdf": -2.15446903899322, "cdf": 0.89999999999999 } ], "quans": [ { "q": 0.10, "x": -1.65156171833191 }, { "q": 0.25, "x": -0.8097673745016 }, - { "q": 0.50, "x": -8.88178419700125e-16 }, + { "q": 0.50, "x": -1.33226762955019e-15 }, { "q": 0.75, "x": 0.8097673745016 }, { "q": 0.90, "x": 1.65156171833182 } ] @@ -5520,7 +5490,7 @@ { "x": 0.519995675848493, "pdf": 0.391580158578076, "logpdf": -0.937565037183287, "cdf": 0.2 }, { "x": 0.74261586166407, "pdf": 0.503245108418616, "logpdf": -0.686677934492354, "cdf": 0.300000000000003 }, { "x": 0.928239666200964, "pdf": 0.568074798690311, "logpdf": -0.565502181096013, "cdf": 0.399999999998271 }, - { "x": 1.1, "pdf": 0.589361378515952, "logpdf": -0.528715737605373, "cdf": 0.499999999999998 }, + { "x": 1.1, "pdf": 0.589361378515952, "logpdf": -0.528715737605373, "cdf": 0.499999999999999 }, { "x": 1.27176033379904, "pdf": 0.568074798690311, "logpdf": -0.565502181096013, "cdf": 0.600000000001729 }, { "x": 1.45738413833593, "pdf": 0.503245108418615, "logpdf": -0.686677934492356, "cdf": 0.699999999999999 }, { "x": 1.6800043241515, "pdf": 0.39158015857808, "logpdf": -0.937565037183278, "cdf": 0.799999999999997 }, @@ -5640,7 +5610,7 @@ "scale": 1, "mean": 0.973504265562776, "median": 0.981841247589339, - "var": 0.00364021479795384, + "var": 0.00364021479795407, "entropy": -1.44737739189754 }, "points": [ diff --git a/test/ref/discrete/betabinomial.R b/test/ref/discrete/betabinomial.R index 68c2c52583..b7d5531bee 100644 --- a/test/ref/discrete/betabinomial.R +++ b/test/ref/discrete/betabinomial.R @@ -11,7 +11,7 @@ BetaBinomial <- R6Class("BetaBinomial", self$n <- n self$alpha <- a self$beta <- b - self$probs <- dbbinom(0:n, self$n, self$alpha, self$beta) + self$probs <- extraDistr::dbbinom(0:n, self$n, self$alpha, self$beta) }, supp = function() { c(0, self$n) }, properties = function() { @@ -29,8 +29,8 @@ BetaBinomial <- R6Class("BetaBinomial", skewness = (u+2*n)*(b-a)/(u+2) * sqrt((u+1)/v1), kurtosis = kur.orig-3) }, - pdf = function(x, log=FALSE){ dbbinom(x, self$n, self$alpha, self$beta, log=log) }, - cdf = function(x) { pbbinom(x, self$n, self$alpha, self$beta) }, - quan = function(v) { qcat(v, self$probs) - 1 } + pdf = function(x, log=FALSE){ extraDistr::dbbinom(x, self$n, self$alpha, self$beta, log=log) }, + cdf = function(x) { extraDistr::pbbinom(x, self$n, self$alpha, self$beta) }, + quan = function(v) { extraDistr::qcat(v, self$probs) - 1 } ) ) diff --git a/test/ref/discrete_test.ref.json b/test/ref/discrete_test.ref.json index 05a465be71..6a23457b80 100644 --- a/test/ref/discrete_test.ref.json +++ b/test/ref/discrete_test.ref.json @@ -19,7 +19,7 @@ { "x": 1, "pdf": 0.5, "logpdf": -0.693147180559945, "cdf": 1 } ], "quans": [ - { "q": 0.10, "x": 0 }, + { "q": 0.10, "x": -0 }, { "q": 0.25, "x": 0 }, { "q": 0.50, "x": 0 }, { "q": 0.75, "x": 1 }, @@ -46,8 +46,8 @@ { "x": 1, "pdf": 0.25, "logpdf": -1.38629436111989, "cdf": 1 } ], "quans": [ - { "q": 0.10, "x": 0 }, - { "q": 0.25, "x": 0 }, + { "q": 0.10, "x": -0 }, + { "q": 0.25, "x": -0 }, { "q": 0.50, "x": 0 }, { "q": 0.75, "x": 0 }, { "q": 0.90, "x": 1 } @@ -172,11 +172,11 @@ "kurtosis": -1.6913064068981 }, "points": [ - { "x": 0, "pdf": 0.343519287158209, "logpdf": -1.06851201996383, "cdf": 0.343519287158209 }, - { "x": 1, "pdf": 0.0742744404666397, "logpdf": -2.59998839092822, "cdf": 0.417793727624848 }, - { "x": 3, "pdf": 0.039339841571296, "logpdf": -3.23551749319517, "cdf": 0.50574956659249 }, - { "x": 6, "pdf": 0.0345020592656908, "logpdf": -3.36673626786553, "cdf": 0.609338682032028 }, - { "x": 9, "pdf": 0.0657942390366793, "logpdf": -2.72122299711787, "cdf": 0.757877200345019 }, + { "x": 0, "pdf": 0.343519287158209, "logpdf": -1.06851201996383, "cdf": 0.343519287158208 }, + { "x": 1, "pdf": 0.0742744404666398, "logpdf": -2.59998839092822, "cdf": 0.417793727624847 }, + { "x": 3, "pdf": 0.0393398415712961, "logpdf": -3.23551749319517, "cdf": 0.505749566592489 }, + { "x": 6, "pdf": 0.0345020592656909, "logpdf": -3.36673626786553, "cdf": 0.609338682032027 }, + { "x": 9, "pdf": 0.0657942390366794, "logpdf": -2.72122299711787, "cdf": 0.757877200345018 }, { "x": 10, "pdf": 0.24212279965498, "logpdf": -1.41831024493703, "cdf": 1 } ], "quans": [ @@ -200,16 +200,16 @@ "kurtosis": -0.811058355437666 }, "points": [ - { "x": 0, "pdf": 0.0518518518518519, "logpdf": -2.95936462938312, "cdf": 0.0518518518518519 }, - { "x": 1, "pdf": 0.0901771336553946, "logpdf": -2.40597939119833, "cdf": 0.142028985507246 }, - { "x": 2, "pdf": 0.115942028985507, "logpdf": -2.15466496291742, "cdf": 0.257971014492754 }, - { "x": 3, "pdf": 0.1301805237732, "logpdf": -2.03883314739231, "cdf": 0.388151538265954 }, - { "x": 4, "pdf": 0.134009362707706, "logpdf": -2.00984561051905, "cdf": 0.522160900973661 }, - { "x": 5, "pdf": 0.128648988199398, "logpdf": -2.05066760503931, "cdf": 0.650809889173059 }, - { "x": 6, "pdf": 0.115454220178947, "logpdf": -2.15888118967954, "cdf": 0.766264109352006 }, - { "x": 7, "pdf": 0.0959619492396443, "logpdf": -2.34380352817355, "cdf": 0.86222605859165 }, - { "x": 8, "pdf": 0.0719714619297336, "logpdf": -2.63148560062533, "cdf": 0.934197520521384 }, - { "x": 10, "pdf": 0.0201063131740208, "logpdf": -3.90672142497276, "cdf": 0.999999999999997 } + { "x": 0, "pdf": 0.0518518518518519, "logpdf": -2.95936462938312, "cdf": 0.0518518518518521 }, + { "x": 1, "pdf": 0.0901771336553945, "logpdf": -2.40597939119833, "cdf": 0.142028985507247 }, + { "x": 2, "pdf": 0.115942028985507, "logpdf": -2.15466496291742, "cdf": 0.257971014492755 }, + { "x": 3, "pdf": 0.130180523773201, "logpdf": -2.0388331473923, "cdf": 0.388151538265957 }, + { "x": 4, "pdf": 0.134009362707707, "logpdf": -2.00984561051905, "cdf": 0.522160900973666 }, + { "x": 5, "pdf": 0.128648988199399, "logpdf": -2.0506676050393, "cdf": 0.650809889173066 }, + { "x": 6, "pdf": 0.115454220178947, "logpdf": -2.15888118967954, "cdf": 0.766264109352014 }, + { "x": 7, "pdf": 0.0959619492396446, "logpdf": -2.34380352817355, "cdf": 0.86222605859166 }, + { "x": 8, "pdf": 0.0719714619297335, "logpdf": -2.63148560062533, "cdf": 0.934197520521394 }, + { "x": 10, "pdf": 0.0201063131740208, "logpdf": -3.90672142497276, "cdf": 1 } ], "quans": [ { "q": 0.10, "x": 1 }, @@ -232,13 +232,13 @@ "kurtosis": -0.212506273471436 }, "points": [ - { "x": 0, "pdf": 0.000192751819501661, "logpdf": -8.55410710586806, "cdf": 0.000192751819501661 }, - { "x": 4, "pdf": 0.113798908976598, "logpdf": -2.17332234453623, "cdf": 0.177330155587457 }, - { "x": 5, "pdf": 0.194216804653393, "logpdf": -1.63878019415293, "cdf": 0.371546960240851 }, - { "x": 6, "pdf": 0.239092657243757, "logpdf": -1.43090411496952, "cdf": 0.610639617484608 }, - { "x": 7, "pdf": 0.209702529941374, "logpdf": -1.56206527657206, "cdf": 0.820342147425982 }, - { "x": 8, "pdf": 0.125447049161356, "logpdf": -2.0758715284762, "cdf": 0.945789196587338 }, - { "x": 10, "pdf": 0.00797557662147816, "logpdf": -4.83137132929139, "cdf": 0.999999999999993 } + { "x": 0, "pdf": 0.000192751819501658, "logpdf": -8.55410710586807, "cdf": 0.000192751819501639 }, + { "x": 4, "pdf": 0.113798908976598, "logpdf": -2.17332234453623, "cdf": 0.177330155587428 }, + { "x": 5, "pdf": 0.194216804653393, "logpdf": -1.63878019415293, "cdf": 0.371546960240797 }, + { "x": 6, "pdf": 0.239092657243761, "logpdf": -1.43090411496951, "cdf": 0.610639617484534 }, + { "x": 7, "pdf": 0.209702529941374, "logpdf": -1.56206527657206, "cdf": 0.820342147425872 }, + { "x": 8, "pdf": 0.125447049161356, "logpdf": -2.0758715284762, "cdf": 0.945789196587212 }, + { "x": 10, "pdf": 0.00797557662147816, "logpdf": -4.83137132929139, "cdf": 1 } ], "quans": [ { "q": 0.10, "x": 4 }, @@ -268,7 +268,7 @@ { "x": 1, "pdf": 0.5, "logpdf": -0.693147180559945, "cdf": 1 } ], "quans": [ - { "q": 0.10, "x": 0 }, + { "q": 0.10, "x": -0 }, { "q": 0.25, "x": 0 }, { "q": 0.50, "x": 0 }, { "q": 0.75, "x": 1 }, @@ -351,7 +351,7 @@ "kurtosis": 0.0416666666666667 }, "points": [ - { "x": 0, "pdf": 6.4e-05, "logpdf": -9.6566274746046, "cdf": 6.39999999999999e-05 }, + { "x": 0, "pdf": 6.39999999999999e-05, "logpdf": -9.6566274746046, "cdf": 6.39999999999999e-05 }, { "x": 1, "pdf": 0.001536, "logpdf": -6.47857364425666, "cdf": 0.0016 }, { "x": 2, "pdf": 0.01536, "logpdf": -4.17598855126261, "cdf": 0.01696 }, { "x": 3, "pdf": 0.0819199999999999, "logpdf": -2.50201211769094, "cdf": 0.09888 }, @@ -383,16 +383,16 @@ "kurtosis": 0.0511111111111111 }, "points": [ - { "x": 0, "pdf": 2.65613988875875e-05, "logpdf": -10.5360515657826, "cdf": 2.65613988875875e-05 }, + { "x": 0, "pdf": 2.65613988875875e-05, "logpdf": -10.5360515657826, "cdf": 2.65613988875874e-05 }, { "x": 6, "pdf": 0.0595787289488504, "logpdf": -2.82045666544503, "cdf": 0.117155615435884 }, { "x": 7, "pdf": 0.088895246368126, "logpdf": -2.42029660956656, "cdf": 0.20605086180401 }, { "x": 8, "pdf": 0.114823026558829, "logpdf": -2.16436323542936, "cdf": 0.320873888362839 }, { "x": 9, "pdf": 0.130416277079164, "logpdf": -2.03702381305276, "cdf": 0.451290165442003 }, { "x": 10, "pdf": 0.131865346824488, "logpdf": -2.02597397686618, "cdf": 0.583155512266491 }, { "x": 11, "pdf": 0.119877588022262, "logpdf": -2.1212841566705, "cdf": 0.703033100288754 }, - { "x": 12, "pdf": 0.0987880123516788, "logpdf": -2.31477901406258, "cdf": 0.801821112640432 }, - { "x": 14, "pdf": 0.0513038273344495, "logpdf": -2.96998992267902, "cdf": 0.927427034735119 }, - { "x": 100, "pdf": 1.00000000000002e-100, "logpdf": -230.258509299405, "cdf": 1 } + { "x": 12, "pdf": 0.0987880123516788, "logpdf": -2.31477901406258, "cdf": 0.801821112640433 }, + { "x": 14, "pdf": 0.0513038273344494, "logpdf": -2.96998992267902, "cdf": 0.927427034735119 }, + { "x": 100, "pdf": 1.00000000000001e-100, "logpdf": -230.258509299405, "cdf": 1 } ], "quans": [ { "q": 0.10, "x": 6 }, @@ -418,10 +418,10 @@ "kurtosis": 0.0511111111111111 }, "points": [ - { "x": 0, "pdf": 9.99999999999989e-101, "logpdf": -230.258509299405, "cdf": 9.99999999999998e-101 }, - { "x": 86, "pdf": 0.0513038273344493, "logpdf": -2.96998992267903, "cdf": 0.12387679259933 }, + { "x": 0, "pdf": 9.99999999999978e-101, "logpdf": -230.258509299405, "cdf": 9.9999999999997e-101 }, + { "x": 86, "pdf": 0.0513038273344494, "logpdf": -2.96998992267903, "cdf": 0.12387679259933 }, { "x": 88, "pdf": 0.0987880123516788, "logpdf": -2.31477901406258, "cdf": 0.296966899711246 }, - { "x": 89, "pdf": 0.119877588022262, "logpdf": -2.1212841566705, "cdf": 0.416844487733508 }, + { "x": 89, "pdf": 0.119877588022262, "logpdf": -2.1212841566705, "cdf": 0.416844487733509 }, { "x": 90, "pdf": 0.131865346824488, "logpdf": -2.02597397686618, "cdf": 0.548709834557997 }, { "x": 91, "pdf": 0.130416277079164, "logpdf": -2.03702381305276, "cdf": 0.679126111637161 }, { "x": 92, "pdf": 0.114823026558829, "logpdf": -2.16436323542936, "cdf": 0.79394913819599 }, @@ -732,7 +732,7 @@ { "x": 4, "pdf": 0.06561, "logpdf": -2.72402715562535, "cdf": 0.40951 }, { "x": 6, "pdf": 0.0531441, "logpdf": -2.934748186941, "cdf": 0.5217031 }, { "x": 8, "pdf": 0.043046721, "logpdf": -3.14546921825666, "cdf": 0.612579511 }, - { "x": 11, "pdf": 0.031381059609, "logpdf": -3.46155076523013, "cdf": 0.717570463519 }, + { "x": 11, "pdf": 0.031381059609, "logpdf": -3.46155076523014, "cdf": 0.717570463519 }, { "x": 15, "pdf": 0.0205891132094649, "logpdf": -3.88299282786144, "cdf": 0.814697981114816 }, { "x": 21, "pdf": 0.0109418989131512, "logpdf": -4.5151559218084, "cdf": 0.901522909781639 }, { "x": 43, "pdf": 0.00107752636643058, "logpdf": -6.83308726628058, "cdf": 0.990302262702125 } @@ -931,8 +931,8 @@ "kurtosis": -0.02787878186819 }, "points": [ - { "x": 20, "pdf": 2.37106739517318e-20, "logpdf": -45.1883616284133, "cdf": 2.37106739517318e-20 }, - { "x": 39, "pdf": 0.0523495571361668, "logpdf": -2.94981180137345, "cdf": 0.102455999861417 }, + { "x": 20, "pdf": 2.37106739517317e-20, "logpdf": -45.1883616284133, "cdf": 2.37106739517317e-20 }, + { "x": 39, "pdf": 0.0523495571361666, "logpdf": -2.94981180137345, "cdf": 0.102455999861417 }, { "x": 41, "pdf": 0.116828889706323, "logpdf": -2.14704489579628, "cdf": 0.303109617932027 }, { "x": 42, "pdf": 0.141737213593927, "logpdf": -1.95378054436581, "cdf": 0.444846831525954 }, { "x": 43, "pdf": 0.14961946510825, "logpdf": -1.89966010754594, "cdf": 0.594466296634204 }, @@ -1001,8 +1001,8 @@ { "x": 6, "pdf": 0.11279296875, "logpdf": -2.1822012756376, "cdf": 0.61279296875 }, { "x": 7, "pdf": 0.0966796875, "logpdf": -2.33635195546486, "cdf": 0.70947265625 }, { "x": 9, "pdf": 0.06109619140625, "logpdf": -2.79530574852401, "cdf": 0.84912109375 }, - { "x": 11, "pdf": 0.0333251953125, "logpdf": -3.40144155209433, "cdf": 0.928268432617188 }, - { "x": 16, "pdf": 0.00485157966613769, "logpdf": -5.32845092270461, "cdf": 0.991549730300903 } + { "x": 11, "pdf": 0.0333251953124999, "logpdf": -3.40144155209433, "cdf": 0.928268432617188 }, + { "x": 16, "pdf": 0.0048515796661377, "logpdf": -5.32845092270461, "cdf": 0.991549730300903 } ], "quans": [ { "q": 0.10, "x": 2 }, @@ -1062,8 +1062,8 @@ { "x": 3, "pdf": 0.1741824, "logpdf": -1.74765225296301, "cdf": 0.5940864 }, { "x": 4, "pdf": 0.13934592, "logpdf": -1.97079580427721, "cdf": 0.73343232 }, { "x": 5, "pdf": 0.1003290624, "logpdf": -2.29929987124925, "cdf": 0.8337613824 }, - { "x": 6, "pdf": 0.0668860416, "logpdf": -2.70476497935742, "cdf": 0.900647424 }, - { "x": 10, "pdf": 0.008161880702976, "logpdf": -4.80828065825628, "cdf": 0.990652339224576 } + { "x": 6, "pdf": 0.0668860416, "logpdf": -2.70476497935741, "cdf": 0.900647424 }, + { "x": 10, "pdf": 0.00816188070297599, "logpdf": -4.80828065825628, "cdf": 0.990652339224576 } ], "quans": [ { "q": 0.10, "x": 1 }, @@ -1092,7 +1092,7 @@ { "x": 2, "pdf": 0.0662912607362388, "logpdf": -2.71369720441159, "cdf": 0.950174737219423 }, { "x": 3, "pdf": 0.0276213586400995, "logpdf": -3.58916594176549, "cdf": 0.977796095859523 }, { "x": 4, "pdf": 0.0120843444050435, "logpdf": -4.41584451494996, "cdf": 0.989880440264566 }, - { "x": 5, "pdf": 0.00543795498226959, "logpdf": -5.21435221116773, "cdf": 0.995318395246836 } + { "x": 5, "pdf": 0.0054379549822696, "logpdf": -5.21435221116773, "cdf": 0.995318395246836 } ], "quans": [ { "q": 0.10, "x": -0 }, @@ -1118,7 +1118,7 @@ { "x": 0, "pdf": 0.367879441171442, "logpdf": -1, "cdf": 0.367879441171442 }, { "x": 1, "pdf": 0.367879441171442, "logpdf": -1, "cdf": 0.735758882342885 }, { "x": 2, "pdf": 0.183939720585721, "logpdf": -1.69314718055995, "cdf": 0.919698602928606 }, - { "x": 3, "pdf": 0.0613132401952404, "logpdf": -2.79175946922806, "cdf": 0.981011843123846 }, + { "x": 3, "pdf": 0.0613132401952404, "logpdf": -2.79175946922805, "cdf": 0.981011843123846 }, { "x": 4, "pdf": 0.0153283100488101, "logpdf": -4.17805383034795, "cdf": 0.996340153172656 } ], "quans": [ @@ -1228,8 +1228,8 @@ { "x": 10, "pdf": 0.125110035721133, "logpdf": -2.07856164313506, "cdf": 0.583039750192985 }, { "x": 11, "pdf": 0.113736396110121, "logpdf": -2.17387182293938, "cdf": 0.696776146303107 }, { "x": 12, "pdf": 0.0947803300917677, "logpdf": -2.35619337973334, "cdf": 0.791556476394874 }, - { "x": 13, "pdf": 0.0729079462244366, "logpdf": -2.61855764420083, "cdf": 0.864464422619311 }, - { "x": 14, "pdf": 0.0520771044460263, "logpdf": -2.95502988082204, "cdf": 0.916541527065337 }, + { "x": 13, "pdf": 0.0729079462244367, "logpdf": -2.61855764420083, "cdf": 0.864464422619311 }, + { "x": 14, "pdf": 0.0520771044460262, "logpdf": -2.95502988082204, "cdf": 0.916541527065337 }, { "x": 18, "pdf": 0.00709110899319529, "logpdf": -4.94891353414023, "cdf": 0.992813495396146 } ], "quans": [ @@ -1259,11 +1259,11 @@ { "x": 75, "pdf": 0.0392264266855184, "logpdf": -3.23840460918207, "cdf": 0.312384231977445 }, { "x": 78, "pdf": 0.0439997074482216, "logpdf": -3.12357229399004, "cdf": 0.440574629646123 }, { "x": 80, "pdf": 0.0445566657703509, "logpdf": -3.11099351178318, "cdf": 0.529687961186824 }, - { "x": 82, "pdf": 0.0429332521725754, "logpdf": -3.1481086443721, "cdf": 0.61662779683629 }, + { "x": 82, "pdf": 0.0429332521725755, "logpdf": -3.1481086443721, "cdf": 0.61662779683629 }, { "x": 85, "pdf": 0.0370926143436918, "logpdf": -3.29433740348069, "cdf": 0.734512761797335 }, - { "x": 87, "pdf": 0.0317285126703592, "logpdf": -3.45053954904101, "cdf": 0.80074603199671 }, + { "x": 87, "pdf": 0.0317285126703592, "logpdf": -3.45053954904102, "cdf": 0.80074603199671 }, { "x": 92, "pdf": 0.0176179446534293, "logpdf": -4.03883731377811, "cdf": 0.916442472359937 }, - { "x": 102, "pdf": 0.00244734344970641, "logpdf": -6.01275214895309, "cdf": 0.992398851472148 } + { "x": 102, "pdf": 0.00244734344970639, "logpdf": -6.0127521489531, "cdf": 0.992398851472148 } ], "quans": [ { "q": 0.10, "x": 69 }, @@ -1287,7 +1287,7 @@ "points": [ { "x": -3, "pdf": 0.0287912226394709, "logpdf": -3.5476847077547, "cdf": 0.0372375161694934 }, { "x": -2, "pdf": 0.0932390333047334, "logpdf": -2.37258883268543, "cdf": 0.130476549474227 }, - { "x": -1, "pdf": 0.215269289248938, "logpdf": -1.53586552645384, "cdf": 0.345745838723164 }, + { "x": -1, "pdf": 0.215269289248938, "logpdf": -1.53586552645384, "cdf": 0.345745838723165 }, { "x": 0, "pdf": 0.308508322553671, "logpdf": -1.17600645851704, "cdf": 0.654254161276836 }, { "x": 1, "pdf": 0.215269289248938, "logpdf": -1.53586552645384, "cdf": 0.869523450525773 }, { "x": 2, "pdf": 0.0932390333047334, "logpdf": -2.37258883268543, "cdf": 0.962762483830507 }, @@ -1318,7 +1318,7 @@ { "x": -2, "pdf": 0.117626501472769, "logpdf": -2.14024091624611, "cdf": 0.217748199885571 }, { "x": -1, "pdf": 0.178750839502435, "logpdf": -1.72176240090193, "cdf": 0.396499039388007 }, { "x": 0, "pdf": 0.207001921223987, "logpdf": -1.57502720448454, "cdf": 0.603500960611993 }, - { "x": 1, "pdf": 0.178750839502435, "logpdf": -1.72176240090193, "cdf": 0.782251800114429 }, + { "x": 1, "pdf": 0.178750839502435, "logpdf": -1.72176240090193, "cdf": 0.782251800114428 }, { "x": 2, "pdf": 0.117626501472769, "logpdf": -2.14024091624611, "cdf": 0.899878301587198 }, { "x": 3, "pdf": 0.0611243380296663, "logpdf": -2.79484516102625, "cdf": 0.961002639616864 }, { "x": 5, "pdf": 0.0092443491731271, "logpdf": -4.68374281433584, "cdf": 0.996186983218261 } @@ -1344,11 +1344,11 @@ }, "points": [ { "x": -6, "pdf": 0.0154316649323744, "logpdf": -4.17133371613553, "cdf": 0.0244462081254431 }, - { "x": -4, "pdf": 0.068410944672505, "logpdf": -2.6822224573219, "cdf": 0.127731053628502 }, + { "x": -4, "pdf": 0.068410944672505, "logpdf": -2.6822224573219, "cdf": 0.127731053628501 }, { "x": -3, "pdf": 0.114463860117042, "logpdf": -2.16749613797573, "cdf": 0.242194913745544 }, { "x": -2, "pdf": 0.160071156565379, "logpdf": -1.83213683407712, "cdf": 0.402266070310923 }, { "x": -1, "pdf": 0.183023344454947, "logpdf": -1.6981415689489, "cdf": 0.58528941476587 }, - { "x": 0, "pdf": 0.167721885861902, "logpdf": -1.78544811263415, "cdf": 0.753011300627772 }, + { "x": 0, "pdf": 0.167721885861902, "logpdf": -1.78544811263415, "cdf": 0.753011300627771 }, { "x": 1, "pdf": 0.122015562969965, "logpdf": -2.10360667705706, "cdf": 0.875026863597737 }, { "x": 2, "pdf": 0.0711427362512795, "logpdf": -2.64306705029345, "cdf": 0.946169599849016 }, { "x": 4, "pdf": 0.0135132730217294, "logpdf": -4.30408288975455, "cdf": 0.993598090683203 } @@ -1541,7 +1541,7 @@ { "x": 45, "pdf": 0.192869689177626, "logpdf": -1.64574050372586, "cdf": 0.737841495920921 }, { "x": 46, "pdf": 0.134519620169177, "logpdf": -2.00604521571517, "cdf": 0.872361116090098 }, { "x": 47, "pdf": 0.0750693077904588, "logpdf": -2.58934348829416, "cdf": 0.947430423880557 }, - { "x": 80, "pdf": 2.55666037035392e-50, "logpdf": -114.190552785698, "cdf": 1 } + { "x": 80, "pdf": 2.55666037035391e-50, "logpdf": -114.190552785698, "cdf": 1 } ], "quans": [ { "q": 0.10, "x": 42 }, @@ -1564,7 +1564,7 @@ "points": [ { "x": 4, "pdf": 0.0699300699300699, "logpdf": -2.66025953726586, "cdf": 0.0699300699300699 }, { "x": 5, "pdf": 0.335664335664336, "logpdf": -1.09164361935202, "cdf": 0.405594405594406 }, - { "x": 6, "pdf": 0.419580419580419, "logpdf": -0.868500068037807, "cdf": 0.825174825174825 }, + { "x": 6, "pdf": 0.41958041958042, "logpdf": -0.868500068037807, "cdf": 0.825174825174825 }, { "x": 7, "pdf": 0.15984015984016, "logpdf": -1.83358096408139, "cdf": 0.985014985014985 }, { "x": 8, "pdf": 0.014985014985015, "logpdf": -4.20070457821301, "cdf": 1 } ], @@ -1591,7 +1591,7 @@ { "x": 5, "pdf": 0.000344209021458604, "logpdf": -7.97426146459828, "cdf": 0.000347207483870081 }, { "x": 6, "pdf": 0.0117831016988848, "logpdf": -4.44108883330415, "cdf": 0.0121303091827549 }, { "x": 7, "pdf": 0.153082303608173, "logpdf": -1.87677957014373, "cdf": 0.165212612790928 }, - { "x": 8, "pdf": 0.834787387209073, "logpdf": -0.180578212650929, "cdf": 1 } + { "x": 8, "pdf": 0.834787387209072, "logpdf": -0.180578212650929, "cdf": 1 } ], "quans": [ { "q": 0.10, "x": 7 }, @@ -1612,10 +1612,10 @@ "mode": 4 }, "points": [ - { "x": 4, "pdf": 0.967522599452393, "logpdf": -0.0330164957438836, "cdf": 0.967522599452393 }, + { "x": 4, "pdf": 0.967522599452393, "logpdf": -0.0330164957438833, "cdf": 0.967522599452393 }, { "x": 5, "pdf": 0.0316809171225944, "logpdf": -3.4520407628781, "cdf": 0.999203516574988 }, { "x": 6, "pdf": 0.000787819440585419, "logpdf": -7.14624163067505, "cdf": 0.999991336015573 }, - { "x": 7, "pdf": 8.63540150008763e-06, "logpdf": -11.6596403506211, "cdf": 0.999999971417073 }, + { "x": 7, "pdf": 8.63540150008764e-06, "logpdf": -11.6596403506211, "cdf": 0.999999971417073 }, { "x": 8, "pdf": 2.85829267563107e-08, "logpdf": -17.3704562639386, "cdf": 1 } ], "quans": [ @@ -1637,12 +1637,12 @@ "mode": 29 }, "points": [ - { "x": 20, "pdf": 8.51511049854072e-07, "logpdf": -13.97625336, "cdf": 8.51511049854072e-07 }, + { "x": 20, "pdf": 8.51511049854071e-07, "logpdf": -13.97625336, "cdf": 8.51511049854071e-07 }, { "x": 26, "pdf": 0.085120477512863, "logpdf": -2.46368764352598, "cdf": 0.133725872225118 }, { "x": 27, "pdf": 0.151325293356201, "logpdf": -1.88832349862242, "cdf": 0.285051165581319 }, { "x": 28, "pdf": 0.201992244256715, "logpdf": -1.59952597708677, "cdf": 0.487043409838033 }, { "x": 29, "pdf": 0.2043139941907, "logpdf": -1.58809728126315, "cdf": 0.691357404028733 }, - { "x": 30, "pdf": 0.157321775526839, "logpdf": -1.84946204539756, "cdf": 0.848679179555571 }, + { "x": 30, "pdf": 0.157321775526839, "logpdf": -1.84946204539755, "cdf": 0.848679179555571 }, { "x": 31, "pdf": 0.0922708360861225, "logpdf": -2.38302715613304, "cdf": 0.940950015641694 }, { "x": 40, "pdf": 1.85595259340469e-10, "logpdf": -22.4074528382493, "cdf": 1 } ], diff --git a/test/ref/gendref.R b/test/ref/gendref.R index 89fbd1fc46..9a7074d9f9 100644 --- a/test/ref/gendref.R +++ b/test/ref/gendref.R @@ -11,6 +11,7 @@ # # - continuous_test.json # - discrete_test.json +# - matrixvariates/jsonfiles/{InverseWishart,LKJ,Wishart}_stan_output.json # # To run this script: # @@ -18,9 +19,9 @@ # # Note: this scripts depends on a number of R libraries for # file I/O and the computation of statistical functions. +# Install them with `renv` before running this script. # -library(stringr) source("rdistributions.R") options( @@ -47,21 +48,21 @@ parse.entry <- function(entry) { # Parse an entry into a distribution name, and # a vector of argument values - lb <- str_locate(entry, "\\(")[1] - rb <- str_locate(entry, "\\)")[1] + lb <- stringr::str_locate(entry, "\\(")[1] + rb <- stringr::str_locate(entry, "\\)")[1] stopifnot(!is.na(lb), lb > 1) stopifnot(!is.na(rb), rb > lb) - name <- str_sub(entry, 1, lb-1) + name <- stringr::str_sub(entry, 1, lb-1) if (rb == lb + 1) { args <- NULL } else { - argstr <- entry %>% str_sub(lb+1, rb-1) %>% str_trim - sl <- str_length(argstr) + argstr <- stringr::str_trim(stringr::str_sub(entry, lb+1, rb-1)) + sl <- stringr::str_length(argstr) if (sl == 0) { args <- NULL } else { - terms <- str_split(argstr, "\\s*,\\s*")[[1]] + terms <- stringr::str_split(argstr, "\\s*,\\s*")[[1]] args <- as.numeric(terms) } } @@ -287,8 +288,8 @@ do.main <- function(lstname) { cat("\n") n <- n + 1 info <- list( - dtype=class(distr)[1], - expr=e, + dtype=ifelse("dtype" %in% names(distr), distr$dtype, class(distr)[1]), + expr=ifelse("expr" %in% names(distr), distr$expr(), e), supp=distr$supp(), props=distr$properties(), points=eval.points(distr), @@ -311,3 +312,8 @@ do.main <- function(lstname) { do.main("discrete_test") do.main("continuous_test") + +# Matrixvariate distributions +cat("Matrixvariate distributions\n") +cat("-------------------------------\n") +source("matrixvariates/get_stan_output.R", chdir=TRUE) diff --git a/test/ref/matrixvariates/get_stan_output.R b/test/ref/matrixvariates/get_stan_output.R index 8e0a1cb531..0974588c80 100644 --- a/test/ref/matrixvariates/get_stan_output.R +++ b/test/ref/matrixvariates/get_stan_output.R @@ -1,3 +1,51 @@ -source("scripts/wishart.R") -source("scripts/inversewishart.R") -source("scripts/lkj.R") +set.seed(8675309) +S <- matrix(c(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0), 3, 3) +X <- StanHeaders::stanFunction("inv_wishart_rng", nu=4, S=S) +invwishart_output <- lapply( + c(4.5, 8.2, 10.0), + function(nu, X, S) { + cat("InverseWishart(", nu, ", S)\n", sep="") + lpdf <- StanHeaders::stanFunction("inv_wishart_lpdf", W=X, nu=nu, S=S) + list("dims" = dim(S), + "params" = list(nu, c(S)), + "X" = c(X), + "lpdf" = lpdf) + }, + X, + S +) +jsonlite::write_json(invwishart_output, "jsonfiles/InverseWishart_stan_output.json", digits = 20, pretty = TRUE) + +set.seed(8675309) +X <- StanHeaders::stanFunction("lkj_corr_rng", K=3, eta=1) +lkj_output <- lapply( + c(0.5, 1.0, 3.4), + function(eta, X) { + cat("LKJ(", nrow(X), ", ", eta, ")\n", sep="") + lpdf <- StanHeaders::stanFunction("lkj_corr_lpdf", y=X, eta=eta) + list("dims" = dim(X), + "params" = list(nrow(X), eta), + "X" = c(X), + "lpdf" = lpdf) + }, + X +) +jsonlite::write_json(lkj_output, "jsonfiles/LKJ_stan_output.json", digits = 20, pretty = TRUE) + +set.seed(8675309) +S <- matrix(c(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0), 3, 3) +X <- StanHeaders::stanFunction("wishart_rng", nu=4, S=S) +wishart_output <- lapply( + c(4.5, 8.2, 10.0), + function(nu, X, S) { + cat("Wishart(", nu, ", S)\n", sep="") + lpdf <- StanHeaders::stanFunction("wishart_lpdf", W=X, nu=nu, S=S) + list("dims" = dim(S), + "params" = list(nu, c(S)), + "X" = c(X), + "lpdf" = lpdf) + }, + X, + S +) +jsonlite::write_json(wishart_output, "jsonfiles/Wishart_stan_output.json", digits = 20, pretty = TRUE) diff --git a/test/ref/matrixvariates/jsonfiles/InverseWishart_stan_output.json b/test/ref/matrixvariates/jsonfiles/InverseWishart_stan_output.json index b2623a3c96..a9c0f001ef 100644 --- a/test/ref/matrixvariates/jsonfiles/InverseWishart_stan_output.json +++ b/test/ref/matrixvariates/jsonfiles/InverseWishart_stan_output.json @@ -5,17 +5,17 @@ [4.5], [1, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 1] ], - "X": [1.80115497975516, 1.39357092294611, 0.679396397136899, 1.39357092294611, 1.32682592836847, 0.624106043062951, 0.679396397136899, 0.624106043062951, 0.431228950208813], - "lpdf": [-0.598439090738466] + "X": [0.48516264401941139, 0.21974036159989954, -0.13995828882732522, 0.21974036159989954, 0.28855250002048116, -0.23735060033573027, -0.13995828882732522, -0.23735060033573027, 0.61858504476347143], + "lpdf": [-0.092239036945123282] }, { "dims": [3, 3], "params": [ - [8.2], + [8.1999999999999993], [1, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 1] ], - "X": [1.80115497975516, 1.39357092294611, 0.679396397136899, 1.39357092294611, 1.32682592836847, 0.624106043062951, 0.679396397136899, 0.624106043062951, 0.431228950208813], - "lpdf": [-4.62691092488684] + "X": [0.48516264401941139, 0.21974036159989954, -0.13995828882732522, 0.21974036159989954, 0.28855250002048116, -0.23735060033573027, -0.13995828882732522, -0.23735060033573027, 0.61858504476347143], + "lpdf": [-3.2653125076426002] }, { "dims": [3, 3], @@ -23,7 +23,7 @@ [10], [1, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 1] ], - "X": [1.80115497975516, 1.39357092294611, 0.679396397136899, 1.39357092294611, 1.32682592836847, 0.624106043062951, 0.679396397136899, 0.624106043062951, 0.431228950208813], - "lpdf": [-8.00783683273594] + "X": [0.48516264401941139, 0.21974036159989954, -0.13995828882732522, 0.21974036159989954, 0.28855250002048116, -0.23735060033573027, -0.13995828882732522, -0.23735060033573027, 0.61858504476347143], + "lpdf": [-6.2300986711101807] } ] diff --git a/test/ref/matrixvariates/jsonfiles/LKJ_stan_output.json b/test/ref/matrixvariates/jsonfiles/LKJ_stan_output.json index 4a8c8552bd..61fb11b157 100644 --- a/test/ref/matrixvariates/jsonfiles/LKJ_stan_output.json +++ b/test/ref/matrixvariates/jsonfiles/LKJ_stan_output.json @@ -5,8 +5,8 @@ [3], [0.5] ], - "X": [1, -0.709732768016743, 0.185058141141117, -0.709732768016743, 1, -0.21936085645571, 0.185058141141117, -0.21936085645571, 1], - "lpdf": [-2.15514455393051] + "X": [1, -0.79005766518733023, 0.6584355279748646, -0.79005766518733023, 1, -0.28585073615308054, 0.6584355279748646, -0.28585073615308054, 1], + "lpdf": [-1.6083212216896539] }, { "dims": [3, 3], @@ -14,16 +14,16 @@ [3], [1] ], - "X": [1, -0.709732768016743, 0.185058141141117, -0.709732768016743, 1, -0.21936085645571, 0.185058141141117, -0.21936085645571, 1], - "lpdf": [-1.59631259113885] + "X": [1, -0.79005766518733023, 0.6584355279748646, -0.79005766518733023, 1, -0.28585073615308054, 0.6584355279748646, -0.28585073615308054, 1], + "lpdf": [-1.5963125911388549] }, { "dims": [3, 3], "params": [ [3], - [3.4] + [3.3999999999999999] ], - "X": [1, -0.709732768016743, 0.185058141141117, -0.709732768016743, 1, -0.21936085645571, 0.185058141141117, -0.21936085645571, 1], - "lpdf": [-1.649018779555] + "X": [1, -0.79005766518733023, 0.6584355279748646, -0.79005766518733023, 1, -0.28585073615308054, 0.6584355279748646, -0.28585073615308054, 1], + "lpdf": [-4.2737707743111226] } ] diff --git a/test/ref/matrixvariates/jsonfiles/Wishart_stan_output.json b/test/ref/matrixvariates/jsonfiles/Wishart_stan_output.json index c7be190f5e..24d3ef7e1d 100644 --- a/test/ref/matrixvariates/jsonfiles/Wishart_stan_output.json +++ b/test/ref/matrixvariates/jsonfiles/Wishart_stan_output.json @@ -5,17 +5,17 @@ [4.5], [1, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 1] ], - "X": [1.99999655903368, -0.167167443909772, 0.295135013769298, -0.167167443909772, 1.34195749133266, -0.951505045533196, 0.295135013769298, -0.951505045533196, 2.23638578347992], - "lpdf": [-9.0208647061427] + "X": [2.1238570240663197, 0.071955484479861234, 0.69638007386022283, 0.071955484479861234, 2.8508093708294711, 3.7133257194793665, 0.69638007386022283, 3.7133257194793665, 6.0856783341791498], + "lpdf": [-10.364174627378341] }, { "dims": [3, 3], "params": [ - [8.2], + [8.1999999999999993], [1, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 1] ], - "X": [1.99999655903368, -0.167167443909772, 0.295135013769298, -0.167167443909772, 1.34195749133266, -0.951505045533196, 0.295135013769298, -0.951505045533196, 2.23638578347992], - "lpdf": [-13.0493365402911] + "X": [2.1238570240663197, 0.071955484479861234, 0.69638007386022283, 0.071955484479861234, 2.8508093708294711, 3.7133257194793665, 0.69638007386022283, 3.7133257194793665, 6.0856783341791498], + "lpdf": [-13.537248098075816] }, { "dims": [3, 3], @@ -23,7 +23,7 @@ [10], [1, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 1] ], - "X": [1.99999655903368, -0.167167443909772, 0.295135013769298, -0.167167443909772, 1.34195749133266, -0.951505045533196, 0.295135013769298, -0.951505045533196, 2.23638578347992], - "lpdf": [-16.4302624481402] + "X": [2.1238570240663197, 0.071955484479861234, 0.69638007386022283, 0.071955484479861234, 2.8508093708294711, 3.7133257194793665, 0.69638007386022283, 3.7133257194793665, 6.0856783341791498], + "lpdf": [-16.502034261543393] } ] diff --git a/test/ref/matrixvariates/scripts/inversewishart.R b/test/ref/matrixvariates/scripts/inversewishart.R deleted file mode 100644 index 143bea865a..0000000000 --- a/test/ref/matrixvariates/scripts/inversewishart.R +++ /dev/null @@ -1,31 +0,0 @@ -library(rstan) -library(jsonlite) - -invwishart <- - ' - functions { - real inv_wish_lpdf(matrix W, real nu, matrix Sigma) { - return inv_wishart_lpdf(W | nu, Sigma); - } - matrix inv_wish_rng(real nu, matrix Sigma) { - return inv_wishart_rng(nu, Sigma); - } -} -' -expose_stan_functions(stanc(model_code = invwishart)) - -set.seed(8675309) -S <- matrix(c(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0), 3, 3) -d <- nrow(S) -X <- inv_wish_rng(4, S) -dfs <- c(4.5, 8.2, 10.0) -K <- length(dfs) -invwishart_output <- vector(mode = "list", length = K) -for (i in 1:K){ - lpdf <- inv_wish_lpdf(X, dfs[i], S) - invwishart_output[[i]] <- list("dims" = c(d, d), - "params" = list(dfs[i], c(S)), - "X" = c(X), - "lpdf" = lpdf) -} -write_json(invwishart_output, "jsonfiles/InverseWishart_stan_output.json", digits = 20, pretty = TRUE) diff --git a/test/ref/matrixvariates/scripts/lkj.R b/test/ref/matrixvariates/scripts/lkj.R deleted file mode 100644 index 6ce5ea6529..0000000000 --- a/test/ref/matrixvariates/scripts/lkj.R +++ /dev/null @@ -1,30 +0,0 @@ -library(rstan) -library(jsonlite) - -lkj <- - ' - functions { - real lkj_cor_lpdf(matrix y, real eta) { - return lkj_corr_lpdf(y | eta); - } - matrix lkj_cor_rng(int K, real eta) { - return lkj_corr_rng(K, eta); - } -} -' -expose_stan_functions(stanc(model_code = lkj)) - -set.seed(8675309) -d <- 3 -X <- lkj_cor_rng(d, 1) -shapes <- c(0.5, 1.0, 3.4) -K <- length(shapes) -lkj_output <- vector(mode = "list", length = K) -for (i in 1:K){ - lpdf <- lkj_cor_lpdf(X, shapes[i]) - lkj_output[[i]] <- list("dims" = c(d, d), - "params" = list(d, shapes[i]), - "X" = c(X), - "lpdf" = lpdf) -} -write_json(lkj_output, "jsonfiles/LKJ_stan_output.json", digits = 20, pretty = TRUE) diff --git a/test/ref/matrixvariates/scripts/wishart.R b/test/ref/matrixvariates/scripts/wishart.R deleted file mode 100644 index 27d20cf5c0..0000000000 --- a/test/ref/matrixvariates/scripts/wishart.R +++ /dev/null @@ -1,31 +0,0 @@ -library(rstan) -library(jsonlite) - -wishart <- - ' - functions { - real wish_lpdf(matrix W, real nu, matrix Sigma) { - return wishart_lpdf(W | nu, Sigma); - } - matrix wish_rng(real nu, matrix Sigma) { - return wishart_rng(nu, Sigma); - } -} -' -expose_stan_functions(stanc(model_code = wishart)) - -set.seed(8675309) -S <- matrix(c(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0), 3, 3) -d <- nrow(S) -X <- wish_rng(4, S) -dfs <- c(4.5, 8.2, 10.0) -K <- length(dfs) -wishart_output <- vector(mode = "list", length = K) -for (i in 1:K){ - lpdf <- wish_lpdf(X, dfs[i], S) - wishart_output[[i]] <- list("dims" = c(d, d), - "params" = list(dfs[i], c(S)), - "X" = c(X), - "lpdf" = lpdf) -} -write_json(wishart_output, "jsonfiles/Wishart_stan_output.json", digits = 20, pretty = TRUE) diff --git a/test/ref/rdistributions.R b/test/ref/rdistributions.R index 53623544ba..ba35800470 100644 --- a/test/ref/rdistributions.R +++ b/test/ref/rdistributions.R @@ -1,7 +1,6 @@ # R6 classes for representing distributions in R library(R6) -library(extraDistr) ################################################# # diff --git a/test/ref/readme.md b/test/ref/readme.md index 7ae82d5d2e..623fbe016d 100644 --- a/test/ref/readme.md +++ b/test/ref/readme.md @@ -7,25 +7,12 @@ for verifying the correctness of our implementations. ## Dependencies -The reference implementation depends on several R packages -in addition to the R language itself: - -| R packages | Functionalities | -| ----------- | ---------------- | -| stringr | For string parsing | -| R6 | OOP for implementing distributions | -| extraDistr | A number of distributions | -| VGAM | For ``Frechet`` and ``Levy`` | -| distr | For ``Arcsine`` | -| chi | For ``Chi`` | -| circular | For ``VonMises`` | -| statmod | For ``InverseGaussian`` | -| skellam | For ``Skellam`` | -| BiasedUrn | For ``NoncentralHypergeometric`` | -| fBasics | For ``NormalInverseGaussian`` | -| gnorm | For ``PGeneralizedGaussian`` | -| LindleyR | For ``Lindley`` | -| ExtDist | For ``JohnsonSU`` | +The reference implementation depends on several R packages in addition to the R language itself. +To install these dependencies, open `R` in this folder and run: + +```r +renv::restore() +``` ## Usage @@ -33,7 +20,12 @@ All reference classes are in ``test/ref/continuous`` and ``test/ref/discrete``. The test entries are listed in ``test/ref/continuous_test.lst`` and ``test/ref/discrete_test.lst``. Each entry is a Julia statement for constructing a distribution. The entries can be commented out using ``#``. -One can enter ``Rscript gendref.R`` **within the directory** ``test/ref`` to generate the reference data files: ``test/ref/continuous_test.ref.json`` and ``test/ref/discrete_test.ref.json``. +To generate the reference data files: ``test/ref/continuous_test.ref.json`` and ``test/ref/discrete_test.ref.json``, +open a terminal, navigate to this directory and run + +```shell +Rscript gendref.R +``` The testing script ``test/univariate.jl`` loads these reference data files to verify the implementations of Julia distribution classes. @@ -108,17 +100,20 @@ When the testing script sees an entry ``Normal(3, 2)``, it will call the R expression ``Normal$new(3, 2)`` to construct a reference distribution for verification. -### Mock Constructors +### Alternative Parameterizations For certain distributions, Julia provides alternative ways to construct them, -using different parameterization, *e.g.* ``NormalCanon``. -For such cases, one can write a *mock* constructor -- a list with a ``new`` function -to emulate the behavior: +possibly using different parameterization, *e.g.* ``NormalCanon``. +For such cases, one can define the alternative reference distribution as a subclass, +possibly with a different ``initialize`` function: ```r -NormalCanon = list( - new = function(c1=0, c2=1) { - Normal$new(c1/c2, 1/sqrt(c2)) - } +NormalCanon = R6Class("NormalCanon", + inherit = Normal, + public = list( + initialize = function(c1=0, c2=1) { + super$initialize(c1/c2, 1/sqrt(c2)) + } + ) ) ``` diff --git a/test/ref/renv.lock b/test/ref/renv.lock new file mode 100644 index 0000000000..1e520649f8 --- /dev/null +++ b/test/ref/renv.lock @@ -0,0 +1,1386 @@ +{ + "R": { + "Version": "4.5.1", + "Repositories": [ + { + "Name": "CRAN", + "URL": "https://mirror.accum.se/mirror/CRAN" + } + ] + }, + "Packages": { + "BiasedUrn": { + "Package": "BiasedUrn", + "Version": "2.0.12", + "Source": "Repository", + "Type": "Package", + "Title": "Biased Urn Model Distributions", + "Date": "2024-06-16", + "Author": "Agner Fog", + "Maintainer": "Agner Fog ", + "Description": "Statistical models of biased sampling in the form of univariate and multivariate noncentral hypergeometric distributions, including Wallenius' noncentral hypergeometric distribution and Fisher's noncentral hypergeometric distribution. See vignette(\"UrnTheory\") for explanation of these distributions. Literature: Fog, A. (2008a). Calculation Methods for Wallenius' Noncentral Hypergeometric Distribution, Communications in Statistics, Simulation and Computation, 37(2) . Fog, A. (2008b). Sampling methods for Wallenius’ and Fisher’s noncentral hypergeometric distributions, Communications in Statistics—Simulation and Computation, 37(2) .", + "License": "GPL-3", + "Encoding": "UTF-8", + "URL": "https://www.agner.org/random/ https://www.r-project.org/", + "NeedsCompilation": "yes", + "Repository": "CRAN" + }, + "ExtDist": { + "Package": "ExtDist", + "Version": "0.7-4", + "Source": "Repository", + "License": "GPL (>= 2)", + "Title": "Extending the Range of Functions for Probability Distributions", + "Description": "A consistent, unified and extensible framework for estimation of parameters for probability distributions, including parameter estimation procedures that allow for weighted samples; the current set of distributions included are: the standard beta, The four-parameter beta, Burr, gamma, Gumbel, Johnson SB and SU, Laplace, logistic, normal, symmetric truncated normal, truncated normal, symmetric-reflected truncated beta, standard symmetric-reflected truncated beta, triangular, uniform, and Weibull distributions; decision criteria and selections based on these decision criteria.", + "Repository": "CRAN", + "Authors@R": "c(person(given = \"Haizhen\", family = \"Wu\", role = \"aut\", email = \"h.wu2@massey.ac.nz\"), person(given = c(\"A.\", \"Jonathan\", \"R.\"), family = \"Godfrey\", role = \"aut\", email = \"A.J.Godfrey@massey.ac.nz\"), person(given = \"Kondaswamy\", family = \"Govindaraju\", role = \"aut\", email = \"k.govindaraju@massey.ac.nz\"), person(given = \"Sarah\", family = \"Pirikahu\", role = \"aut\", email = \"s.pirikahu@massey.ac.nz\"), person(given = \"Oleksii\", family = \"Nikolaienko\", role = c(\"cre\", \"ctb\"), email = \"oleksii.nikolaienko@gmail.com\"))", + "URL": "https://github.com/oleksii-nikolaienko/ExtDist", + "BugReports": "https://github.com/oleksii-nikolaienko/ExtDist/issues", + "Imports": [ + "numDeriv", + "optimx" + ], + "Suggests": [ + "ggplot2", + "knitr", + "PerformanceAnalytics", + "stats", + "SuppDists", + "truncdist", + "VGAM", + "xtable", + "graphics", + "utils", + "rmarkdown" + ], + "VignetteBuilder": "knitr", + "NeedsCompilation": "no", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3", + "Author": "Haizhen Wu [aut], A. Jonathan R. Godfrey [aut], Kondaswamy Govindaraju [aut], Sarah Pirikahu [aut], Oleksii Nikolaienko [cre, ctb]", + "Maintainer": "Oleksii Nikolaienko " + }, + "MASS": { + "Package": "MASS", + "Version": "7.3-65", + "Source": "Repository", + "Priority": "recommended", + "Date": "2025-02-19", + "Revision": "$Rev: 3681 $", + "Depends": [ + "R (>= 4.4.0)", + "grDevices", + "graphics", + "stats", + "utils" + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "lattice", + "nlme", + "nnet", + "survival" + ], + "Authors@R": "c(person(\"Brian\", \"Ripley\", role = c(\"aut\", \"cre\", \"cph\"), email = \"Brian.Ripley@R-project.org\"), person(\"Bill\", \"Venables\", role = c(\"aut\", \"cph\")), person(c(\"Douglas\", \"M.\"), \"Bates\", role = \"ctb\"), person(\"Kurt\", \"Hornik\", role = \"trl\", comment = \"partial port ca 1998\"), person(\"Albrecht\", \"Gebhardt\", role = \"trl\", comment = \"partial port ca 1998\"), person(\"David\", \"Firth\", role = \"ctb\", comment = \"support functions for polr\"))", + "Description": "Functions and datasets to support Venables and Ripley, \"Modern Applied Statistics with S\" (4th edition, 2002).", + "Title": "Support Functions and Datasets for Venables and Ripley's MASS", + "LazyData": "yes", + "ByteCompile": "yes", + "License": "GPL-2 | GPL-3", + "URL": "http://www.stats.ox.ac.uk/pub/MASS4/", + "Contact": "", + "NeedsCompilation": "yes", + "Author": "Brian Ripley [aut, cre, cph], Bill Venables [aut, cph], Douglas M. Bates [ctb], Kurt Hornik [trl] (partial port ca 1998), Albrecht Gebhardt [trl] (partial port ca 1998), David Firth [ctb] (support functions for polr)", + "Maintainer": "Brian Ripley ", + "Repository": "CRAN" + }, + "R6": { + "Package": "R6", + "Version": "2.6.1", + "Source": "Repository", + "Title": "Encapsulated Classes with Reference Semantics", + "Authors@R": "c( person(\"Winston\", \"Chang\", , \"winston@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Creates classes with reference semantics, similar to R's built-in reference classes. Compared to reference classes, R6 classes are simpler and lighter-weight, and they are not built on S4 classes so they do not require the methods package. These classes allow public and private members, and they support inheritance, even when the classes are defined in different packages.", + "License": "MIT + file LICENSE", + "URL": "https://r6.r-lib.org, https://github.com/r-lib/R6", + "BugReports": "https://github.com/r-lib/R6/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Suggests": [ + "lobstr", + "testthat (>= 3.0.0)" + ], + "Config/Needs/website": "tidyverse/tidytemplate, ggplot2, microbenchmark, scales", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Winston Chang [aut, cre], Posit Software, PBC [cph, fnd]", + "Maintainer": "Winston Chang ", + "Repository": "CRAN" + }, + "Rcpp": { + "Package": "Rcpp", + "Version": "1.1.0", + "Source": "Repository", + "Title": "Seamless R and C++ Integration", + "Date": "2025-07-01", + "Authors@R": "c(person(\"Dirk\", \"Eddelbuettel\", role = c(\"aut\", \"cre\"), email = \"edd@debian.org\", comment = c(ORCID = \"0000-0001-6419-907X\")), person(\"Romain\", \"Francois\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"JJ\", \"Allaire\", role = \"aut\", comment = c(ORCID = \"0000-0003-0174-9868\")), person(\"Kevin\", \"Ushey\", role = \"aut\", comment = c(ORCID = \"0000-0003-2880-7407\")), person(\"Qiang\", \"Kou\", role = \"aut\", comment = c(ORCID = \"0000-0001-6786-5453\")), person(\"Nathan\", \"Russell\", role = \"aut\"), person(\"Iñaki\", \"Ucar\", role = \"aut\", comment = c(ORCID = \"0000-0001-6403-5550\")), person(\"Doug\", \"Bates\", role = \"aut\", comment = c(ORCID = \"0000-0001-8316-9503\")), person(\"John\", \"Chambers\", role = \"aut\"))", + "Description": "The 'Rcpp' package provides R functions as well as C++ classes which offer a seamless integration of R and C++. Many R data types and objects can be mapped back and forth to C++ equivalents which facilitates both writing of new code as well as easier integration of third-party libraries. Documentation about 'Rcpp' is provided by several vignettes included in this package, via the 'Rcpp Gallery' site at , the paper by Eddelbuettel and Francois (2011, ), the book by Eddelbuettel (2013, ) and the paper by Eddelbuettel and Balamuta (2018, ); see 'citation(\"Rcpp\")' for details.", + "Imports": [ + "methods", + "utils" + ], + "Suggests": [ + "tinytest", + "inline", + "rbenchmark", + "pkgKitten (>= 0.1.2)" + ], + "URL": "https://www.rcpp.org, https://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp", + "License": "GPL (>= 2)", + "BugReports": "https://github.com/RcppCore/Rcpp/issues", + "MailingList": "rcpp-devel@lists.r-forge.r-project.org", + "RoxygenNote": "6.1.1", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Dirk Eddelbuettel [aut, cre] (ORCID: ), Romain Francois [aut] (ORCID: ), JJ Allaire [aut] (ORCID: ), Kevin Ushey [aut] (ORCID: ), Qiang Kou [aut] (ORCID: ), Nathan Russell [aut], Iñaki Ucar [aut] (ORCID: ), Doug Bates [aut] (ORCID: ), John Chambers [aut]", + "Maintainer": "Dirk Eddelbuettel ", + "Repository": "CRAN" + }, + "RcppEigen": { + "Package": "RcppEigen", + "Version": "0.3.4.0.2", + "Source": "Repository", + "Type": "Package", + "Title": "'Rcpp' Integration for the 'Eigen' Templated Linear Algebra Library", + "Date": "2024-08-23", + "Authors@R": "c(person(\"Doug\", \"Bates\", role = \"aut\", comment = c(ORCID = \"0000-0001-8316-9503\")), person(\"Dirk\", \"Eddelbuettel\", role = c(\"aut\", \"cre\"), email = \"edd@debian.org\", comment = c(ORCID = \"0000-0001-6419-907X\")), person(\"Romain\", \"Francois\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"Yixuan\", \"Qiu\", role = \"aut\", comment = c(ORCID = \"0000-0003-0109-6692\")), person(\"Authors of\", \"Eigen\", role = \"cph\", comment = \"Authorship and copyright in included Eigen library as detailed in inst/COPYRIGHTS\"))", + "Copyright": "See the file COPYRIGHTS for various Eigen copyright details", + "Description": "R and 'Eigen' integration using 'Rcpp'. 'Eigen' is a C++ template library for linear algebra: matrices, vectors, numerical solvers and related algorithms. It supports dense and sparse matrices on integer, floating point and complex numbers, decompositions of such matrices, and solutions of linear systems. Its performance on many algorithms is comparable with some of the best implementations based on 'Lapack' and level-3 'BLAS'. The 'RcppEigen' package includes the header files from the 'Eigen' C++ template library. Thus users do not need to install 'Eigen' itself in order to use 'RcppEigen'. Since version 3.1.1, 'Eigen' is licensed under the Mozilla Public License (version 2); earlier version were licensed under the GNU LGPL version 3 or later. 'RcppEigen' (the 'Rcpp' bindings/bridge to 'Eigen') is licensed under the GNU GPL version 2 or later, as is the rest of 'Rcpp'.", + "License": "GPL (>= 2) | file LICENSE", + "LazyLoad": "yes", + "Depends": [ + "R (>= 3.6.0)" + ], + "LinkingTo": [ + "Rcpp" + ], + "Imports": [ + "Rcpp (>= 0.11.0)", + "stats", + "utils" + ], + "Suggests": [ + "Matrix", + "inline", + "tinytest", + "pkgKitten", + "microbenchmark" + ], + "URL": "https://github.com/RcppCore/RcppEigen, https://dirk.eddelbuettel.com/code/rcpp.eigen.html", + "BugReports": "https://github.com/RcppCore/RcppEigen/issues", + "NeedsCompilation": "yes", + "Author": "Doug Bates [aut] (), Dirk Eddelbuettel [aut, cre] (), Romain Francois [aut] (), Yixuan Qiu [aut] (), Authors of Eigen [cph] (Authorship and copyright in included Eigen library as detailed in inst/COPYRIGHTS)", + "Maintainer": "Dirk Eddelbuettel ", + "Repository": "CRAN" + }, + "RcppParallel": { + "Package": "RcppParallel", + "Version": "5.1.11-1", + "Source": "Repository", + "Type": "Package", + "Title": "Parallel Programming Tools for 'Rcpp'", + "Authors@R": "c( person(\"JJ\", \"Allaire\", role = c(\"aut\"), email = \"jj@rstudio.com\"), person(\"Romain\", \"Francois\", role = c(\"aut\", \"cph\")), person(\"Kevin\", \"Ushey\", role = c(\"aut\", \"cre\"), email = \"kevin@rstudio.com\"), person(\"Gregory\", \"Vandenbrouck\", role = \"aut\"), person(\"Marcus\", \"Geelnard\", role = c(\"aut\", \"cph\"), comment = \"TinyThread library, https://tinythreadpp.bitsnbites.eu/\"), person(\"Hamada S.\", \"Badr\", email = \"badr@jhu.edu\", role = c(\"ctb\"), comment = c(ORCID = \"0000-0002-9808-2344\")), person(family = \"Posit, PBC\", role = \"cph\"), person(family = \"Intel\", role = c(\"aut\", \"cph\"), comment = \"Intel TBB library, https://www.threadingbuildingblocks.org/\"), person(family = \"Microsoft\", role = \"cph\") )", + "Description": "High level functions for parallel programming with 'Rcpp'. For example, the 'parallelFor()' function can be used to convert the work of a standard serial \"for\" loop into a parallel one and the 'parallelReduce()' function can be used for accumulating aggregate or other values.", + "Depends": [ + "R (>= 3.0.2)" + ], + "Suggests": [ + "Rcpp", + "RUnit", + "knitr", + "rmarkdown" + ], + "SystemRequirements": "GNU make, Intel TBB, Windows: cmd.exe and cscript.exe, Solaris: g++ is required", + "License": "GPL (>= 3)", + "URL": "https://rcppcore.github.io/RcppParallel/, https://github.com/RcppCore/RcppParallel", + "BugReports": "https://github.com/RcppCore/RcppParallel/issues", + "Biarch": "TRUE", + "RoxygenNote": "7.1.1", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "JJ Allaire [aut], Romain Francois [aut, cph], Kevin Ushey [aut, cre], Gregory Vandenbrouck [aut], Marcus Geelnard [aut, cph] (TinyThread library, https://tinythreadpp.bitsnbites.eu/), Hamada S. Badr [ctb] (ORCID: ), Posit, PBC [cph], Intel [aut, cph] (Intel TBB library, https://www.threadingbuildingblocks.org/), Microsoft [cph]", + "Maintainer": "Kevin Ushey ", + "Repository": "CRAN" + }, + "StanHeaders": { + "Package": "StanHeaders", + "Version": "2.32.10", + "Source": "Repository", + "Title": "C++ Header Files for Stan", + "Authors@R": "c(person(\"Ben\",family=\"Goodrich\", email=\"benjamin.goodrich@columbia.edu\", role=c('cre','aut')), person(\"Joshua\", \"Pritikin\", role = \"ctb\"), person(\"Andrew\", \"Gelman\", role = \"aut\"), person(\"Bob\", \"Carpenter\", role = \"aut\"), person(\"Matt\", \"Hoffman\", role = \"aut\"), person(\"Daniel\", \"Lee\", role = \"aut\"), person(\"Michael\", \"Betancourt\", role = \"aut\"), person(\"Marcus\", \"Brubaker\", role = \"aut\"), person(\"Jiqiang\", \"Guo\", role = \"aut\"), person(\"Peter\", \"Li\", role = \"aut\"), person(\"Allen\", \"Riddell\", role = \"aut\"), person(\"Marco\", \"Inacio\", role = \"aut\"), person(\"Mitzi\", \"Morris\", role = \"aut\"), person(\"Jeffrey\", \"Arnold\", role = \"aut\"), person(\"Rob\", \"Goedman\", role = \"aut\"), person(\"Brian\", \"Lau\", role = \"aut\"), person(\"Rob\", \"Trangucci\", role = \"aut\"), person(\"Jonah\", \"Gabry\", role = \"aut\"), person(\"Alp\", \"Kucukelbir\", role = \"aut\"), person(\"Robert\", \"Grant\", role = \"aut\"), person(\"Dustin\", \"Tran\", role = \"aut\"), person(\"Michael\", \"Malecki\", role = \"aut\"), person(\"Yuanjun\", \"Gao\", role = \"aut\"), person(\"Hamada S.\", \"Badr\", role = c(\"aut\"), email = \"badr@jhu.edu\", comment = c(ORCID = \"0000-0002-9808-2344\")), person(\"Trustees of\", \"Columbia University\", role = \"cph\"), person(\"Lawrence Livermore\", \"National Security\", role = \"cph\", comment = \"CVODES\"), person(\"The Regents of the\", \"University of California\", role = \"cph\", comment = \"CVODES\"), person(\"Southern Methodist\", \"University\", role = \"cph\", comment = \"CVODES\"))", + "URL": "https://mc-stan.org/", + "Description": "The C++ header files of the Stan project are provided by this package, but it contains little R code or documentation. The main reference is the vignette. There is a shared object containing part of the 'CVODES' library, but its functionality is not accessible from R. 'StanHeaders' is primarily useful for developers who want to utilize the 'LinkingTo' directive of their package's DESCRIPTION file to build on the Stan library without incurring unnecessary dependencies. The Stan project develops a probabilistic programming language that implements full or approximate Bayesian statistical inference via Markov Chain Monte Carlo or 'variational' methods and implements (optionally penalized) maximum likelihood estimation via optimization. The Stan library includes an advanced automatic differentiation scheme, 'templated' statistical and linear algebra functions that can handle the automatically 'differentiable' scalar types (and doubles, 'ints', etc.), and a parser for the Stan language. The 'rstan' package provides user-facing R functions to parse, compile, test, estimate, and analyze Stan models.", + "Imports": [ + "RcppParallel (>= 5.1.4)" + ], + "Suggests": [ + "Rcpp", + "BH (>= 1.75.0-0)", + "knitr (>= 1.36)", + "rmarkdown", + "Matrix", + "methods", + "rstan", + "withr" + ], + "LinkingTo": [ + "RcppEigen (>= 0.3.4.0.0)", + "RcppParallel (>= 5.1.4)" + ], + "VignetteBuilder": "knitr", + "SystemRequirements": "GNU make, pandoc", + "Depends": [ + "R (>= 3.4.0)" + ], + "License": "BSD_3_clause + file LICENSE", + "Encoding": "UTF-8", + "RoxygenNote": "7.1.2", + "NeedsCompilation": "yes", + "Author": "Ben Goodrich [cre, aut], Joshua Pritikin [ctb], Andrew Gelman [aut], Bob Carpenter [aut], Matt Hoffman [aut], Daniel Lee [aut], Michael Betancourt [aut], Marcus Brubaker [aut], Jiqiang Guo [aut], Peter Li [aut], Allen Riddell [aut], Marco Inacio [aut], Mitzi Morris [aut], Jeffrey Arnold [aut], Rob Goedman [aut], Brian Lau [aut], Rob Trangucci [aut], Jonah Gabry [aut], Alp Kucukelbir [aut], Robert Grant [aut], Dustin Tran [aut], Michael Malecki [aut], Yuanjun Gao [aut], Hamada S. Badr [aut] (), Trustees of Columbia University [cph], Lawrence Livermore National Security [cph] (CVODES), The Regents of the University of California [cph] (CVODES), Southern Methodist University [cph] (CVODES)", + "Maintainer": "Ben Goodrich ", + "Repository": "CRAN" + }, + "VGAM": { + "Package": "VGAM", + "Version": "1.1-13", + "Source": "Repository", + "Date": "2025-02-11", + "Title": "Vector Generalized Linear and Additive Models", + "Authors@R": "c(person(\"Thomas\", \"Yee\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-9970-3907\"), email = \"t.yee@auckland.ac.nz\"), person(\"Cleve\", \"Moler\", role = \"ctb\", comment = \"LINPACK routines in src\"))", + "Author": "Thomas Yee [aut, cre] (), Cleve Moler [ctb] (LINPACK routines in src)", + "Maintainer": "Thomas Yee ", + "Depends": [ + "R (>= 4.1.0)", + "methods", + "stats", + "stats4", + "splines" + ], + "Suggests": [ + "VGAMextra", + "MASS", + "mgcv" + ], + "Enhances": [ + "VGAMdata" + ], + "Description": "An implementation of about 6 major classes of statistical regression models. The central algorithm is Fisher scoring and iterative reweighted least squares. At the heart of this package are the vector generalized linear and additive model (VGLM/VGAM) classes. VGLMs can be loosely thought of as multivariate GLMs. VGAMs are data-driven VGLMs that use smoothing. The book \"Vector Generalized Linear and Additive Models: With an Implementation in R\" (Yee, 2015) gives details of the statistical framework and the package. Currently only fixed-effects models are implemented. Many (100+) models and distributions are estimated by maximum likelihood estimation (MLE) or penalized MLE. The other classes are RR-VGLMs (reduced-rank VGLMs), quadratic RR-VGLMs, doubly constrained RR-VGLMs, quadratic RR-VGLMs, reduced-rank VGAMs, RCIMs (row-column interaction models)---these classes perform constrained and unconstrained quadratic ordination (CQO/UQO) models in ecology, as well as constrained additive ordination (CAO). Hauck-Donner effect detection is implemented. Note that these functions are subject to change; see the NEWS and ChangeLog files for latest changes.", + "License": "GPL-3", + "URL": "https://www.stat.auckland.ac.nz/~yee/VGAM/", + "NeedsCompilation": "yes", + "BuildVignettes": "yes", + "LazyLoad": "yes", + "LazyData": "yes", + "Repository": "CRAN" + }, + "boot": { + "Package": "boot", + "Version": "1.3-31", + "Source": "Repository", + "Priority": "recommended", + "Date": "2024-08-28", + "Authors@R": "c(person(\"Angelo\", \"Canty\", role = \"aut\", email = \"cantya@mcmaster.ca\", comment = \"author of original code for S\"), person(\"Brian\", \"Ripley\", role = c(\"aut\", \"trl\"), email = \"ripley@stats.ox.ac.uk\", comment = \"conversion to R, maintainer 1999--2022, author of parallel support\"), person(\"Alessandra R.\", \"Brazzale\", role = c(\"ctb\", \"cre\"), email = \"brazzale@stat.unipd.it\", comment = \"minor bug fixes\"))", + "Maintainer": "Alessandra R. Brazzale ", + "Note": "Maintainers are not available to give advice on using a package they did not author.", + "Description": "Functions and datasets for bootstrapping from the book \"Bootstrap Methods and Their Application\" by A. C. Davison and D. V. Hinkley (1997, CUP), originally written by Angelo Canty for S.", + "Title": "Bootstrap Functions (Originally by Angelo Canty for S)", + "Depends": [ + "R (>= 3.0.0)", + "graphics", + "stats" + ], + "Suggests": [ + "MASS", + "survival" + ], + "LazyData": "yes", + "ByteCompile": "yes", + "License": "Unlimited", + "NeedsCompilation": "no", + "Author": "Angelo Canty [aut] (author of original code for S), Brian Ripley [aut, trl] (conversion to R, maintainer 1999--2022, author of parallel support), Alessandra R. Brazzale [ctb, cre] (minor bug fixes)", + "Repository": "CRAN" + }, + "chi": { + "Package": "chi", + "Version": "0.1", + "Source": "Repository", + "Type": "Package", + "Title": "The Chi Distribution", + "URL": "https://github.com/dkahle/chi", + "BugReports": "https://github.com/dkahle/chi/issues", + "Authors@R": "person(\"David\", \"Kahle\", email = \"david.kahle@gmail.com\", role = c(\"aut\", \"cre\", \"cph\"))", + "Description": "Light weight implementation of the standard distribution functions for the chi distribution, wrapping those for the chi-squared distribution in the stats package.", + "License": "GPL-2", + "RoxygenNote": "6.0.1", + "NeedsCompilation": "no", + "Author": "David Kahle [aut, cre, cph]", + "Maintainer": "David Kahle ", + "Repository": "CRAN" + }, + "circular": { + "Package": "circular", + "Version": "0.5-2", + "Source": "Repository", + "Title": "Circular Statistics", + "LazyLoad": "yes", + "Authors@R": "c( person(given = \"Ulric\", family = \"Lund\", role = \"aut\", email = \"ulund@calpoly.edu\"), person(given = \"Claudio\", family = \"Agostinelli\", role = \"aut\", email = \"claudio.agostinelli@unitn.it\", comment = c(ORCID = \"0000-0001-6702-4312\")), person(given = \"Hiroyoshi\", family = \"Arai\", role = \"ctb\", email = \"h_arai@aoni.waseda.jp\"), person(given = \"Alessando\", family = \"Gagliardi\", role = \"ctb\", email = \"gagliardi@stud.unive.it\"), person(given = \"Eduardo\", family = \"García-Portugués\", role = c(\"ctb\", \"cre\"), email = \"edgarcia@est-econ.uc3m.es\", comment = c(ORCID = \"0000-0002-9224-4111\")), person(given = \"Dimitri\", family = \"Giunchi\", role = \"ctb\", email = \"dimitri.giunchi@unipi.it\"), person(given = \"Jean-Olivier\", family = \"Irisson\", role = \"ctb\", email = \"irisson@normalesup.org\"), person(given = \"Matthew\", family = \"Pocernich\", role = \"ctb\", email = \"pocernic@ucar.edu\"), person(given = \"Federico\", family = \"Rotolo\", role = \"ctb\"))", + "Date": "2025-09-24", + "Depends": [ + "R (>= 3.0.0)", + "stats" + ], + "Imports": [ + "boot", + "mvtnorm" + ], + "Description": "Circular Statistics, from \"Topics in circular Statistics\" (2001) S. Rao Jammalamadaka and A. SenGupta, World Scientific.", + "License": "GPL-2", + "NeedsCompilation": "yes", + "Encoding": "UTF-8", + "Author": "Ulric Lund [aut], Claudio Agostinelli [aut] (ORCID: ), Hiroyoshi Arai [ctb], Alessando Gagliardi [ctb], Eduardo García-Portugués [ctb, cre] (ORCID: ), Dimitri Giunchi [ctb], Jean-Olivier Irisson [ctb], Matthew Pocernich [ctb], Federico Rotolo [ctb]", + "Maintainer": "Eduardo García-Portugués ", + "Repository": "CRAN" + }, + "cli": { + "Package": "cli", + "Version": "3.6.5", + "Source": "Repository", + "Title": "Helpers for Developing Command Line Interfaces", + "Authors@R": "c( person(\"Gábor\", \"Csárdi\", , \"gabor@posit.co\", role = c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", role = \"ctb\"), person(\"Kirill\", \"Müller\", role = \"ctb\"), person(\"Salim\", \"Brüggemann\", , \"salim-b@pm.me\", role = \"ctb\", comment = c(ORCID = \"0000-0002-5329-5987\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A suite of tools to build attractive command line interfaces ('CLIs'), from semantic elements: headings, lists, alerts, paragraphs, etc. Supports custom themes via a 'CSS'-like language. It also contains a number of lower level 'CLI' elements: rules, boxes, trees, and 'Unicode' symbols with 'ASCII' alternatives. It support ANSI colors and text styles as well.", + "License": "MIT + file LICENSE", + "URL": "https://cli.r-lib.org, https://github.com/r-lib/cli", + "BugReports": "https://github.com/r-lib/cli/issues", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ + "utils" + ], + "Suggests": [ + "callr", + "covr", + "crayon", + "digest", + "glue (>= 1.6.0)", + "grDevices", + "htmltools", + "htmlwidgets", + "knitr", + "methods", + "processx", + "ps (>= 1.3.4.9000)", + "rlang (>= 1.0.2.9003)", + "rmarkdown", + "rprojroot", + "rstudioapi", + "testthat (>= 3.2.0)", + "tibble", + "whoami", + "withr" + ], + "Config/Needs/website": "r-lib/asciicast, bench, brio, cpp11, decor, desc, fansi, prettyunits, sessioninfo, tidyverse/tidytemplate, usethis, vctrs", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Gábor Csárdi [aut, cre], Hadley Wickham [ctb], Kirill Müller [ctb], Salim Brüggemann [ctb] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Gábor Csárdi ", + "Repository": "CRAN" + }, + "distr": { + "Package": "distr", + "Version": "2.9.7", + "Source": "Repository", + "Date": "2025-01-11", + "Title": "Object Oriented Implementation of Distributions", + "Description": "S4-classes and methods for distributions.", + "Authors@R": "c(person(\"Florian\", \"Camphausen\", role=\"ctb\", comment=\"contributed as student in the initial phase --2005\"), person(\"Matthias\", \"Kohl\", role=c(\"aut\", \"cph\")), person(\"Peter\", \"Ruckdeschel\", role=c(\"cre\", \"cph\"), email=\"peter.ruckdeschel@uni-oldenburg.de\"), person(\"Thomas\", \"Stabla\", role=\"ctb\", comment=\"contributed as student in the initial phase --2005\"), person(\"R Core Team\", role = c(\"ctb\", \"cph\"), comment=\"for source file ks.c/ routines 'pKS2' and 'pKolmogorov2x'\"))", + "Depends": [ + "R(>= 3.4)", + "methods", + "graphics", + "startupmsg(>= 1.0.0)", + "sfsmisc" + ], + "Suggests": [ + "distrEx", + "svUnit (>= 0.7-11)", + "knitr", + "distrMod", + "ROptEst" + ], + "Imports": [ + "stats", + "grDevices", + "utils", + "MASS" + ], + "Enhances": [ + "RobAStBase" + ], + "VignetteBuilder": "knitr", + "ByteCompile": "yes", + "Encoding": "UTF-8", + "License": "LGPL-3", + "URL": "http://distr.r-forge.r-project.org/", + "LastChangedDate": "{$LastChangedDate: 2024-11-05 21:59:54 +0100 (Di, 05 Nov 2024) $}", + "LastChangedRevision": "{$LastChangedRevision: 1482 $}", + "VCS/SVNRevision": "1482", + "NeedsCompilation": "yes", + "Author": "Florian Camphausen [ctb] (contributed as student in the initial phase --2005), Matthias Kohl [aut, cph], Peter Ruckdeschel [cre, cph], Thomas Stabla [ctb] (contributed as student in the initial phase --2005), R Core Team [ctb, cph] (for source file ks.c/ routines 'pKS2' and 'pKolmogorov2x')", + "Maintainer": "Peter Ruckdeschel ", + "Repository": "CRAN" + }, + "expint": { + "Package": "expint", + "Version": "0.1-8", + "Source": "Repository", + "Type": "Package", + "Title": "Exponential Integral and Incomplete Gamma Function", + "Date": "2022-10-28", + "Authors@R": "c(person(\"Vincent\", \"Goulet\", role = c(\"cre\", \"aut\"), email = \"vincent.goulet@act.ulaval.ca\"), person(\"Gerard\", \"Jungman\", role = \"aut\", email = \"jungman@lanl.gov\", comment = \"Original GSL code\"), person(\"Brian\", \"Gough\", role = \"aut\", email = \"jungman@lanl.gov\", comment = \"Original GSL code\"), person(\"Jeffrey A.\", \"Ryan\", role = \"aut\", email = \"jeff.a.ryan@gmail.com\", comment = \"Package API\"), person(\"Robert\", \"Gentleman\", role = \"aut\", comment = \"Parts of the R to C interface\"), person(\"Ross\", \"Ihaka\", role = \"aut\", comment = \"Parts of the R to C interface\"), person(family = \"R Core Team\", role = \"aut\", comment = \"Parts of the R to C interface\"), person(family = \"R Foundation\", role = \"aut\", comment = \"Parts of the R to C interface\"))", + "Description": "The exponential integrals E_1(x), E_2(x), E_n(x) and Ei(x), and the incomplete gamma function G(a, x) defined for negative values of its first argument. The package also gives easy access to the underlying C routines through an API; see the package vignette for details. A test package included in sub-directory example_API provides an implementation. C routines derived from the GNU Scientific Library .", + "Depends": [ + "R (>= 3.3.0)" + ], + "License": "GPL (>= 2)", + "URL": "https://gitlab.com/vigou3/expint", + "BugReports": "https://gitlab.com/vigou3/expint/-/issues", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Vincent Goulet [cre, aut], Gerard Jungman [aut] (Original GSL code), Brian Gough [aut] (Original GSL code), Jeffrey A. Ryan [aut] (Package API), Robert Gentleman [aut] (Parts of the R to C interface), Ross Ihaka [aut] (Parts of the R to C interface), R Core Team [aut] (Parts of the R to C interface), R Foundation [aut] (Parts of the R to C interface)", + "Maintainer": "Vincent Goulet ", + "Repository": "CRAN" + }, + "extraDistr": { + "Package": "extraDistr", + "Version": "1.10.0", + "Source": "Repository", + "Type": "Package", + "Title": "Additional Univariate and Multivariate Distributions", + "Date": "2023-12-30", + "Author": "Tymoteusz Wolodzko", + "Maintainer": "Tymoteusz Wolodzko ", + "Description": "Density, distribution function, quantile function and random generation for a number of univariate and multivariate distributions. This package implements the following distributions: Bernoulli, beta-binomial, beta-negative binomial, beta prime, Bhattacharjee, Birnbaum-Saunders, bivariate normal, bivariate Poisson, categorical, Dirichlet, Dirichlet-multinomial, discrete gamma, discrete Laplace, discrete normal, discrete uniform, discrete Weibull, Frechet, gamma-Poisson, generalized extreme value, Gompertz, generalized Pareto, Gumbel, half-Cauchy, half-normal, half-t, Huber density, inverse chi-squared, inverse-gamma, Kumaraswamy, Laplace, location-scale t, logarithmic, Lomax, multivariate hypergeometric, multinomial, negative hypergeometric, non-standard beta, normal mixture, Poisson mixture, Pareto, power, reparametrized beta, Rayleigh, shifted Gompertz, Skellam, slash, triangular, truncated binomial, truncated normal, truncated Poisson, Tukey lambda, Wald, zero-inflated binomial, zero-inflated negative binomial, zero-inflated Poisson.", + "License": "GPL-2", + "URL": "https://github.com/twolodzko/extraDistr", + "BugReports": "https://github.com/twolodzko/extraDistr/issues", + "Encoding": "UTF-8", + "Depends": [ + "R (>= 3.1.0)" + ], + "LinkingTo": [ + "Rcpp" + ], + "Imports": [ + "Rcpp" + ], + "Suggests": [ + "testthat", + "LaplacesDemon", + "VGAM", + "evd", + "skellam", + "triangle", + "actuar" + ], + "SystemRequirements": "C++", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "yes", + "Repository": "CRAN" + }, + "fBasics": { + "Package": "fBasics", + "Version": "4041.97", + "Source": "Repository", + "Title": "Rmetrics - Markets and Basic Statistics", + "Authors@R": "c(person(\"Diethelm\", \"Wuertz\", role=\"aut\", comment = \"original code\") , person(\"Tobias\", \"Setz\", role = c(\"aut\"), email = \"tobias.setz@live.com\") , person(\"Yohan\", \"Chalabi\", role = \"aut\") , person(\"Martin\",\"Maechler\", role=\"ctb\", email=\"maechler@stat.math.ethz.ch\", comment = c(ORCID = \"0000-0002-8685-9910\")) , person(\"CRAN Team\", role = \"ctb\") , person(given = c(\"Georgi\", \"N.\"), family = \"Boshnakov\", role = c(\"cre\", \"aut\"), email = \"georgi.boshnakov@manchester.ac.uk\") )", + "Description": "Provides a collection of functions to explore and to investigate basic properties of financial returns and related quantities. The covered fields include techniques of explorative data analysis and the investigation of distributional properties, including parameter estimation and hypothesis testing. Even more there are several utility functions for data handling and management.", + "Depends": [ + "R (>= 2.15.1)" + ], + "Imports": [ + "timeDate", + "timeSeries (>= 4021.105)", + "stats", + "grDevices", + "graphics", + "methods", + "utils", + "MASS", + "spatial", + "gss", + "stabledist" + ], + "Suggests": [ + "interp", + "RUnit", + "tcltk" + ], + "LazyData": "yes", + "License": "GPL (>= 2)", + "Encoding": "UTF-8", + "URL": "https://geobosh.github.io/fBasicsDoc/ (doc), https://r-forge.r-project.org/scm/viewvc.php/pkg/fBasics/?root=rmetrics (devel), https://www.rmetrics.org", + "BugReports": "https://r-forge.r-project.org/projects/rmetrics", + "NeedsCompilation": "yes", + "Author": "Diethelm Wuertz [aut] (original code), Tobias Setz [aut], Yohan Chalabi [aut], Martin Maechler [ctb] (), CRAN Team [ctb], Georgi N. Boshnakov [cre, aut]", + "Maintainer": "Georgi N. Boshnakov ", + "Repository": "CRAN" + }, + "glue": { + "Package": "glue", + "Version": "1.8.0", + "Source": "Repository", + "Title": "Interpreted String Literals", + "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\", comment = c(ORCID = \"0000-0002-2739-7082\")), person(\"Jennifer\", \"Bryan\", , \"jenny@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-6983-2759\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "An implementation of interpreted string literals, inspired by Python's Literal String Interpolation and Docstrings and Julia's Triple-Quoted String Literals .", + "License": "MIT + file LICENSE", + "URL": "https://glue.tidyverse.org/, https://github.com/tidyverse/glue", + "BugReports": "https://github.com/tidyverse/glue/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "crayon", + "DBI (>= 1.2.0)", + "dplyr", + "knitr", + "magrittr", + "rlang", + "rmarkdown", + "RSQLite", + "testthat (>= 3.2.0)", + "vctrs (>= 0.3.0)", + "waldo (>= 0.5.3)", + "withr" + ], + "VignetteBuilder": "knitr", + "ByteCompile": "true", + "Config/Needs/website": "bench, forcats, ggbeeswarm, ggplot2, R.utils, rprintf, tidyr, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Jim Hester [aut] (), Jennifer Bryan [aut, cre] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Jennifer Bryan ", + "Repository": "CRAN" + }, + "gnorm": { + "Package": "gnorm", + "Version": "1.0.0", + "Source": "Repository", + "Date": "2018-01-29", + "Title": "Generalized Normal/Exponential Power Distribution", + "Author": "Maryclare Griffin", + "Maintainer": "Maryclare Griffin ", + "Suggests": [ + "knitr", + "rmarkdown" + ], + "Description": "Functions for obtaining generalized normal/exponential power distribution probabilities, quantiles, densities and random deviates. The generalized normal/exponential power distribution was introduced by Subbotin (1923) and rediscovered by Nadarajah (2005). The parametrization given by Nadarajah (2005) is used.", + "License": "GPL (>= 2)", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "6.0.1", + "VignetteBuilder": "knitr", + "Type": "Package", + "URL": "http://github.com/maryclare/gnorm", + "NeedsCompilation": "no", + "Repository": "CRAN" + }, + "gss": { + "Package": "gss", + "Version": "2.2-9", + "Source": "Repository", + "Date": "2025-04-13", + "Title": "General Smoothing Splines", + "Authors@R": "c(person(\"Chong\",\"Gu\",role=c(\"aut\",\"cre\"), email=\"chong@purdue.edu\"))", + "Author": "Chong Gu [aut, cre]", + "Maintainer": "Chong Gu ", + "Depends": [ + "R (>= 3.0.0)", + "stats" + ], + "Description": "A comprehensive package for structural multivariate function estimation using smoothing splines.", + "License": "GPL (>= 2)", + "NeedsCompilation": "yes", + "Repository": "CRAN" + }, + "jsonlite": { + "Package": "jsonlite", + "Version": "2.0.0", + "Source": "Repository", + "Title": "A Simple and Robust JSON Parser and Generator for R", + "License": "MIT + file LICENSE", + "Depends": [ + "methods" + ], + "Authors@R": "c( person(\"Jeroen\", \"Ooms\", role = c(\"aut\", \"cre\"), email = \"jeroenooms@gmail.com\", comment = c(ORCID = \"0000-0002-4035-0289\")), person(\"Duncan\", \"Temple Lang\", role = \"ctb\"), person(\"Lloyd\", \"Hilaiel\", role = \"cph\", comment=\"author of bundled libyajl\"))", + "URL": "https://jeroen.r-universe.dev/jsonlite https://arxiv.org/abs/1403.2805", + "BugReports": "https://github.com/jeroen/jsonlite/issues", + "Maintainer": "Jeroen Ooms ", + "VignetteBuilder": "knitr, R.rsp", + "Description": "A reasonably fast JSON parser and generator, optimized for statistical data and the web. Offers simple, flexible tools for working with JSON in R, and is particularly powerful for building pipelines and interacting with a web API. The implementation is based on the mapping described in the vignette (Ooms, 2014). In addition to converting JSON data from/to R objects, 'jsonlite' contains functions to stream, validate, and prettify JSON data. The unit tests included with the package verify that all edge cases are encoded and decoded consistently for use with dynamic data in systems and applications.", + "Suggests": [ + "httr", + "vctrs", + "testthat", + "knitr", + "rmarkdown", + "R.rsp", + "sf" + ], + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Jeroen Ooms [aut, cre] (), Duncan Temple Lang [ctb], Lloyd Hilaiel [cph] (author of bundled libyajl)", + "Repository": "CRAN" + }, + "lifecycle": { + "Package": "lifecycle", + "Version": "1.0.4", + "Source": "Repository", + "Title": "Manage the Life Cycle of your Package Functions", + "Authors@R": "c( person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Manage the life cycle of your exported functions with shared conventions, documentation badges, and user-friendly deprecation warnings.", + "License": "MIT + file LICENSE", + "URL": "https://lifecycle.r-lib.org/, https://github.com/r-lib/lifecycle", + "BugReports": "https://github.com/r-lib/lifecycle/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "cli (>= 3.4.0)", + "glue", + "rlang (>= 1.1.0)" + ], + "Suggests": [ + "covr", + "crayon", + "knitr", + "lintr", + "rmarkdown", + "testthat (>= 3.0.1)", + "tibble", + "tidyverse", + "tools", + "vctrs", + "withr" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate, usethis", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.1", + "NeedsCompilation": "no", + "Author": "Lionel Henry [aut, cre], Hadley Wickham [aut] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "CRAN" + }, + "magrittr": { + "Package": "magrittr", + "Version": "2.0.4", + "Source": "Repository", + "Type": "Package", + "Title": "A Forward-Pipe Operator for R", + "Authors@R": "c( person(\"Stefan Milton\", \"Bache\", , \"stefan@stefanbache.dk\", role = c(\"aut\", \"cph\"), comment = \"Original author and creator of magrittr\"), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = \"cre\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "Provides a mechanism for chaining commands with a new forward-pipe operator, %>%. This operator will forward a value, or the result of an expression, into the next function call/expression. There is flexible support for the type of right-hand side expressions. For more information, see package vignette. To quote Rene Magritte, \"Ceci n'est pas un pipe.\"", + "License": "MIT + file LICENSE", + "URL": "https://magrittr.tidyverse.org, https://github.com/tidyverse/magrittr", + "BugReports": "https://github.com/tidyverse/magrittr/issues", + "Depends": [ + "R (>= 3.4.0)" + ], + "Suggests": [ + "covr", + "knitr", + "rlang", + "rmarkdown", + "testthat" + ], + "VignetteBuilder": "knitr", + "ByteCompile": "Yes", + "Config/Needs/website": "tidyverse/tidytemplate", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.3", + "NeedsCompilation": "yes", + "Author": "Stefan Milton Bache [aut, cph] (Original author and creator of magrittr), Hadley Wickham [aut], Lionel Henry [cre], Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Lionel Henry ", + "Repository": "CRAN" + }, + "mvtnorm": { + "Package": "mvtnorm", + "Version": "1.3-3", + "Source": "Repository", + "Title": "Multivariate Normal and t Distributions", + "Date": "2025-01-09", + "Authors@R": "c(person(\"Alan\", \"Genz\", role = \"aut\"), person(\"Frank\", \"Bretz\", role = \"aut\"), person(\"Tetsuhisa\", \"Miwa\", role = \"aut\"), person(\"Xuefei\", \"Mi\", role = \"aut\"), person(\"Friedrich\", \"Leisch\", role = \"ctb\"), person(\"Fabian\", \"Scheipl\", role = \"ctb\"), person(\"Bjoern\", \"Bornkamp\", role = \"ctb\", comment = c(ORCID = \"0000-0002-6294-8185\")), person(\"Martin\", \"Maechler\", role = \"ctb\", comment = c(ORCID = \"0000-0002-8685-9910\")), person(\"Torsten\", \"Hothorn\", role = c(\"aut\", \"cre\"), email = \"Torsten.Hothorn@R-project.org\", comment = c(ORCID = \"0000-0001-8301-0471\")))", + "Description": "Computes multivariate normal and t probabilities, quantiles, random deviates, and densities. Log-likelihoods for multivariate Gaussian models and Gaussian copulae parameterised by Cholesky factors of covariance or precision matrices are implemented for interval-censored and exact data, or a mix thereof. Score functions for these log-likelihoods are available. A class representing multiple lower triangular matrices and corresponding methods are part of this package.", + "Imports": [ + "stats" + ], + "Depends": [ + "R(>= 3.5.0)" + ], + "Suggests": [ + "qrng", + "numDeriv" + ], + "License": "GPL-2", + "URL": "http://mvtnorm.R-forge.R-project.org", + "NeedsCompilation": "yes", + "Author": "Alan Genz [aut], Frank Bretz [aut], Tetsuhisa Miwa [aut], Xuefei Mi [aut], Friedrich Leisch [ctb], Fabian Scheipl [ctb], Bjoern Bornkamp [ctb] (), Martin Maechler [ctb] (), Torsten Hothorn [aut, cre] ()", + "Maintainer": "Torsten Hothorn ", + "Repository": "CRAN" + }, + "new.dist": { + "Package": "new.dist", + "Version": "0.1.1", + "Source": "Repository", + "Title": "Alternative Continuous and Discrete Distributions", + "Authors@R": "c( person(\"Ramazan\", \"Akman\",,\"ramazanakman12345@gmail.com\",role=c(\"cre\",\"ctb\"), comment = \"https://www.researchgate.net/profile/Ramazan-Akman\"), person(\"Coşkun\", \"Kuş\",,\"coskunkus@gmail.com\",role=c(\"aut\",\"ctb\"), comment = \"https://www.selcuk.edu.tr/Person/Detail/coskun\"), person(\"Ihab\", \"Abusaif\",,\"censtat@gmail.com\",role=c(\"aut\",\"ctb\"), comment = \"https://www.researchgate.net/profile/Ihab-Abusaif\"))", + "Maintainer": "Ramazan Akman ", + "Description": "The aim is to develop an R package, which is the 'new.dist' package, for the probability (density) function, the distribution function, the quantile function and the associated random number generation function for discrete and continuous distributions, which have recently been proposed in the literature. This package implements the following distributions: The Power Muth Distribution, a Bimodal Weibull Distribution, the Discrete Lindley Distribution, The Gamma-Lomax Distribution, Weighted Geometric Distribution, a Power Log-Dagum Distribution, Kumaraswamy Distribution, Lindley Distribution, the Unit-Inverse Gaussian Distribution, EP Distribution, Akash Distribution, Ishita Distribution, Maxwell Distribution, the Standard Omega Distribution, Slashed Generalized Rayleigh Distribution, Two-Parameter Rayleigh Distribution, Muth Distribution, Uniform-Geometric Distribution, Discrete Weibull Distribution.", + "License": "GPL-3", + "URL": "https://github.com/akmn35/new.dist, https://akmn35.github.io/new.dist/", + "BugReports": "https://github.com/akmn35/new.dist/issues", + "Imports": [ + "VGAM", + "expint", + "pracma" + ], + "Suggests": [ + "knitr", + "rmarkdown", + "roxygen2", + "stats", + "testthat (>= 3.0.0)" + ], + "VignetteBuilder": "knitr", + "RdMacros": "", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "no", + "Author": "Ramazan Akman [cre, ctb] (https://www.researchgate.net/profile/Ramazan-Akman), Coşkun Kuş [aut, ctb] (https://www.selcuk.edu.tr/Person/Detail/coskun), Ihab Abusaif [aut, ctb] (https://www.researchgate.net/profile/Ihab-Abusaif)", + "Repository": "CRAN" + }, + "nloptr": { + "Package": "nloptr", + "Version": "2.2.1", + "Source": "Repository", + "Type": "Package", + "Title": "R Interface to NLopt", + "Authors@R": "c(person(\"Jelmer\", \"Ypma\", role = \"aut\", email = \"uctpjyy@ucl.ac.uk\"), person(c(\"Steven\", \"G.\"), \"Johnson\", role = \"aut\", comment = \"author of the NLopt C library\"), person(\"Aymeric\", \"Stamm\", role = c(\"ctb\", \"cre\"), email = \"aymeric.stamm@cnrs.fr\", comment = c(ORCID = \"0000-0002-8725-3654\")), person(c(\"Hans\", \"W.\"), \"Borchers\", role = \"ctb\", email = \"hwborchers@googlemail.com\"), person(\"Dirk\", \"Eddelbuettel\", role = \"ctb\", email = \"edd@debian.org\"), person(\"Brian\", \"Ripley\", role = \"ctb\", comment = \"build process on multiple OS\"), person(\"Kurt\", \"Hornik\", role = \"ctb\", comment = \"build process on multiple OS\"), person(\"Julien\", \"Chiquet\", role = \"ctb\"), person(\"Avraham\", \"Adler\", role = \"ctb\", email = \"Avraham.Adler@gmail.com\", comment = c(ORCID = \"0000-0002-3039-0703\")), person(\"Xiongtao\", \"Dai\", role = \"ctb\"), person(\"Jeroen\", \"Ooms\", role = \"ctb\", email = \"jeroen@berkeley.edu\"), person(\"Tomas\", \"Kalibera\", role = \"ctb\"), person(\"Mikael\", \"Jagan\", role = \"ctb\"))", + "Description": "Solve optimization problems using an R interface to NLopt. NLopt is a free/open-source library for nonlinear optimization, providing a common interface for a number of different free optimization routines available online as well as original implementations of various other algorithms. See for more information on the available algorithms. Building from included sources requires 'CMake'. On Linux and 'macOS', if a suitable system build of NLopt (2.7.0 or later) is found, it is used; otherwise, it is built from included sources via 'CMake'. On Windows, NLopt is obtained through 'rwinlib' for 'R <= 4.1.x' or grabbed from the appropriate toolchain for 'R >= 4.2.0'.", + "License": "LGPL (>= 3)", + "SystemRequirements": "cmake (>= 3.2.0) which is used only on Linux or macOS systems when no system build of nlopt (>= 2.7.0) can be found.", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "Suggests": [ + "knitr", + "rmarkdown", + "covr", + "tinytest" + ], + "VignetteBuilder": "knitr", + "URL": "https://github.com/astamm/nloptr, https://astamm.github.io/nloptr/", + "BugReports": "https://github.com/astamm/nloptr/issues", + "NeedsCompilation": "yes", + "UseLTO": "yes", + "Author": "Jelmer Ypma [aut], Steven G. Johnson [aut] (author of the NLopt C library), Aymeric Stamm [ctb, cre] (), Hans W. Borchers [ctb], Dirk Eddelbuettel [ctb], Brian Ripley [ctb] (build process on multiple OS), Kurt Hornik [ctb] (build process on multiple OS), Julien Chiquet [ctb], Avraham Adler [ctb] (), Xiongtao Dai [ctb], Jeroen Ooms [ctb], Tomas Kalibera [ctb], Mikael Jagan [ctb]", + "Maintainer": "Aymeric Stamm ", + "Repository": "CRAN" + }, + "numDeriv": { + "Package": "numDeriv", + "Version": "2016.8-1.1", + "Source": "Repository", + "Title": "Accurate Numerical Derivatives", + "Description": "Methods for calculating (usually) accurate numerical first and second order derivatives. Accurate calculations are done using 'Richardson''s' extrapolation or, when applicable, a complex step derivative is available. A simple difference method is also provided. Simple difference is (usually) less accurate but is much quicker than 'Richardson''s' extrapolation and provides a useful cross-check. Methods are provided for real scalar and vector valued functions.", + "Depends": [ + "R (>= 2.11.1)" + ], + "LazyLoad": "yes", + "ByteCompile": "yes", + "License": "GPL-2", + "Copyright": "2006-2011, Bank of Canada. 2012-2016, Paul Gilbert", + "Author": "Paul Gilbert and Ravi Varadhan", + "Maintainer": "Paul Gilbert ", + "URL": "http://optimizer.r-forge.r-project.org/", + "NeedsCompilation": "no", + "Repository": "CRAN" + }, + "optimx": { + "Package": "optimx", + "Version": "2025-4.9", + "Source": "Repository", + "Date": "2025-04-09", + "Title": "Expanded Replacement and Extension of the 'optim' Function", + "Authors@R": "c( person(given = c(\"John\", \"C\"), family = \"Nash\", role = c(\"aut\", \"cre\"), email = \"profjcnash@gmail.com\"), person(given = \"Ravi\", family = \"Varadhan\", role = \"aut\", email = \"RVaradhan@jhmi.edu\"), person(given = \"Hans W\", family = \"Borchers\", role = \"ctb\", email = \"hwborchers@gmail.com\"), person(given = \"Gabor\", family = \"Grothendieck\", role = \"ctb\", email = \"ggrothendieck@gmail.com\") )", + "Maintainer": "John C Nash ", + "Description": "Provides a replacement and extension of the optim() function to call to several function minimization codes in R in a single statement. These methods handle smooth, possibly box constrained functions of several or many parameters. Note that function 'optimr()' was prepared to simplify the incorporation of minimization codes going forward. Also implements some utility codes and some extra solvers, including safeguarded Newton methods. Many methods previously separate are now included here. This is the version for CRAN.", + "License": "GPL-2", + "URL": "https://github.com/nashjc/optimx", + "BugReports": "https://github.com/nashjc/optimx/issues", + "LazyLoad": "Yes", + "Imports": [ + "numDeriv", + "nloptr", + "pracma" + ], + "NeedsCompilation": "no", + "Suggests": [ + "knitr", + "rmarkdown", + "setRNG", + "BB", + "ucminf", + "minqa", + "dfoptim", + "lbfgsb3c", + "lbfgs", + "subplex", + "marqLevAlg", + "testthat (>= 3.0.0)", + "R.rsp" + ], + "VignetteBuilder": "R.rsp", + "Config/testthat/edition": "3", + "Config/build/clean-inst-doc": "false", + "Author": "John C Nash [aut, cre], Ravi Varadhan [aut], Hans W Borchers [ctb], Gabor Grothendieck [ctb]", + "Repository": "CRAN" + }, + "pracma": { + "Package": "pracma", + "Version": "2.4.4", + "Source": "Repository", + "Type": "Package", + "Date": "2023-11-08", + "Title": "Practical Numerical Math Functions", + "Authors@R": "person(\"Hans W.\", \"Borchers\", email=\"hwborchers@googlemail.com\", role=c(\"aut\", \"cre\"))", + "Depends": [ + "R (>= 3.1.0)" + ], + "Imports": [ + "graphics", + "grDevices", + "stats", + "utils" + ], + "Suggests": [ + "NlcOptim", + "quadprog" + ], + "Description": "Provides a large number of functions from numerical analysis and linear algebra, numerical optimization, differential equations, time series, plus some well-known special mathematical functions. Uses 'MATLAB' function names where appropriate to simplify porting.", + "License": "GPL (>= 3)", + "ByteCompile": "true", + "LazyData": "yes", + "NeedsCompilation": "no", + "Author": "Hans W. Borchers [aut, cre]", + "Maintainer": "Hans W. Borchers ", + "Repository": "CRAN" + }, + "renv": { + "Package": "renv", + "Version": "1.1.5", + "Source": "Repository", + "Type": "Package", + "Title": "Project Environments", + "Authors@R": "c( person(\"Kevin\", \"Ushey\", role = c(\"aut\", \"cre\"), email = \"kevin@rstudio.com\", comment = c(ORCID = \"0000-0003-2880-7407\")), person(\"Hadley\", \"Wickham\", role = c(\"aut\"), email = \"hadley@rstudio.com\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A dependency management toolkit for R. Using 'renv', you can create and manage project-local R libraries, save the state of these libraries to a 'lockfile', and later restore your library as required. Together, these tools can help make your projects more isolated, portable, and reproducible.", + "License": "MIT + file LICENSE", + "URL": "https://rstudio.github.io/renv/, https://github.com/rstudio/renv", + "BugReports": "https://github.com/rstudio/renv/issues", + "Imports": [ + "utils" + ], + "Suggests": [ + "BiocManager", + "cli", + "compiler", + "covr", + "cpp11", + "devtools", + "generics", + "gitcreds", + "jsonlite", + "jsonvalidate", + "knitr", + "miniUI", + "modules", + "packrat", + "pak", + "R6", + "remotes", + "reticulate", + "rmarkdown", + "rstudioapi", + "shiny", + "testthat", + "uuid", + "waldo", + "yaml", + "webfakes" + ], + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Config/testthat/start-first": "bioconductor,python,install,restore,snapshot,retrieve,remotes", + "NeedsCompilation": "no", + "Author": "Kevin Ushey [aut, cre] (ORCID: ), Hadley Wickham [aut] (ORCID: ), Posit Software, PBC [cph, fnd]", + "Maintainer": "Kevin Ushey ", + "Repository": "CRAN" + }, + "rlang": { + "Package": "rlang", + "Version": "1.1.6", + "Source": "Repository", + "Title": "Functions for Base Types and Core R and 'Tidyverse' Features", + "Description": "A toolbox for working with base types, core R features like the condition system, and core 'Tidyverse' features like tidy evaluation.", + "Authors@R": "c( person(\"Lionel\", \"Henry\", ,\"lionel@posit.co\", c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", ,\"hadley@posit.co\", \"aut\"), person(given = \"mikefc\", email = \"mikefc@coolbutuseless.com\", role = \"cph\", comment = \"Hash implementation based on Mike's xxhashlite\"), person(given = \"Yann\", family = \"Collet\", role = \"cph\", comment = \"Author of the embedded xxHash library\"), person(given = \"Posit, PBC\", role = c(\"cph\", \"fnd\")) )", + "License": "MIT + file LICENSE", + "ByteCompile": "true", + "Biarch": "true", + "Depends": [ + "R (>= 3.5.0)" + ], + "Imports": [ + "utils" + ], + "Suggests": [ + "cli (>= 3.1.0)", + "covr", + "crayon", + "desc", + "fs", + "glue", + "knitr", + "magrittr", + "methods", + "pillar", + "pkgload", + "rmarkdown", + "stats", + "testthat (>= 3.2.0)", + "tibble", + "usethis", + "vctrs (>= 0.2.3)", + "withr" + ], + "Enhances": [ + "winch" + ], + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "URL": "https://rlang.r-lib.org, https://github.com/r-lib/rlang", + "BugReports": "https://github.com/r-lib/rlang/issues", + "Config/build/compilation-database": "true", + "Config/testthat/edition": "3", + "Config/Needs/website": "dplyr, tidyverse/tidytemplate", + "NeedsCompilation": "yes", + "Author": "Lionel Henry [aut, cre], Hadley Wickham [aut], mikefc [cph] (Hash implementation based on Mike's xxhashlite), Yann Collet [cph] (Author of the embedded xxHash library), Posit, PBC [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "CRAN" + }, + "sfsmisc": { + "Package": "sfsmisc", + "Version": "1.1-22", + "Source": "Repository", + "Title": "Utilities from 'Seminar fuer Statistik' ETH Zurich", + "VersionNote": "Last CRAN: 1.1-21 on 2025-07-25; 1.1-20 on 2024-10-23; 1.1-19 on 2024-08-16", + "Date": "2025-08-30", + "Authors@R": "c(person(\"Martin\",\"Maechler\", role=c(\"aut\",\"cre\"), email=\"maechler@stat.math.ethz.ch\", comment = c(ORCID = \"0000-0002-8685-9910\")) , person(\"Werner\", \"Stahel\", role = \"ctb\", comment = \"Functions: compresid2way(), f.robftest(), last(), p.scales(), p.dnorm()\") , person(\"Andreas\", \"Ruckstuhl\", role = \"ctb\", comment = \"Functions: p.arrows(), p.profileTraces(), p.res.2x()\") , person(\"Christian\", \"Keller\", role = \"ctb\", comment = \"Functions: histBxp(), p.tachoPlot()\") , person(\"Kjetil\", \"Halvorsen\", role = \"ctb\", comment = \"Functions: KSd(), ecdf.ksCI()\") , person(\"Alain\", \"Hauser\", role = \"ctb\", comment = \"Functions: cairoSwd(), is.whole(), toLatex.numeric()*\") , person(\"Christoph\", \"Buser\", role = \"ctb\", comment = \"to function Duplicated()\") , person(\"Lorenz\", \"Gygax\", role = \"ctb\", comment = \"to function p.res.2fact()\") , person(\"Bill\", \"Venables\", role = \"ctb\", comment = \"Functions: empty.dimnames(), primes()\") , person(\"Tony\", \"Plate\", role = \"ctb\", comment = \"to inv.seq()\") # minor contributors: , person(\"Isabelle\", \"Flückiger\", role = \"ctb\") , person(\"Marcel\", \"Wolbers\", role = \"ctb\") , person(\"Markus\", \"Keller\", role = \"ctb\") , person(\"Sandrine\", \"Dudoit\", role = \"ctb\") , person(\"Jane\", \"Fridlyand\", role = \"ctb\") , person(\"Greg\", \"Snow\", role = \"ctb\", comment = \"to loessDemo()\") , person(\"Henrik Aa.\", \"Nielsen\", role = \"ctb\", comment = \"to loessDemo()\") , person(\"Vincent\", \"Carey\", role = \"ctb\") , person(\"Ben\", \"Bolker\", role = \"ctb\") , person(\"Philippe\", \"Grosjean\", role = \"ctb\") , person(\"Frédéric\", \"Ibanez\", role = \"ctb\") , person(\"Caterina\", \"Savi\", role = \"ctb\") , person(\"Charles\", \"Geyer\", role = \"ctb\") , person(\"Jens\", \"Oehlschlägel\", role = \"ctb\") )", + "Maintainer": "Martin Maechler ", + "Description": "Useful utilities ['goodies'] from Seminar fuer Statistik ETH Zurich, some of which were ported from S-plus in the 1990s. For graphics, have pretty (Log-scale) axes eaxis(), an enhanced Tukey-Anscombe plot, combining histogram and boxplot, 2d-residual plots, a 'tachoPlot()', pretty arrows, etc. For robustness, have a robust F test and robust range(). For system support, notably on Linux, provides 'Sys.*()' functions with more access to system and CPU information. Finally, miscellaneous utilities such as simple efficient prime numbers, integer codes, Duplicated(), toLatex.numeric() and is.whole().", + "Depends": [ + "R (>= 3.3.0)" + ], + "Imports": [ + "grDevices", + "utils", + "stats", + "tools" + ], + "Suggests": [ + "datasets", + "tcltk", + "cluster", + "lattice", + "MASS", + "Matrix", + "nlme", + "lokern", + "Rmpfr", + "gmp" + ], + "Enhances": [ + "mgcv", + "rpart", + "nor1mix", + "polycor", + "sm", + "tikzDevice", + "DescTools", + "e1071", + "Hmisc", + "pastecs", + "polynom", + "relevance", + "robustbase" + ], + "EnhancesNote": "2nd line: packages mentioned in Rd xrefs", + "Encoding": "UTF-8", + "ByteCompile": "yes", + "License": "GPL (>= 2)", + "URL": "https://github.com/mmaechler/sfsmisc", + "BugReports": "https://github.com/mmaechler/sfsmisc/issues", + "NeedsCompilation": "no", + "Author": "Martin Maechler [aut, cre] (ORCID: ), Werner Stahel [ctb] (Functions: compresid2way(), f.robftest(), last(), p.scales(), p.dnorm()), Andreas Ruckstuhl [ctb] (Functions: p.arrows(), p.profileTraces(), p.res.2x()), Christian Keller [ctb] (Functions: histBxp(), p.tachoPlot()), Kjetil Halvorsen [ctb] (Functions: KSd(), ecdf.ksCI()), Alain Hauser [ctb] (Functions: cairoSwd(), is.whole(), toLatex.numeric()*), Christoph Buser [ctb] (to function Duplicated()), Lorenz Gygax [ctb] (to function p.res.2fact()), Bill Venables [ctb] (Functions: empty.dimnames(), primes()), Tony Plate [ctb] (to inv.seq()), Isabelle Flückiger [ctb], Marcel Wolbers [ctb], Markus Keller [ctb], Sandrine Dudoit [ctb], Jane Fridlyand [ctb], Greg Snow [ctb] (to loessDemo()), Henrik Aa. Nielsen [ctb] (to loessDemo()), Vincent Carey [ctb], Ben Bolker [ctb], Philippe Grosjean [ctb], Frédéric Ibanez [ctb], Caterina Savi [ctb], Charles Geyer [ctb], Jens Oehlschlägel [ctb]", + "Repository": "CRAN" + }, + "skellam": { + "Package": "skellam", + "Version": "0.2.4", + "Source": "Repository", + "Date": "2025-04-05", + "Title": "Densities and Sampling for the Skellam Distribution", + "Authors@R": "c(person(given = c(\"Jerry\", \"W.\"),family = \"Lewis\", role = \"aut\", email = \"Jerry.Lewis@biogen.com\"), person(given = c(\"Patrick\", \"E.\"), family = \"Brown\", role = \"aut\", email = \"patrick.brown@utoronto.ca\"), person(given = \"Michail\", family = \"Tsagris\", role = \"aut\", email = \"mtsagris@yahoo.gr\"), person(given = \"Montasser\", family = \"Ghachem\", role = \"cre\", email = \"mg@pinstimation.com\"))", + "Description": "Functions for the Skellam distribution, including: density (pmf), cdf, quantiles and regression.", + "URL": "https://github.com/monty-se/skellam", + "License": "GPL (>= 2)", + "Imports": [ + "stats" + ], + "Suggests": [ + "knitr", + "rmarkdown" + ], + "VignetteBuilder": "knitr", + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "Enhances": [ + "VGAM" + ], + "BuildVignettes": "true", + "Repository": "CRAN", + "NeedsCompilation": "no", + "Author": "Jerry W. Lewis [aut], Patrick E. Brown [aut], Michail Tsagris [aut], Montasser Ghachem [cre]", + "Maintainer": "Montasser Ghachem " + }, + "spatial": { + "Package": "spatial", + "Version": "7.3-18", + "Source": "Repository", + "Priority": "recommended", + "Date": "2025-01-01", + "Depends": [ + "R (>= 3.0.0)", + "graphics", + "stats", + "utils" + ], + "Suggests": [ + "MASS" + ], + "Authors@R": "c(person(\"Brian\", \"Ripley\", role = c(\"aut\", \"cre\", \"cph\"), email = \"Brian.Ripley@R-project.org\"), person(\"Roger\", \"Bivand\", role = \"ctb\"), person(\"William\", \"Venables\", role = \"cph\"))", + "Description": "Functions for kriging and point pattern analysis.", + "Title": "Functions for Kriging and Point Pattern Analysis", + "LazyLoad": "yes", + "ByteCompile": "yes", + "License": "GPL-2 | GPL-3", + "URL": "http://www.stats.ox.ac.uk/pub/MASS4/", + "NeedsCompilation": "yes", + "Author": "Brian Ripley [aut, cre, cph], Roger Bivand [ctb], William Venables [cph]", + "Maintainer": "Brian Ripley ", + "Repository": "CRAN" + }, + "stabledist": { + "Package": "stabledist", + "Version": "0.7-2", + "Source": "Repository", + "Date": "2024-08-14", + "Title": "Stable Distribution Functions", + "Authors@R": "c( person(\"Diethelm\", \"Wuertz\", role=\"aut\", comment = \"original code\"), person(\"Martin\",\"Maechler\", role=c(\"aut\",\"cre\"), email=\"maechler@stat.math.ethz.ch\", comment = c(\"checks/tests; fixes, ..\", ORCID = \"0000-0002-8685-9910\")), person(\"Yohan\", \"Chalabi\", role=\"ctb\", comment= \"namespace; admin\"))", + "Maintainer": "Martin Maechler ", + "Depends": [ + "R (>= 3.1.0)" + ], + "Imports": [ + "stats" + ], + "Suggests": [ + "Matrix", + "fBasics", + "FMStable", + "RUnit", + "Rmpfr", + "sfsmisc", + "libstable4u" + ], + "SuggestsNote": "'libstable4u', based on 'libstableR', is said to be uniformly better both accuracy and speed wise, at least in parts.", + "Description": "Density, Probability and Quantile functions, and random number generation for (skew) stable distributions, using the parametrizations of Nolan.", + "License": "GPL (>= 2)", + "URL": "https://r-forge.r-project.org/scm/viewvc.php/pkg/stabledist/?root=rmetrics", + "NeedsCompilation": "no", + "Author": "Diethelm Wuertz [aut] (original code), Martin Maechler [aut, cre] (checks/tests; fixes, .., ), Yohan Chalabi [ctb] (namespace; admin)", + "Repository": "CRAN" + }, + "startupmsg": { + "Package": "startupmsg", + "Version": "1.0.0", + "Source": "Repository", + "Encoding": "UTF-8", + "Date": "2025-01-11", + "Title": "Utilities for Start-Up Messages", + "Description": "Provides utilities to create or suppress start-up messages.", + "Authors@R": "person(\"Peter\", \"Ruckdeschel\", role=c(\"cre\", \"cph\", \"aut\"), email=\"peter.ruckdeschel@uni-oldenburg.de\", comment = c(ORCID = \"0000-0001-7815-4809\"))", + "Depends": [ + "R(>= 1.8.0)" + ], + "Imports": [ + "utils" + ], + "ByteCompile": "yes", + "License": "LGPL-3", + "LastChangedDate": "{$LastChangedDate: 2024-08-29 10:38:14 +0200 (Do, 29 Aug 2024) $}", + "LastChangedRevision": "{$LastChangedRevision: 1449 $}", + "VCS/SVNRevision": "1482", + "NeedsCompilation": "no", + "Author": "Peter Ruckdeschel [cre, cph, aut] ()", + "Maintainer": "Peter Ruckdeschel ", + "Repository": "CRAN" + }, + "statmod": { + "Package": "statmod", + "Version": "1.5.1", + "Source": "Repository", + "Date": "2025-10-08", + "Title": "Statistical Modeling", + "Authors@R": "c(person(given = \"Gordon\", family = \"Smyth\", role = c(\"cre\", \"aut\"), email = \"smyth@wehi.edu.au\"), person(given = \"Lizhong\", family = \"Chen\", role = \"aut\"), person(given = \"Yifang\", family = \"Hu\", role = \"ctb\"), person(given = \"Peter\", family = \"Dunn\", role = \"ctb\"), person(given = \"Belinda\", family = \"Phipson\", role = \"ctb\"), person(given = \"Yunshun\", family = \"Chen\", role = \"ctb\"))", + "Maintainer": "Gordon Smyth ", + "Depends": [ + "R (>= 3.0.0)" + ], + "Imports": [ + "stats", + "graphics" + ], + "Suggests": [ + "MASS", + "tweedie" + ], + "Description": "A collection of algorithms and functions to aid statistical modeling. Includes limiting dilution analysis (aka ELDA), growth curve comparisons, mixed linear models, heteroscedastic regression, inverse-Gaussian probability calculations, Gauss quadrature and a secure convergence algorithm for nonlinear models. Also includes advanced generalized linear model functions including Tweedie and Digamma distributional families, secure convergence and exact distributional calculations for unit deviances.", + "License": "GPL-2 | GPL-3", + "NeedsCompilation": "yes", + "Author": "Gordon Smyth [cre, aut], Lizhong Chen [aut], Yifang Hu [ctb], Peter Dunn [ctb], Belinda Phipson [ctb], Yunshun Chen [ctb]", + "Repository": "CRAN" + }, + "stringi": { + "Package": "stringi", + "Version": "1.8.7", + "Source": "Repository", + "Date": "2025-03-27", + "Title": "Fast and Portable Character String Processing Facilities", + "Description": "A collection of character string/text/natural language processing tools for pattern searching (e.g., with 'Java'-like regular expressions or the 'Unicode' collation algorithm), random string generation, case mapping, string transliteration, concatenation, sorting, padding, wrapping, Unicode normalisation, date-time formatting and parsing, and many more. They are fast, consistent, convenient, and - thanks to 'ICU' (International Components for Unicode) - portable across all locales and platforms. Documentation about 'stringi' is provided via its website at and the paper by Gagolewski (2022, ).", + "URL": "https://stringi.gagolewski.com/, https://github.com/gagolews/stringi, https://icu.unicode.org/", + "BugReports": "https://github.com/gagolews/stringi/issues", + "SystemRequirements": "ICU4C (>= 61, optional)", + "Type": "Package", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ + "tools", + "utils", + "stats" + ], + "Biarch": "TRUE", + "License": "file LICENSE", + "Authors@R": "c(person(given = \"Marek\", family = \"Gagolewski\", role = c(\"aut\", \"cre\", \"cph\"), email = \"marek@gagolewski.com\", comment = c(ORCID = \"0000-0003-0637-6028\")), person(given = \"Bartek\", family = \"Tartanus\", role = \"ctb\"), person(\"Unicode, Inc. and others\", role=\"ctb\", comment = \"ICU4C source code, Unicode Character Database\") )", + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Marek Gagolewski [aut, cre, cph] (), Bartek Tartanus [ctb], Unicode, Inc. and others [ctb] (ICU4C source code, Unicode Character Database)", + "Maintainer": "Marek Gagolewski ", + "License_is_FOSS": "yes", + "Repository": "CRAN" + }, + "stringr": { + "Package": "stringr", + "Version": "1.5.2", + "Source": "Repository", + "Title": "Simple, Consistent Wrappers for Common String Operations", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\", \"cph\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A consistent, simple and easy to use set of wrappers around the fantastic 'stringi' package. All function and argument names (and positions) are consistent, all functions deal with \"NA\"'s and zero length vectors in the same way, and the output from one function is easy to feed into the input of another.", + "License": "MIT + file LICENSE", + "URL": "https://stringr.tidyverse.org, https://github.com/tidyverse/stringr", + "BugReports": "https://github.com/tidyverse/stringr/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "cli", + "glue (>= 1.6.1)", + "lifecycle (>= 1.0.3)", + "magrittr", + "rlang (>= 1.0.0)", + "stringi (>= 1.5.3)", + "vctrs (>= 0.4.0)" + ], + "Suggests": [ + "covr", + "dplyr", + "gt", + "htmltools", + "htmlwidgets", + "knitr", + "rmarkdown", + "testthat (>= 3.0.0)", + "tibble" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre, cph], Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" + }, + "timeDate": { + "Package": "timeDate", + "Version": "4051.111", + "Source": "Repository", + "Title": "Rmetrics - Chronological and Calendar Objects", + "Authors@R": "c(person(\"Diethelm\", \"Wuertz\", role=\"aut\", comment = \"original code\") , person(\"Tobias\", \"Setz\", role = c(\"aut\"), email = \"tobias.setz@live.com\") , person(\"Yohan\", \"Chalabi\", role = \"aut\") , person(\"Martin\",\"Maechler\", role = \"ctb\", email = \"maechler@stat.math.ethz.ch\", comment = c(ORCID = \"0000-0002-8685-9910\")) , person(given = c(\"Joe\", \"W.\"), family = \"Byers\", role = \"ctb\") , person(given = c(\"Georgi\", \"N.\"), family = \"Boshnakov\", role = c(\"cre\", \"aut\"), email = \"georgi.boshnakov@manchester.ac.uk\", comment = c(ORCID = \"0000-0003-2839-346X\")) )", + "Description": "The 'timeDate' class fulfils the conventions of the ISO 8601 standard as well as of the ANSI C and POSIX standards. Beyond these standards it provides the \"Financial Center\" concept which allows to handle data records collected in different time zones and mix them up to have always the proper time stamps with respect to your personal financial center, or alternatively to the GMT reference time. It can thus also handle time stamps from historical data records from the same time zone, even if the financial centers changed day light saving times at different calendar dates.", + "Depends": [ + "R (>= 3.6.0)", + "methods" + ], + "Imports": [ + "graphics", + "utils", + "stats" + ], + "Suggests": [ + "RUnit" + ], + "License": "GPL (>= 2)", + "Encoding": "UTF-8", + "URL": "https://geobosh.github.io/timeDateDoc/ (doc), https://r-forge.r-project.org/scm/viewvc.php/pkg/timeDate/?root=rmetrics (devel), https://www.rmetrics.org", + "BugReports": "https://r-forge.r-project.org/projects/rmetrics", + "NeedsCompilation": "no", + "Author": "Diethelm Wuertz [aut] (original code), Tobias Setz [aut], Yohan Chalabi [aut], Martin Maechler [ctb] (ORCID: ), Joe W. Byers [ctb], Georgi N. Boshnakov [cre, aut] (ORCID: )", + "Maintainer": "Georgi N. Boshnakov ", + "Repository": "CRAN" + }, + "timeSeries": { + "Package": "timeSeries", + "Version": "4041.111", + "Source": "Repository", + "Title": "Financial Time Series Objects (Rmetrics)", + "Authors@R": "c(person(\"Diethelm\", \"Wuertz\", role=\"aut\", comment = \"original code\") , person(\"Tobias\", \"Setz\", role = c(\"aut\"), email = \"tobias.setz@live.com\") , person(\"Yohan\", \"Chalabi\", role = \"aut\") , person(\"Martin\",\"Maechler\", role=\"ctb\", email=\"maechler@stat.math.ethz.ch\", comment = c(ORCID = \"0000-0002-8685-9910\")) , person(given = c(\"Georgi\", \"N.\"), family = \"Boshnakov\", role = c(\"cre\", \"aut\"), email = \"georgi.boshnakov@manchester.ac.uk\") )", + "Description": "'S4' classes and various tools for financial time series: Basic functions such as scaling and sorting, subsetting, mathematical operations and statistical functions.", + "Depends": [ + "R (>= 2.10)", + "timeDate (>= 4041.110)", + "methods" + ], + "Imports": [ + "graphics", + "grDevices", + "stats", + "utils" + ], + "Suggests": [ + "RUnit", + "robustbase", + "xts", + "zoo", + "PerformanceAnalytics", + "fTrading" + ], + "LazyData": "yes", + "License": "GPL (>= 2)", + "URL": "https://geobosh.github.io/timeSeriesDoc/ (doc), https://r-forge.r-project.org/scm/viewvc.php/pkg/timeSeries/?root=rmetrics (devel), https://www.rmetrics.org", + "BugReports": "https://r-forge.r-project.org/projects/rmetrics", + "NeedsCompilation": "no", + "Author": "Diethelm Wuertz [aut] (original code), Tobias Setz [aut], Yohan Chalabi [aut], Martin Maechler [ctb] (), Georgi N. Boshnakov [cre, aut]", + "Maintainer": "Georgi N. Boshnakov ", + "Repository": "CRAN" + }, + "vctrs": { + "Package": "vctrs", + "Version": "0.6.5", + "Source": "Repository", + "Title": "Vector Helpers", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = \"aut\"), person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = c(\"aut\", \"cre\")), person(\"data.table team\", role = \"cph\", comment = \"Radix sort based on data.table's forder() and their contribution to R's order()\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Defines new notions of prototype and size that are used to provide tools for consistent and well-founded type-coercion and size-recycling, and are in turn connected to ideas of type- and size-stability useful for analysing function interfaces.", + "License": "MIT + file LICENSE", + "URL": "https://vctrs.r-lib.org/, https://github.com/r-lib/vctrs", + "BugReports": "https://github.com/r-lib/vctrs/issues", + "Depends": [ + "R (>= 3.5.0)" + ], + "Imports": [ + "cli (>= 3.4.0)", + "glue", + "lifecycle (>= 1.0.3)", + "rlang (>= 1.1.0)" + ], + "Suggests": [ + "bit64", + "covr", + "crayon", + "dplyr (>= 0.8.5)", + "generics", + "knitr", + "pillar (>= 1.4.4)", + "pkgdown (>= 2.0.1)", + "rmarkdown", + "testthat (>= 3.0.0)", + "tibble (>= 3.1.3)", + "waldo (>= 0.2.0)", + "withr", + "xml2", + "zeallot" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "Language": "en-GB", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut], Lionel Henry [aut], Davis Vaughan [aut, cre], data.table team [cph] (Radix sort based on data.table's forder() and their contribution to R's order()), Posit Software, PBC [cph, fnd]", + "Maintainer": "Davis Vaughan ", + "Repository": "CRAN" + } + } +} diff --git a/test/ref/renv/.gitignore b/test/ref/renv/.gitignore new file mode 100644 index 0000000000..0ec0cbba2d --- /dev/null +++ b/test/ref/renv/.gitignore @@ -0,0 +1,7 @@ +library/ +local/ +cellar/ +lock/ +python/ +sandbox/ +staging/ diff --git a/test/ref/renv/activate.R b/test/ref/renv/activate.R new file mode 100644 index 0000000000..2753ae544b --- /dev/null +++ b/test/ref/renv/activate.R @@ -0,0 +1,1334 @@ + +local({ + + # the requested version of renv + version <- "1.1.5" + attr(version, "sha") <- NULL + + # the project directory + project <- Sys.getenv("RENV_PROJECT") + if (!nzchar(project)) + project <- getwd() + + # use start-up diagnostics if enabled + diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE") + if (diagnostics) { + start <- Sys.time() + profile <- tempfile("renv-startup-", fileext = ".Rprof") + utils::Rprof(profile) + on.exit({ + utils::Rprof(NULL) + elapsed <- signif(difftime(Sys.time(), start, units = "auto"), digits = 2L) + writeLines(sprintf("- renv took %s to run the autoloader.", format(elapsed))) + writeLines(sprintf("- Profile: %s", profile)) + print(utils::summaryRprof(profile)) + }, add = TRUE) + } + + # figure out whether the autoloader is enabled + enabled <- local({ + + # first, check config option + override <- getOption("renv.config.autoloader.enabled") + if (!is.null(override)) + return(override) + + # if we're being run in a context where R_LIBS is already set, + # don't load -- presumably we're being run as a sub-process and + # the parent process has already set up library paths for us + rcmd <- Sys.getenv("R_CMD", unset = NA) + rlibs <- Sys.getenv("R_LIBS", unset = NA) + if (!is.na(rlibs) && !is.na(rcmd)) + return(FALSE) + + # next, check environment variables + # prefer using the configuration one in the future + envvars <- c( + "RENV_CONFIG_AUTOLOADER_ENABLED", + "RENV_AUTOLOADER_ENABLED", + "RENV_ACTIVATE_PROJECT" + ) + + for (envvar in envvars) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(tolower(envval) %in% c("true", "t", "1")) + } + + # enable by default + TRUE + + }) + + # bail if we're not enabled + if (!enabled) { + + # if we're not enabled, we might still need to manually load + # the user profile here + profile <- Sys.getenv("R_PROFILE_USER", unset = "~/.Rprofile") + if (file.exists(profile)) { + cfg <- Sys.getenv("RENV_CONFIG_USER_PROFILE", unset = "TRUE") + if (tolower(cfg) %in% c("true", "t", "1")) + sys.source(profile, envir = globalenv()) + } + + return(FALSE) + + } + + # avoid recursion + if (identical(getOption("renv.autoloader.running"), TRUE)) { + warning("ignoring recursive attempt to run renv autoloader") + return(invisible(TRUE)) + } + + # signal that we're loading renv during R startup + options(renv.autoloader.running = TRUE) + on.exit(options(renv.autoloader.running = NULL), add = TRUE) + + # signal that we've consented to use renv + options(renv.consent = TRUE) + + # load the 'utils' package eagerly -- this ensures that renv shims, which + # mask 'utils' packages, will come first on the search path + library(utils, lib.loc = .Library) + + # unload renv if it's already been loaded + if ("renv" %in% loadedNamespaces()) + unloadNamespace("renv") + + # load bootstrap tools + ansify <- function(text) { + if (renv_ansify_enabled()) + renv_ansify_enhanced(text) + else + renv_ansify_default(text) + } + + renv_ansify_enabled <- function() { + + override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA) + if (!is.na(override)) + return(as.logical(override)) + + pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA) + if (identical(pane, "build")) + return(FALSE) + + testthat <- Sys.getenv("TESTTHAT", unset = "false") + if (tolower(testthat) %in% "true") + return(FALSE) + + iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false") + if (tolower(iderun) %in% "false") + return(FALSE) + + TRUE + + } + + renv_ansify_default <- function(text) { + text + } + + renv_ansify_enhanced <- function(text) { + + # R help links + pattern <- "`\\?(renv::(?:[^`])+)`" + replacement <- "`\033]8;;x-r-help:\\1\a?\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # runnable code + pattern <- "`(renv::(?:[^`])+)`" + replacement <- "`\033]8;;x-r-run:\\1\a\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # return ansified text + text + + } + + renv_ansify_init <- function() { + + envir <- renv_envir_self() + if (renv_ansify_enabled()) + assign("ansify", renv_ansify_enhanced, envir = envir) + else + assign("ansify", renv_ansify_default, envir = envir) + + } + + `%||%` <- function(x, y) { + if (is.null(x)) y else x + } + + catf <- function(fmt, ..., appendLF = TRUE) { + + quiet <- getOption("renv.bootstrap.quiet", default = FALSE) + if (quiet) + return(invisible()) + + msg <- sprintf(fmt, ...) + cat(msg, file = stdout(), sep = if (appendLF) "\n" else "") + + invisible(msg) + + } + + header <- function(label, + ..., + prefix = "#", + suffix = "-", + n = min(getOption("width"), 78)) + { + label <- sprintf(label, ...) + n <- max(n - nchar(label) - nchar(prefix) - 2L, 8L) + if (n <= 0) + return(paste(prefix, label)) + + tail <- paste(rep.int(suffix, n), collapse = "") + paste0(prefix, " ", label, " ", tail) + + } + + heredoc <- function(text, leave = 0) { + + # remove leading, trailing whitespace + trimmed <- gsub("^\\s*\\n|\\n\\s*$", "", text) + + # split into lines + lines <- strsplit(trimmed, "\n", fixed = TRUE)[[1L]] + + # compute common indent + indent <- regexpr("[^[:space:]]", lines) + common <- min(setdiff(indent, -1L)) - leave + text <- paste(substring(lines, common), collapse = "\n") + + # substitute in ANSI links for executable renv code + ansify(text) + + } + + bootstrap <- function(version, library) { + + friendly <- renv_bootstrap_version_friendly(version) + section <- header(sprintf("Bootstrapping renv %s", friendly)) + catf(section) + + # attempt to download renv + catf("- Downloading renv ... ", appendLF = FALSE) + withCallingHandlers( + tarball <- renv_bootstrap_download(version), + error = function(err) { + catf("FAILED") + stop("failed to download:\n", conditionMessage(err)) + } + ) + catf("OK") + on.exit(unlink(tarball), add = TRUE) + + # now attempt to install + catf("- Installing renv ... ", appendLF = FALSE) + withCallingHandlers( + status <- renv_bootstrap_install(version, tarball, library), + error = function(err) { + catf("FAILED") + stop("failed to install:\n", conditionMessage(err)) + } + ) + catf("OK") + + # add empty line to break up bootstrapping from normal output + catf("") + + return(invisible()) + } + + renv_bootstrap_tests_running <- function() { + getOption("renv.tests.running", default = FALSE) + } + + renv_bootstrap_repos <- function() { + + # get CRAN repository + cran <- getOption("renv.repos.cran", "https://cloud.r-project.org") + + # check for repos override + repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA) + if (!is.na(repos)) { + + # check for RSPM; if set, use a fallback repository for renv + rspm <- Sys.getenv("RSPM", unset = NA) + if (identical(rspm, repos)) + repos <- c(RSPM = rspm, CRAN = cran) + + return(repos) + + } + + # check for lockfile repositories + repos <- tryCatch(renv_bootstrap_repos_lockfile(), error = identity) + if (!inherits(repos, "error") && length(repos)) + return(repos) + + # retrieve current repos + repos <- getOption("repos") + + # ensure @CRAN@ entries are resolved + repos[repos == "@CRAN@"] <- cran + + # add in renv.bootstrap.repos if set + default <- c(FALLBACK = "https://cloud.r-project.org") + extra <- getOption("renv.bootstrap.repos", default = default) + repos <- c(repos, extra) + + # remove duplicates that might've snuck in + dupes <- duplicated(repos) | duplicated(names(repos)) + repos[!dupes] + + } + + renv_bootstrap_repos_lockfile <- function() { + + lockpath <- Sys.getenv("RENV_PATHS_LOCKFILE", unset = "renv.lock") + if (!file.exists(lockpath)) + return(NULL) + + lockfile <- tryCatch(renv_json_read(lockpath), error = identity) + if (inherits(lockfile, "error")) { + warning(lockfile) + return(NULL) + } + + repos <- lockfile$R$Repositories + if (length(repos) == 0) + return(NULL) + + keys <- vapply(repos, `[[`, "Name", FUN.VALUE = character(1)) + vals <- vapply(repos, `[[`, "URL", FUN.VALUE = character(1)) + names(vals) <- keys + + return(vals) + + } + + renv_bootstrap_download <- function(version) { + + sha <- attr(version, "sha", exact = TRUE) + + methods <- if (!is.null(sha)) { + + # attempting to bootstrap a development version of renv + c( + function() renv_bootstrap_download_tarball(sha), + function() renv_bootstrap_download_github(sha) + ) + + } else { + + # attempting to bootstrap a release version of renv + c( + function() renv_bootstrap_download_tarball(version), + function() renv_bootstrap_download_cran_latest(version), + function() renv_bootstrap_download_cran_archive(version) + ) + + } + + for (method in methods) { + path <- tryCatch(method(), error = identity) + if (is.character(path) && file.exists(path)) + return(path) + } + + stop("All download methods failed") + + } + + renv_bootstrap_download_impl <- function(url, destfile) { + + mode <- "wb" + + # https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17715 + fixup <- + Sys.info()[["sysname"]] == "Windows" && + substring(url, 1L, 5L) == "file:" + + if (fixup) + mode <- "w+b" + + args <- list( + url = url, + destfile = destfile, + mode = mode, + quiet = TRUE + ) + + if ("headers" %in% names(formals(utils::download.file))) { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } + + do.call(utils::download.file, args) + + } + + renv_bootstrap_download_custom_headers <- function(url) { + + headers <- getOption("renv.download.headers") + if (is.null(headers)) + return(character()) + + if (!is.function(headers)) + stopf("'renv.download.headers' is not a function") + + headers <- headers(url) + if (length(headers) == 0L) + return(character()) + + if (is.list(headers)) + headers <- unlist(headers, recursive = FALSE, use.names = TRUE) + + ok <- + is.character(headers) && + is.character(names(headers)) && + all(nzchar(names(headers))) + + if (!ok) + stop("invocation of 'renv.download.headers' did not return a named character vector") + + headers + + } + + renv_bootstrap_download_cran_latest <- function(version) { + + spec <- renv_bootstrap_download_cran_latest_find(version) + type <- spec$type + repos <- spec$repos + + baseurl <- utils::contrib.url(repos = repos, type = type) + ext <- if (identical(type, "source")) + ".tar.gz" + else if (Sys.info()[["sysname"]] == "Windows") + ".zip" + else + ".tgz" + name <- sprintf("renv_%s%s", version, ext) + url <- paste(baseurl, name, sep = "/") + + destfile <- file.path(tempdir(), name) + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (inherits(status, "condition")) + return(FALSE) + + # report success and return + destfile + + } + + renv_bootstrap_download_cran_latest_find <- function(version) { + + # check whether binaries are supported on this system + binary <- + getOption("renv.bootstrap.binary", default = TRUE) && + !identical(.Platform$pkgType, "source") && + !identical(getOption("pkgType"), "source") && + Sys.info()[["sysname"]] %in% c("Darwin", "Windows") + + types <- c(if (binary) "binary", "source") + + # iterate over types + repositories + for (type in types) { + for (repos in renv_bootstrap_repos()) { + + # build arguments for utils::available.packages() call + args <- list(type = type, repos = repos) + + # add custom headers if available -- note that + # utils::available.packages() will pass this to download.file() + if ("headers" %in% names(formals(utils::download.file))) { + headers <- renv_bootstrap_download_custom_headers(repos) + if (length(headers) && is.character(headers)) + args$headers <- headers + } + + # retrieve package database + db <- tryCatch( + as.data.frame( + do.call(utils::available.packages, args), + stringsAsFactors = FALSE + ), + error = identity + ) + + if (inherits(db, "error")) + next + + # check for compatible entry + entry <- db[db$Package %in% "renv" & db$Version %in% version, ] + if (nrow(entry) == 0) + next + + # found it; return spec to caller + spec <- list(entry = entry, type = type, repos = repos) + return(spec) + + } + } + + # if we got here, we failed to find renv + fmt <- "renv %s is not available from your declared package repositories" + stop(sprintf(fmt, version)) + + } + + renv_bootstrap_download_cran_archive <- function(version) { + + name <- sprintf("renv_%s.tar.gz", version) + repos <- renv_bootstrap_repos() + urls <- file.path(repos, "src/contrib/Archive/renv", name) + destfile <- file.path(tempdir(), name) + + for (url in urls) { + + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (identical(status, 0L)) + return(destfile) + + } + + return(FALSE) + + } + + renv_bootstrap_download_tarball <- function(version) { + + # if the user has provided the path to a tarball via + # an environment variable, then use it + tarball <- Sys.getenv("RENV_BOOTSTRAP_TARBALL", unset = NA) + if (is.na(tarball)) + return() + + # allow directories + if (dir.exists(tarball)) { + name <- sprintf("renv_%s.tar.gz", version) + tarball <- file.path(tarball, name) + } + + # bail if it doesn't exist + if (!file.exists(tarball)) { + + # let the user know we weren't able to honour their request + fmt <- "- RENV_BOOTSTRAP_TARBALL is set (%s) but does not exist." + msg <- sprintf(fmt, tarball) + warning(msg) + + # bail + return() + + } + + catf("- Using local tarball '%s'.", tarball) + tarball + + } + + renv_bootstrap_github_token <- function() { + for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(envval) + } + } + + renv_bootstrap_download_github <- function(version) { + + enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") + if (!identical(enabled, "TRUE")) + return(FALSE) + + # prepare download options + token <- renv_bootstrap_github_token() + if (is.null(token)) + token <- "" + + if (nzchar(Sys.which("curl")) && nzchar(token)) { + fmt <- "--location --fail --header \"Authorization: token %s\"" + extra <- sprintf(fmt, token) + saved <- options("download.file.method", "download.file.extra") + options(download.file.method = "curl", download.file.extra = extra) + on.exit(do.call(base::options, saved), add = TRUE) + } else if (nzchar(Sys.which("wget")) && nzchar(token)) { + fmt <- "--header=\"Authorization: token %s\"" + extra <- sprintf(fmt, token) + saved <- options("download.file.method", "download.file.extra") + options(download.file.method = "wget", download.file.extra = extra) + on.exit(do.call(base::options, saved), add = TRUE) + } + + url <- file.path("https://api.github.com/repos/rstudio/renv/tarball", version) + name <- sprintf("renv_%s.tar.gz", version) + destfile <- file.path(tempdir(), name) + + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (!identical(status, 0L)) + return(FALSE) + + renv_bootstrap_download_augment(destfile) + + return(destfile) + + } + + # Add Sha to DESCRIPTION. This is stop gap until #890, after which we + # can use renv::install() to fully capture metadata. + renv_bootstrap_download_augment <- function(destfile) { + sha <- renv_bootstrap_git_extract_sha1_tar(destfile) + if (is.null(sha)) { + return() + } + + # Untar + tempdir <- tempfile("renv-github-") + on.exit(unlink(tempdir, recursive = TRUE), add = TRUE) + untar(destfile, exdir = tempdir) + pkgdir <- dir(tempdir, full.names = TRUE)[[1]] + + # Modify description + desc_path <- file.path(pkgdir, "DESCRIPTION") + desc_lines <- readLines(desc_path) + remotes_fields <- c( + "RemoteType: github", + "RemoteHost: api.github.com", + "RemoteRepo: renv", + "RemoteUsername: rstudio", + "RemotePkgRef: rstudio/renv", + paste("RemoteRef: ", sha), + paste("RemoteSha: ", sha) + ) + writeLines(c(desc_lines[desc_lines != ""], remotes_fields), con = desc_path) + + # Re-tar + local({ + old <- setwd(tempdir) + on.exit(setwd(old), add = TRUE) + + tar(destfile, compression = "gzip") + }) + invisible() + } + + # Extract the commit hash from a git archive. Git archives include the SHA1 + # hash as the comment field of the tarball pax extended header + # (see https://www.kernel.org/pub/software/scm/git/docs/git-archive.html) + # For GitHub archives this should be the first header after the default one + # (512 byte) header. + renv_bootstrap_git_extract_sha1_tar <- function(bundle) { + + # open the bundle for reading + # We use gzcon for everything because (from ?gzcon) + # > Reading from a connection which does not supply a 'gzip' magic + # > header is equivalent to reading from the original connection + conn <- gzcon(file(bundle, open = "rb", raw = TRUE)) + on.exit(close(conn)) + + # The default pax header is 512 bytes long and the first pax extended header + # with the comment should be 51 bytes long + # `52 comment=` (11 chars) + 40 byte SHA1 hash + len <- 0x200 + 0x33 + res <- rawToChar(readBin(conn, "raw", n = len)[0x201:len]) + + if (grepl("^52 comment=", res)) { + sub("52 comment=", "", res) + } else { + NULL + } + } + + renv_bootstrap_install <- function(version, tarball, library) { + + # attempt to install it into project library + dir.create(library, showWarnings = FALSE, recursive = TRUE) + output <- renv_bootstrap_install_impl(library, tarball) + + # check for successful install + status <- attr(output, "status") + if (is.null(status) || identical(status, 0L)) + return(status) + + # an error occurred; report it + header <- "installation of renv failed" + lines <- paste(rep.int("=", nchar(header)), collapse = "") + text <- paste(c(header, lines, output), collapse = "\n") + stop(text) + + } + + renv_bootstrap_install_impl <- function(library, tarball) { + + # invoke using system2 so we can capture and report output + bin <- R.home("bin") + exe <- if (Sys.info()[["sysname"]] == "Windows") "R.exe" else "R" + R <- file.path(bin, exe) + + args <- c( + "--vanilla", "CMD", "INSTALL", "--no-multiarch", + "-l", shQuote(path.expand(library)), + shQuote(path.expand(tarball)) + ) + + system2(R, args, stdout = TRUE, stderr = TRUE) + + } + + renv_bootstrap_platform_prefix_default <- function() { + + # read version component + version <- Sys.getenv("RENV_PATHS_VERSION", unset = "R-%v") + + # expand placeholders + placeholders <- list( + list("%v", format(getRversion()[1, 1:2])), + list("%V", format(getRversion()[1, 1:3])) + ) + + for (placeholder in placeholders) + version <- gsub(placeholder[[1L]], placeholder[[2L]], version, fixed = TRUE) + + # include SVN revision for development versions of R + # (to avoid sharing platform-specific artefacts with released versions of R) + devel <- + identical(R.version[["status"]], "Under development (unstable)") || + identical(R.version[["nickname"]], "Unsuffered Consequences") + + if (devel) + version <- paste(version, R.version[["svn rev"]], sep = "-r") + + version + + } + + renv_bootstrap_platform_prefix <- function() { + + # construct version prefix + version <- renv_bootstrap_platform_prefix_default() + + # build list of path components + components <- c(version, R.version$platform) + + # include prefix if provided by user + prefix <- renv_bootstrap_platform_prefix_impl() + if (!is.na(prefix) && nzchar(prefix)) + components <- c(prefix, components) + + # build prefix + paste(components, collapse = "/") + + } + + renv_bootstrap_platform_prefix_impl <- function() { + + # if an explicit prefix has been supplied, use it + prefix <- Sys.getenv("RENV_PATHS_PREFIX", unset = NA) + if (!is.na(prefix)) + return(prefix) + + # if the user has requested an automatic prefix, generate it + auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA) + if (is.na(auto) && getRversion() >= "4.4.0") + auto <- "TRUE" + + if (auto %in% c("TRUE", "True", "true", "1")) + return(renv_bootstrap_platform_prefix_auto()) + + # empty string on failure + "" + + } + + renv_bootstrap_platform_prefix_auto <- function() { + + prefix <- tryCatch(renv_bootstrap_platform_os(), error = identity) + if (inherits(prefix, "error") || prefix %in% "unknown") { + + msg <- paste( + "failed to infer current operating system", + "please file a bug report at https://github.com/rstudio/renv/issues", + sep = "; " + ) + + warning(msg) + + } + + prefix + + } + + renv_bootstrap_platform_os <- function() { + + sysinfo <- Sys.info() + sysname <- sysinfo[["sysname"]] + + # handle Windows + macOS up front + if (sysname == "Windows") + return("windows") + else if (sysname == "Darwin") + return("macos") + + # check for os-release files + for (file in c("/etc/os-release", "/usr/lib/os-release")) + if (file.exists(file)) + return(renv_bootstrap_platform_os_via_os_release(file, sysinfo)) + + # check for redhat-release files + if (file.exists("/etc/redhat-release")) + return(renv_bootstrap_platform_os_via_redhat_release()) + + "unknown" + + } + + renv_bootstrap_platform_os_via_os_release <- function(file, sysinfo) { + + # read /etc/os-release + release <- utils::read.table( + file = file, + sep = "=", + quote = c("\"", "'"), + col.names = c("Key", "Value"), + comment.char = "#", + stringsAsFactors = FALSE + ) + + vars <- as.list(release$Value) + names(vars) <- release$Key + + # get os name + os <- tolower(sysinfo[["sysname"]]) + + # read id + id <- "unknown" + for (field in c("ID", "ID_LIKE")) { + if (field %in% names(vars) && nzchar(vars[[field]])) { + id <- vars[[field]] + break + } + } + + # read version + version <- "unknown" + for (field in c("UBUNTU_CODENAME", "VERSION_CODENAME", "VERSION_ID", "BUILD_ID")) { + if (field %in% names(vars) && nzchar(vars[[field]])) { + version <- vars[[field]] + break + } + } + + # join together + paste(c(os, id, version), collapse = "-") + + } + + renv_bootstrap_platform_os_via_redhat_release <- function() { + + # read /etc/redhat-release + contents <- readLines("/etc/redhat-release", warn = FALSE) + + # infer id + id <- if (grepl("centos", contents, ignore.case = TRUE)) + "centos" + else if (grepl("redhat", contents, ignore.case = TRUE)) + "redhat" + else + "unknown" + + # try to find a version component (very hacky) + version <- "unknown" + + parts <- strsplit(contents, "[[:space:]]")[[1L]] + for (part in parts) { + + nv <- tryCatch(numeric_version(part), error = identity) + if (inherits(nv, "error")) + next + + version <- nv[1, 1] + break + + } + + paste(c("linux", id, version), collapse = "-") + + } + + renv_bootstrap_library_root_name <- function(project) { + + # use project name as-is if requested + asis <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT_ASIS", unset = "FALSE") + if (asis) + return(basename(project)) + + # otherwise, disambiguate based on project's path + id <- substring(renv_bootstrap_hash_text(project), 1L, 8L) + paste(basename(project), id, sep = "-") + + } + + renv_bootstrap_library_root <- function(project) { + + prefix <- renv_bootstrap_profile_prefix() + + path <- Sys.getenv("RENV_PATHS_LIBRARY", unset = NA) + if (!is.na(path)) + return(paste(c(path, prefix), collapse = "/")) + + path <- renv_bootstrap_library_root_impl(project) + if (!is.null(path)) { + name <- renv_bootstrap_library_root_name(project) + return(paste(c(path, prefix, name), collapse = "/")) + } + + renv_bootstrap_paths_renv("library", project = project) + + } + + renv_bootstrap_library_root_impl <- function(project) { + + root <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT", unset = NA) + if (!is.na(root)) + return(root) + + type <- renv_bootstrap_project_type(project) + if (identical(type, "package")) { + userdir <- renv_bootstrap_user_dir() + return(file.path(userdir, "library")) + } + + } + + renv_bootstrap_validate_version <- function(version, description = NULL) { + + # resolve description file + # + # avoid passing lib.loc to `packageDescription()` below, since R will + # use the loaded version of the package by default anyhow. note that + # this function should only be called after 'renv' is loaded + # https://github.com/rstudio/renv/issues/1625 + description <- description %||% packageDescription("renv") + + # check whether requested version 'version' matches loaded version of renv + sha <- attr(version, "sha", exact = TRUE) + valid <- if (!is.null(sha)) + renv_bootstrap_validate_version_dev(sha, description) + else + renv_bootstrap_validate_version_release(version, description) + + if (valid) + return(TRUE) + + # the loaded version of renv doesn't match the requested version; + # give the user instructions on how to proceed + dev <- identical(description[["RemoteType"]], "github") + remote <- if (dev) + paste("rstudio/renv", description[["RemoteSha"]], sep = "@") + else + paste("renv", description[["Version"]], sep = "@") + + # display both loaded version + sha if available + friendly <- renv_bootstrap_version_friendly( + version = description[["Version"]], + sha = if (dev) description[["RemoteSha"]] + ) + + fmt <- heredoc(" + renv %1$s was loaded from project library, but this project is configured to use renv %2$s. + - Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile. + - Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library. + ") + catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote) + + FALSE + + } + + renv_bootstrap_validate_version_dev <- function(version, description) { + + expected <- description[["RemoteSha"]] + if (!is.character(expected)) + return(FALSE) + + pattern <- sprintf("^\\Q%s\\E", version) + grepl(pattern, expected, perl = TRUE) + + } + + renv_bootstrap_validate_version_release <- function(version, description) { + expected <- description[["Version"]] + is.character(expected) && identical(expected, version) + } + + renv_bootstrap_hash_text <- function(text) { + + hashfile <- tempfile("renv-hash-") + on.exit(unlink(hashfile), add = TRUE) + + writeLines(text, con = hashfile) + tools::md5sum(hashfile) + + } + + renv_bootstrap_load <- function(project, libpath, version) { + + # try to load renv from the project library + if (!requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) + return(FALSE) + + # warn if the version of renv loaded does not match + renv_bootstrap_validate_version(version) + + # execute renv load hooks, if any + hooks <- getHook("renv::autoload") + for (hook in hooks) + if (is.function(hook)) + tryCatch(hook(), error = warnify) + + # load the project + renv::load(project) + + TRUE + + } + + renv_bootstrap_profile_load <- function(project) { + + # if RENV_PROFILE is already set, just use that + profile <- Sys.getenv("RENV_PROFILE", unset = NA) + if (!is.na(profile) && nzchar(profile)) + return(profile) + + # check for a profile file (nothing to do if it doesn't exist) + path <- renv_bootstrap_paths_renv("profile", profile = FALSE, project = project) + if (!file.exists(path)) + return(NULL) + + # read the profile, and set it if it exists + contents <- readLines(path, warn = FALSE) + if (length(contents) == 0L) + return(NULL) + + # set RENV_PROFILE + profile <- contents[[1L]] + if (!profile %in% c("", "default")) + Sys.setenv(RENV_PROFILE = profile) + + profile + + } + + renv_bootstrap_profile_prefix <- function() { + profile <- renv_bootstrap_profile_get() + if (!is.null(profile)) + return(file.path("profiles", profile, "renv")) + } + + renv_bootstrap_profile_get <- function() { + profile <- Sys.getenv("RENV_PROFILE", unset = "") + renv_bootstrap_profile_normalize(profile) + } + + renv_bootstrap_profile_set <- function(profile) { + profile <- renv_bootstrap_profile_normalize(profile) + if (is.null(profile)) + Sys.unsetenv("RENV_PROFILE") + else + Sys.setenv(RENV_PROFILE = profile) + } + + renv_bootstrap_profile_normalize <- function(profile) { + + if (is.null(profile) || profile %in% c("", "default")) + return(NULL) + + profile + + } + + renv_bootstrap_path_absolute <- function(path) { + + substr(path, 1L, 1L) %in% c("~", "/", "\\") || ( + substr(path, 1L, 1L) %in% c(letters, LETTERS) && + substr(path, 2L, 3L) %in% c(":/", ":\\") + ) + + } + + renv_bootstrap_paths_renv <- function(..., profile = TRUE, project = NULL) { + renv <- Sys.getenv("RENV_PATHS_RENV", unset = "renv") + root <- if (renv_bootstrap_path_absolute(renv)) NULL else project + prefix <- if (profile) renv_bootstrap_profile_prefix() + components <- c(root, renv, prefix, ...) + paste(components, collapse = "/") + } + + renv_bootstrap_project_type <- function(path) { + + descpath <- file.path(path, "DESCRIPTION") + if (!file.exists(descpath)) + return("unknown") + + desc <- tryCatch( + read.dcf(descpath, all = TRUE), + error = identity + ) + + if (inherits(desc, "error")) + return("unknown") + + type <- desc$Type + if (!is.null(type)) + return(tolower(type)) + + package <- desc$Package + if (!is.null(package)) + return("package") + + "unknown" + + } + + renv_bootstrap_user_dir <- function() { + dir <- renv_bootstrap_user_dir_impl() + path.expand(chartr("\\", "/", dir)) + } + + renv_bootstrap_user_dir_impl <- function() { + + # use local override if set + override <- getOption("renv.userdir.override") + if (!is.null(override)) + return(override) + + # use R_user_dir if available + tools <- asNamespace("tools") + if (is.function(tools$R_user_dir)) + return(tools$R_user_dir("renv", "cache")) + + # try using our own backfill for older versions of R + envvars <- c("R_USER_CACHE_DIR", "XDG_CACHE_HOME") + for (envvar in envvars) { + root <- Sys.getenv(envvar, unset = NA) + if (!is.na(root)) + return(file.path(root, "R/renv")) + } + + # use platform-specific default fallbacks + if (Sys.info()[["sysname"]] == "Windows") + file.path(Sys.getenv("LOCALAPPDATA"), "R/cache/R/renv") + else if (Sys.info()[["sysname"]] == "Darwin") + "~/Library/Caches/org.R-project.R/R/renv" + else + "~/.cache/R/renv" + + } + + renv_bootstrap_version_friendly <- function(version, shafmt = NULL, sha = NULL) { + sha <- sha %||% attr(version, "sha", exact = TRUE) + parts <- c(version, sprintf(shafmt %||% " [sha: %s]", substring(sha, 1L, 7L))) + paste(parts, collapse = "") + } + + renv_bootstrap_exec <- function(project, libpath, version) { + if (!renv_bootstrap_load(project, libpath, version)) + renv_bootstrap_run(project, libpath, version) + } + + renv_bootstrap_run <- function(project, libpath, version) { + + # perform bootstrap + bootstrap(version, libpath) + + # exit early if we're just testing bootstrap + if (!is.na(Sys.getenv("RENV_BOOTSTRAP_INSTALL_ONLY", unset = NA))) + return(TRUE) + + # try again to load + if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) { + return(renv::load(project = project)) + } + + # failed to download or load renv; warn the user + msg <- c( + "Failed to find an renv installation: the project will not be loaded.", + "Use `renv::activate()` to re-initialize the project." + ) + + warning(paste(msg, collapse = "\n"), call. = FALSE) + + } + + renv_json_read <- function(file = NULL, text = NULL) { + + jlerr <- NULL + + # if jsonlite is loaded, use that instead + if ("jsonlite" %in% loadedNamespaces()) { + + json <- tryCatch(renv_json_read_jsonlite(file, text), error = identity) + if (!inherits(json, "error")) + return(json) + + jlerr <- json + + } + + # otherwise, fall back to the default JSON reader + json <- tryCatch(renv_json_read_default(file, text), error = identity) + if (!inherits(json, "error")) + return(json) + + # report an error + if (!is.null(jlerr)) + stop(jlerr) + else + stop(json) + + } + + renv_json_read_jsonlite <- function(file = NULL, text = NULL) { + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") + jsonlite::fromJSON(txt = text, simplifyVector = FALSE) + } + + renv_json_read_patterns <- function() { + + list( + + # objects + list("{", "\t\n\tobject(\t\n\t", TRUE), + list("}", "\t\n\t)\t\n\t", TRUE), + + # arrays + list("[", "\t\n\tarray(\t\n\t", TRUE), + list("]", "\n\t\n)\n\t\n", TRUE), + + # maps + list(":", "\t\n\t=\t\n\t", TRUE), + + # newlines + list("\\u000a", "\n", FALSE) + + ) + + } + + renv_json_read_envir <- function() { + + envir <- new.env(parent = emptyenv()) + + envir[["+"]] <- `+` + envir[["-"]] <- `-` + + envir[["object"]] <- function(...) { + result <- list(...) + names(result) <- as.character(names(result)) + result + } + + envir[["array"]] <- list + + envir[["true"]] <- TRUE + envir[["false"]] <- FALSE + envir[["null"]] <- NULL + + envir + + } + + renv_json_read_remap <- function(object, patterns) { + + # repair names if necessary + if (!is.null(names(object))) { + + nms <- names(object) + for (pattern in patterns) + nms <- gsub(pattern[[2L]], pattern[[1L]], nms, fixed = TRUE) + names(object) <- nms + + } + + # repair strings if necessary + if (is.character(object)) { + for (pattern in patterns) + object <- gsub(pattern[[2L]], pattern[[1L]], object, fixed = TRUE) + } + + # recurse for other objects + if (is.recursive(object)) + for (i in seq_along(object)) + object[i] <- list(renv_json_read_remap(object[[i]], patterns)) + + # return remapped object + object + + } + + renv_json_read_default <- function(file = NULL, text = NULL) { + + # read json text + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") + + # convert into something the R parser will understand + patterns <- renv_json_read_patterns() + transformed <- text + for (pattern in patterns) + transformed <- gsub(pattern[[1L]], pattern[[2L]], transformed, fixed = TRUE) + + # parse it + rfile <- tempfile("renv-json-", fileext = ".R") + on.exit(unlink(rfile), add = TRUE) + writeLines(transformed, con = rfile) + json <- parse(rfile, keep.source = FALSE, srcfile = NULL)[[1L]] + + # evaluate in safe environment + result <- eval(json, envir = renv_json_read_envir()) + + # fix up strings if necessary -- do so only with reversible patterns + patterns <- Filter(function(pattern) pattern[[3L]], patterns) + renv_json_read_remap(result, patterns) + + } + + + # load the renv profile, if any + renv_bootstrap_profile_load(project) + + # construct path to library root + root <- renv_bootstrap_library_root(project) + + # construct library prefix for platform + prefix <- renv_bootstrap_platform_prefix() + + # construct full libpath + libpath <- file.path(root, prefix) + + # run bootstrap code + renv_bootstrap_exec(project, libpath, version) + + invisible() + +}) diff --git a/test/ref/renv/settings.json b/test/ref/renv/settings.json new file mode 100644 index 0000000000..ffdbb3200f --- /dev/null +++ b/test/ref/renv/settings.json @@ -0,0 +1,19 @@ +{ + "bioconductor.version": null, + "external.libraries": [], + "ignored.packages": [], + "package.dependency.fields": [ + "Imports", + "Depends", + "LinkingTo" + ], + "ppm.enabled": null, + "ppm.ignored.urls": [], + "r.version": null, + "snapshot.type": "implicit", + "use.cache": true, + "vcs.ignore.cellar": true, + "vcs.ignore.library": true, + "vcs.ignore.local": true, + "vcs.manage.ignores": true +} diff --git a/test/truncate.jl b/test/truncate.jl index 9c2a286d09..c06105d5e5 100644 --- a/test/truncate.jl +++ b/test/truncate.jl @@ -30,19 +30,23 @@ function verify_and_test_drive(jsonfile, selected, n_tsamples::Int,lower::Int,up end # perform testing - dtype = eval(dsym) - dtypet = Truncated d0 = eval(Meta.parse(ex)) if minimum(d0) > lower || maximum(d0) < upper continue end - println(" testing truncated($(ex),$lower,$upper)") - d = truncated(eval(Meta.parse(ex)),lower,upper) - if dtype != Uniform && dtype != DiscreteUniform # Uniform is truncated to Uniform - @assert isa(dtype, Type) && dtype <: UnivariateDistribution - @test isa(d, dtypet) - # verification and testing + println(" testing truncated(", ex, ", ", lower, ", ", upper, ")") + d = truncated(d0,lower,upper) + if d0 isa Uniform + @test d isa Uniform + @test minimum(d) == lower + @test maximum(d) == upper + elseif d0 isa DiscreteUniform + @test d isa DiscreteUniform + @test minimum(d) == lower + @test maximum(d) == upper + else + @test d isa Truncated verify_and_test(d, dct, n_tsamples) end end diff --git a/test/univariates.jl b/test/univariates.jl index f6304de592..9247534b0f 100644 --- a/test/univariates.jl +++ b/test/univariates.jl @@ -9,9 +9,8 @@ function verify_and_test_drive(jsonfile, selected, n_tsamples::Int) R = JSON.parsefile(jsonfile) for dct in R ex = Meta.parse(dct["expr"]) - @assert ex.head == :call - dsym = ex.args[1] - dname = string(dsym) + @assert Meta.isexpr(ex, :call) && !isempty(ex.args) + dname = string(ex.args[1]) # test whether it is included in the selected list # or all are selected (when selected is empty) @@ -20,15 +19,11 @@ function verify_and_test_drive(jsonfile, selected, n_tsamples::Int) end # perform testing - println(" testing $(ex)") - dtype = eval(dsym) + println(" testing ", ex) + dtype = eval(Meta.parse(dct["dtype"])) + @test dtype <: UnivariateDistribution d = eval(ex) - if dsym == :truncated - @test isa(d, Truncated{Normal{Float64}}) - else - @test dtype isa Type && dtype <: UnivariateDistribution - @test d isa dtype - end + @test d isa dtype # verification and testing verify_and_test(dtype, d, dct, n_tsamples) @@ -48,16 +43,13 @@ _json_value(x::AbstractString) = error("Invalid numerical value: $x") -function verify_and_test(D::Union{Type,Function}, d::UnivariateDistribution, dct::Dict, n_tsamples::Int) +function verify_and_test(D::Type, d::UnivariateDistribution, dct::Dict, n_tsamples::Int) # verify properties # # Note: properties include all applicable params and stats # - # D can be a function - if isa(D, Type) - @assert isa(d, D) - end + @test d isa D # test various constructors for promotion, all-Integer args, etc. pars = params(d) @@ -68,20 +60,22 @@ function verify_and_test(D::Union{Type,Function}, d::UnivariateDistribution, dct typeof, (S, T) -> T <: Distribution ? promote_type(S, partype(T)) : (T <: Nothing ? S : promote_type(S, eltype(T))), pars; init = Union{}) # promotion constructor: - float_pars = map(x -> isa(x, AbstractFloat), pars) - if length(pars) > 1 && sum(float_pars) > 1 && !isa(D, typeof(truncated)) - mixed_pars = Any[pars...] - first_float = findfirst(float_pars) - mixed_pars[first_float] = Float32(mixed_pars[first_float]) - - @test typeof(D(mixed_pars...)) == typeof(d) - end + if !(D <: Distributions.Truncated) + float_pars = map(x -> isa(x, AbstractFloat), pars) + if length(pars) > 1 && sum(float_pars) > 1 + mixed_pars = Any[pars...] + first_float = findfirst(float_pars) + mixed_pars[first_float] = Float32(mixed_pars[first_float]) + + @test typeof(D(mixed_pars...)) == typeof(d) + end - # conversions - if D isa Type && !isconcretetype(D) - @test convert(D{partype(d)}, d) === d - d32 = convert(D{Float32}, d) - @test d32 isa D{Float32} + # conversions + if !isconcretetype(D) + @test convert(D{partype(d)}, d) === d + d32 = convert(D{Float32}, d) + @test d32 isa D{Float32} + end end # verify properties (params & stats)