Skip to content

Conversation

@bbolker
Copy link

@bbolker bbolker commented May 19, 2024

The qKumIW() function appears to be a missing a ^(1/mu) . This also affects rKumIW(). This is equivalent to fixing the value of mu to regardless of the actual parameter value passed by the user.

The current CRAN version should pass the first test below (where mu=1) and fail the second.

library(RelDists)
params0 <- list(mu = 1, sigma = 2.3, nu = 3.5)
params <- list(mu = 2, sigma = 2.3, nu = 3.5)
pvec <- seq(0.01, 0.99, length = 9)
qvec <- 1:10
## round trips
rt0 <- do.call(qKumIW,
        c(list(p = do.call(pKumIW, c(list(q = qvec), params0))),
          params0)) 
stopifnot(all.equal(qvec, rt0))
rt1 <- do.call(qKumIW,
        c(list(p = do.call(pKumIW, c(list(q = qvec), params))),
          params))
stopifnot(all.equal(qvec, rt1))

@fhernanb
Copy link
Collaborator

Thanks, Ben, for the comment.

We corrected the bug and also made a significant change. We modified the parameter order in the KumIW distribution to ensure that KumIW(mu, sigma, nu=1) matches the IW(mu, sigma) since IW is a particular case of KumIW when the nu parameter is equal to 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants