From fec3dfaeabf1133ab13fd869885289d2f5db2386 Mon Sep 17 00:00:00 2001 From: Jonathan Berrisch Date: Thu, 2 Mar 2023 07:51:59 +0100 Subject: [PATCH] Switch shape parameters in beta knot distribution This is more intuitive as more knots will end up in the lower tail if mu is decreased. --- R/splines.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/splines.R b/R/splines.R index 7e12e9c..dc18149 100644 --- a/R/splines.R +++ b/R/splines.R @@ -1,6 +1,6 @@ pgbeta <- function(x, mu = .5, sig = 1, nonc = 0) { - a <- mu * sig * 2 - b <- (1 - mu) * sig * 2 + a <- (1 - mu) * sig * 2 + b <- mu * sig * 2 c <- abs(nonc) seq_beta <- pbeta(x, a, b, c) if (nonc < 0) seq_beta <- rev(1 - seq_beta)