Simulation & Probabilistic Analysis SDK
Add Distribution Fitting & Simulation Features to Your Applications

SPA SDK Help HomeLearn More About the SPA SDK

SPADistribution.Pdf (method)

Description

Evaluates the Probability Density Function (PDF). If the function value is a positive infinity, this method will return the SPAEPosInf error.

Syntax

object.Pdf(x As Double)

Arguments

Name
Type
Description
x Double The x-value at which the PDF should be evaluated. This argument must be within the accepted range of values, otherwise the method will return the SPAEInvalidArg error. You can use the SPADistribution.Defined property to check whether the function can be evaluated at the specified x-value.

Return Value

(Double) - the Probability Density Function value.

Example

Sub Test()
  Dim dist As New SPADistribution
  Dim x, y As Double

  SPAApplication.Initialize

  ' specify the distribution type and parameters
  dist.Type = SPADistWeibull  ' Weibull distribution 
  dist.Param(0) = 1.5         ' alpha
  dist.Param(1) = 2           ' beta

  x = 1

  ' check if the x-value is valid
  If dist.Defined(x) Then
    y = dist.Pdf(x)
  Else
    MsgBox "The distribution is not defined for this x-value"
  End If
End Sub
  
Copyright © MathWave Technologies
www.mathwave.com