# qBCCGo function in GAMLSS package (quantile function)

I am working with GAMLSS technique and I use LMS (with three parameters of mean,variation and skewness) method. I found the follwoing formula to calculate the lower limit of normal as the link function for mu is log fucntion.

LLN= exp(log(mu)+log(1-1.645*nu*sigma)/nu)


In GAMLSS package, there is a function qBCCGo(p, mu = 1, sigma = 0.1, nu = 1, lower.tail = TRUE, log.p = FALSE) to calculate the lower limit of normal for Box-Cox Cole and Green distribution (p should be 0.05)

LLN= 5th percentile of that particular distribution

But the results of these two functions are not the same. I would be so thankful if you provide me some advice.

Forexample:

mu=0.8
nu=1.1
sigma=0.4


or

nu=1.2088855
sigma=0.7251396
mu=0.5203920


(for the second example the function in R gives us the answer but the formula would give us NA)

qBCCGo(0.05, mu = mu, sigma = sigma, nu = nu, lower.tail = TRUE, log.p = FALSE)
exp(log(mu)+log(1-1.645*nu*sigma)/nu)


qBCCGo is exact, so use that.

[Note the formula for LLN is approximate and

log(1-1.645 * nu * sigma) will be NA, if 1 < 1.645 * nu * sigma.]

Yes,

for calculating the ULN we need to use

qBCCGo(0.05, mu = mu, sigma = sigma, nu = nu, lower.tail = FALSE, log.p = FALSE)

or

qBCCGo(0.95, mu = mu, sigma = sigma, nu = nu, lower.tail = TRUE, log.p = FALSE)

which are exact and so should be used.

[The approximate formula is exp(log(mu)+log(1+1.645nusigma)/nu).]

– Community Bot
Jan 12, 2023 at 14:32
• @Robert, thanks so much, Just for double checking : for calculating the ULN we need to use qBCCGo(0.05, mu = mu, sigma = sigma, nu = nu, lower.tail = FALSE, log.p = FALSE) which is which is equivalent to exp(log(mu)+log(1+1.645*nu*sigma)/nu).Is this right? Jan 13, 2023 at 8:43
• These accounts are duplicates, Robert. Please visit stats.stackexchange.com/help/merging-accounts to merge them.
– whuber
Jan 16, 2023 at 17:07

mu=0.8

nu=1.1

sigma=0.4

qBCCGo(0.05, mu = mu, sigma = sigma, nu = nu, lower.tail = TRUE, log.p = FALSE)

gives an exact result.

However exp(log(mu)+log(1-1.645nusigma)/nu)

is an approximation.

The approximation should be quite accurate if sigma*abs(nu) < 0.27

[See page 441 of Rigby et al. (2019)]

For example:

mu=0.8

nu=1.1

sigma=0.2

qBCCGo(0.05, mu = mu, sigma = sigma, nu = nu, lower.tail = TRUE, log.p = FALSE)

0.5317892

exp(log(mu)+log(1-1.645nusigma)/nu)

0.5317606

sigma*abs(nu) = 0.4 * 1.1 = 0.44

• thank you so much for the reply. I need to calculate the LLN for each ID after applying the LMS method. For several Ids the value of sigma*abs(nu) is more than 0.27. So when I use qBCCGo function, I can calculate it but the answer would be NA as soon as I run the formula. So, which function should I use? The formula or qBCCGo? Jan 10, 2023 at 17:59