0

When we use a distribution in R the command is always dnorm,pnorm,qnorm, for example. Is there a way to find the formulas for this distributions?

It would be nice If I could see every distribution in this way:

`dgumbel <- function(x,mu,s){ # PDF
exp((mu - x)/s - exp((mu - x)/s))/s
}

 pgumbel <- function(q,mu,s){ # CDF
 exp(-exp(-((q - mu)/s)))
  }

 qgumbel <- function(p, mu, s){ # quantile function
 mu-s*log(-log(p))
 }`

Is this possible?

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
Hark
  • 115
  • 1
  • 11
  • 3
    Study the documentation. However, not every distribution is that simple. E.g., the normal CDF involves an integral. Also, often these R functions use approximations or optimizations for extreme tails and such. Furthermore, most of them are implemented in C code. – Roland Mar 02 '17 at 11:16
  • 1
    Check this post: http://stackoverflow.com/questions/19226816/how-can-i-view-the-source-code-for-a-function – talat Mar 02 '17 at 11:16
  • 1
    One of my favorite references is "Statistical Distributions" by Forbes, Evans, et. al. It has a couple of brief chapters reviewing the overall theory and then a series of a few dozen brief chapters, each discussing a standard distribution, with information about formulas,parameters, moment generating functions, etc. The current (4th) edition seems a bit pricey on Amazon, though you could doubtless pick up a used earlier edition for less (I use the second edition). – John Coleman Mar 02 '17 at 12:27
  • Thanks a lot for the advices! – Hark Mar 02 '17 at 14:53

0 Answers0