FitDistPlot

class FitDistPlot @JvmOverloads constructor(data: DoubleArray, cdfFunction: ContinuousDistributionIfc, quantileFun: InverseCDFIfc, dataName: String? = null)

A class for creating and displaying distribution fit plots.

FitDistPlot generates a set of four diagnostic plots to assess how well a continuous distribution fits to a given dataset:

  • Density plot: Compares the empirical density of the data with the PDF of the fitted distribution

  • QQ plot (Quantile-Quantile): Compares the quantiles of the data with the theoretical quantiles

  • ECDF plot (Empirical Cumulative Distribution Function): Compares the empirical CDF with the theoretical CDF

  • PP plot (Probability-Probability): Plots the empirical probabilities against the theoretical probabilities

Parameters

data

The data array to be analyzed and plotted.

cdfFunction

The continuous distribution interface providing CDF and PDF functions.

quantileFun

The inverse CDF interface providing quantile functions.

dataName

Optional name for the data being analyzed, used in the plot title.

Constructors

Link copied to clipboard
constructor(data: DoubleArray, cdfFunction: ContinuousDistributionIfc, quantileFun: InverseCDFIfc, dataName: String? = null)

Properties

Link copied to clipboard

The default directory where plots will be saved. Defaults to KSL.plotDir.

Link copied to clipboard

The density plot component comparing data density to the theoretical PDF.

Link copied to clipboard

The ECDF plot component comparing empirical CDF to the theoretical CDF.

Link copied to clipboard

The PP plot component comparing empirical probabilities to theoretical probabilities.

Link copied to clipboard

The QQ plot component comparing data quantiles to theoretical quantiles.

Link copied to clipboard

The title of the plot. If dataName is provided in the constructor, the title will include it.

Functions

Link copied to clipboard
fun saveToFile(fileName: String, directory: Path = defaultPlotDir, extType: PlotIfc.ExtType = PlotIfc.ExtType.PNG): File
Link copied to clipboard
fun showInBrowser(plotTitle: String = title): File

Opens up a browser window and shows the contents of the plot within the browser. A temporary file is created to represent the plot for display within the browser.

Link copied to clipboard
fun toHTML(): String