Skip to content
All library documents

Log-Normal Distribution Statistics, Quantiles, and Data Fitting

Article TradingView scripts

Summary

This Pine library provides tools for representing a log-normal distribution through the parameters of its underlying normal distribution in log space. It converts between standardized scores and positive linear values, computes descriptive statistics such as mean, median, mode, variance, skewness, and kurtosis, and supplies probability density functions and quantile summaries. Its quantile structure includes quartiles, whisker points, and derived measures such as the interquartile range and trimean.

The library also fits values between empirical data distributions by matching their quantiles, with interpolation for array positions between observations. Density fitting can use empirical quantiles to adjust the modeled curve. This is a statistical utility that may support modeling or analysis of skewed data; it does not present a trading signal, market dataset, or backtest. The supplied document is incomplete in places, and users should verify implementation assumptions and numerical behavior before relying on outputs, especially when fitting empirical distributions.

Key ideas

  • The library stores log-space location and scale parameters while reporting many statistics in linear space.
  • It offers conversions between log-normal values and standard normal scores.
  • It computes distribution moments, density, quantiles, and several robust summary measures.
  • Quantile-based fitting maps values between empirical distributions using interpolation.
  • The document gives utility functions rather than trading evidence or a tested strategy.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.