Add Distribution Fitting & Simulation Features to Your Applications |
||||||
SPA SDK Help Home • Learn More About the SPA SDK | ||||||
SPADistribution.Defined (property, read-only)DescriptionReturns whether the distribution is defined for the specified x-value. To obtain the actual x-values range, you can use the SPADistribution.Statistics property (see the note below). Syntax
object.Defined(x As Double)
Arguments
Return Value(Boolean) - whether the distribution is defined. 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
How to Obtain the X-Values RangeTo obtain the actual x-values range, you can use the SPADistribution.Statistics property: Sub Range() Dim dist As New SPADistribution Dim min, max As String SPAApplication.Initialize dist.Type = SPADistGamma If dist.Statistics.Defined(SPAStatMin) Then min = dist.Statistics.Value(SPAStatMin) Else min = "-Infinity" End If If dist.Statistics.Defined(SPAStatMax) Then max = dist.Statistics.Value(SPAStatMax) Else max = "+Infinity" End If MsgBox "min=" & min & "; max=" & max End Sub |
||||||
Copyright © MathWave Technologies www.mathwave.com |