LOGPEARSONDIST and LOGNORMALDIST Function in PHP

Click For Summary
SUMMARY

The discussion focuses on the implementation of the LOGNORMDIST and LOGPEARSONDIST functions in PHP, highlighting their absence in native JavaScript and the need for a PHP library. Users can utilize the formulajs library for JavaScript, but for PHP, it is recommended to search for libraries using terms like 'PHP lognormal'. The conversation emphasizes the importance of understanding statistics and PHP to effectively implement these functions, particularly for cumulative distributions, which require numerical methods due to the lack of analytic solutions.

PREREQUISITES
  • Understanding of statistical concepts, particularly cumulative distribution functions (CDF) and probability density functions (PDF).
  • Familiarity with PHP programming and its statistical extensions.
  • Knowledge of the lognormal distribution and Pearson distribution.
  • Experience with numerical methods for statistical calculations.
NEXT STEPS
  • Research PHP libraries for statistical functions, specifically those that implement lognormal and Pearson distributions.
  • Learn about the implementation of cumulative distribution functions (CDF) in PHP.
  • Study the use of stats_cdf_normal() and stat_dens_normal() functions in PHP for normal distributions.
  • Explore numerical methods for calculating distributions without analytic solutions.
USEFUL FOR

This discussion is beneficial for PHP developers, statisticians, and data analysts looking to implement statistical functions related to lognormal and Pearson distributions in their applications.

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:
Technology news 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

Similar threads

  • · Replies 21 ·
Replies
21
Views
6K
  • · Replies 187 ·
7
Replies
187
Views
11K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 7 ·
Replies
7
Views
7K
  • · Replies 3 ·
Replies
3
Views
3K