From c74feebaef6b693b494773507c125bb7217a5998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul-Christian=20B=C3=BCrkner?= Date: Tue, 19 Mar 2024 15:29:52 +0100 Subject: [PATCH] fix issue #1627 --- R/distributions.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/distributions.R b/R/distributions.R index ca5158ed0..c32866d7b 100644 --- a/R/distributions.R +++ b/R/distributions.R @@ -301,7 +301,13 @@ pskew_normal <- function(q, mu = 0, sigma = 1, alpha = 0, delta[is_alpha_inf] <- sign(alpha[is_alpha_inf]) out <- numeric(nz) for (k in seq_len(nz)) { - if (is_alpha_inf[k]) { + if (is.infinite(z[k])) { + if (z[k] > 0) { + out[k] <- 1 + } else { + out[k] <- 0 + } + } else if (is_alpha_inf[k]) { if (alpha[k] > 0) { out[k] <- 2 * (pnorm(pmax(z[k], 0)) - 0.5) } else {