1
$\begingroup$

I want to compute probabilities assuming data have log skew normal distribution (in R). As I couldn't find any package that directly computes log skew normal (as plnorm does log normal), I am wondering, if I can get log normal with pnorm, for example to compute log normal probability at point 2 with mean=2 and sd=3:

plnorm(2,2,3)
pnorm(log(2),2,3)

can I use psn to compute skew-log-normal probability at point 2 with mean=2, sd=3 and skewness=1:

psn(log(2), xi=2, omega=3, alpha=1, tau=0, dp=NULL)

or I need some other transformations of the mean/sd/skewness before I apply it? In case I need to transform it first, didnt I need some transformations also in plnorm, instead of just putting mean and sd?

$\endgroup$
3
  • 1
    $\begingroup$ What does psn do? What do its arguments represent? Could you be explicit about what you mean by a "log skew normal" distribution? $\endgroup$
    – whuber
    Commented Feb 21, 2019 at 21:58
  • $\begingroup$ psn is part of 'sn' package in r for skew normal distribution, and psn computes its distribution function with xi being location parameter, omega scale parameters, alpha slant etc... I am not very sure how do they relate to the mean, sd and skewness. Here is the link cran.r-project.org/web/packages/sn/sn.pdf . Log skew normal i found for example here ncbi.nlm.nih.gov/pmc/articles/PMC2758628 $\endgroup$
    – ZAD
    Commented Feb 21, 2019 at 22:07
  • $\begingroup$ Why not take the logarithm of the data and fit regular normal and skew normal distributions? $\endgroup$
    – corey979
    Commented Feb 21, 2019 at 23:21

1 Answer 1

2
$\begingroup$

Let $X$ be a skew normal random variable (or really, what is used here is only that it is some random variable on the real line.) Of interest is the distribution of $e^X$. Then, as usual, $$ F_{e^X}(Z)= F_X(\log z) \quad \text{for $z>0$.} $$ and by differentiation (assuming $X$ has a density) we find $$ f_{e^X}(z)= f_X(\log z)/z.$$ Assuming you have functions psn, dsn in R available, you can define

library(sn)
plsn <-  function(x, ...) sn::psn(log(x), ...)

And for the density:

dlsn <- function(x, ..., log=FALSE) {
    d <- x;  ind0 <- ifelse(x <= 0,1L,0L) ; ind1 <- 1-ind0
    d[ind0] <- 0
    d[ind1] <- sn::dsn(log(x[ind1]), ..., log=TRUE) - log(x[ind1])
    if (log=FALSE)  d[ind1] <- exp(d[ind1])
    d

}

(not tested)

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.