LOGPEARSONDIST and LOGNORMALDIST Function in PHP

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 1K views
gind_id
Messages
1
Reaction score
0
TL;DR
I need function of lognormdist and logpearsondist in PHP code.
for reference you can see JS in formulajs.info/functions.
lognormdist use by call : formulajs.LOGNORMDIST(value, mean, stdev, true)
logpearsondist use by call : formulajs.NORMSDIST(z, true)

anybody can help?
 
Last edited:
on Phys.org
These are not part of JavaScript, they are part of a JS library. I suggest you search for a PHP library using search terms like 'PHP lognormal'.

Having said that, if you know enough statistics and enough PHP to use such a library effectively it is probably quicker to write and test your own classes.

Edit: I didn't realize that the final argument true in the two example function calls flags a request for the cumulative lognormal/Pearson distributions respectively. Implementing the CDF for such a distribution is not trivial as there is no analytic solution, although numerical methods are well documented.
 
Last edited:
  • Like
Likes   Reactions: gind_id
it would help if the formula.ps page you linked actually provided any explanation of what the functions do or what their arguments are. But based on the Excel NORM.S.DIST and LOGNORM.DIST functions I believe the PHP statistics extention has all you require.

stats_cdf_normal() returns the CDF of the normal distribution and stat_dens_normal() returns the PDF. To obtain the standard normal distribution, pass a mean of 0 and a variance of 1.

There is no lognormal function, but you can easily derive it from the standard normal distribution (as explained on the Excel documentation linked above).[/url]
 
Last edited:
  • Like
Likes   Reactions: gind_id