WeibullDataSet.CalculateBestFit

From ReliaWiki
Jump to navigation Jump to search


Automatically finds the best fitting distribution and fits that distribution to the current data set using the settings specified in the BestFitSettings property.

This is equivalent to clicking the Implement button in the Distribution Wizard.

Syntax

  • CalculateBestFit()

Usage Example

 'Declare a new WeibullDataSet object. See WeibullDataSet. 
 Dim WDS As New WeibullDataSet("AddFailure_Example")

 'Add failure times to the data set. 
 WDS.AddFailure(100, 1)
 WDS.AddFailure(120, 1)
 WDS.AddFailure(130, 1)  
 
 'Specify that the normal, lognormal and 2-parameter Weibull 
 'distributions will be considered. 
 WDS.BestFitSettings.AllowExponential1 = False
 WDS.BestFitSettings.AllowExponential2 = False
 WDS.BestFitSettings.AllowNormal = True
 WDS.BestFitSettings.AllowLognormal = True
 WDS.BestFitSettings.AllowWeibull2 = True
 WDS.BestFitSettings.AllowWeibull3 = False
 WDS.BestFitSettings.AllowGamma = False
 WDS.BestFitSettings.AllowGenGamma = False
 WDS.BestFitSettings.AllowLogistic = False
 WDS.BestFitSettings.AllowLoglogistic = False
 WDS.BestFitSettings.AllowGumbel = False
 'Fit the data to the life distribution that is estimated to have the best fit. 
 WDS.CalculateBestFit()
 
 'Retrieve the fitted life distribution model. See cModel. 
 Dim model As cModel
 model = WDS.FittedModel