WeibullDataSet Class: Difference between revisions
Chris Kahn (talk | contribs) No edit summary |
Chris Kahn (talk | contribs) No edit summary |
||
Line 53: | Line 53: | ||
*[[WeibullEvents.ShowCalculationProgress|ShowCalculationProgress( WeibullDataSet )]]{{APIComment|{{Template:WeibullEvents.ShowCalculationProgress.Cmt}}}} | *[[WeibullEvents.ShowCalculationProgress|ShowCalculationProgress( WeibullDataSet )]]{{APIComment|{{Template:WeibullEvents.ShowCalculationProgress.Cmt}}}} | ||
*[[WeibullEvents.HideCalculationProgress|HideCalculationProgress( WeibullDataSet )]]{{APIComment|{{Template:WeibullEvents.HideCalculationProgress.Cmt}}}} | *[[WeibullEvents.HideCalculationProgress|HideCalculationProgress( WeibullDataSet )]]{{APIComment|{{Template:WeibullEvents.HideCalculationProgress.Cmt}}}} | ||
== Usage Example == | |||
This example demonstrates how to fit three failure times to a life distribution and then use the fitted distribution to calculate the reliability at a specified time. Full application examples are available at [[Synthesis_API_Reference#Application_Examples]]. | |||
{{APIComment|'Initialize a new WeibullDataSet object}} | |||
Dim ADS As New WeibullDataSet("DataSet1") | |||
{{APIComment|'Set life distribution}} | |||
WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull | |||
WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter | |||
{{APIComment|'Set applicable analysis settings}} | |||
WDS.AnalysisSettings.Analysis = WeibullSolverMethod.MLE | |||
WDS.AnalysisSettings.RankingMethod = WeibullSolverRankMethod.Median | |||
WDS.AnalysisSettings.UseRSRegression = False | |||
WDS.AnalysisSettings.ConfBounds = WeibullSolverCBMethod.FisherMatrix | |||
WDS.AnalysisSettings.SortBeforeCalculations = True | |||
WDS.AnalysisSettings.UngroupGroupedData = False | |||
{{APIComment|'Set Application Setup options}} | |||
WDS.AnalysisSettings.UseSpecialSort = True | |||
WDS.GeneralSettings.AllowBiasingNormal = False | |||
WDS.GeneralSettings.DiscardNegLocation = False | |||
WDS.GeneralSettings.ResetExpLocation = False | |||
WDS.GeneralSettings.Use3PTrueMLE = False | |||
WDS.GeneralSettings.UseExtendedGGamma = False | |||
WDS.GeneralSettings.UsePlottedYPoints = False | |||
WDS.GeneralSettings.WarnNegLocation = False | |||
{{APIComment|'Add failure times}} | |||
WDS.AddFailure(16, 1) | |||
WDS.AddFailure(34, 1) | |||
WDS.AddFailure(53, 1) | |||
WDS.AddFailure(75, 1) | |||
WDS.AddFailure(93, 1) | |||
WDS.AddFailure(120, 1) | |||
{{APIComment|'Add 4 suspensions}} | |||
WDS.AddFailure(120, 4) | |||
{{APIComment|'Fit failure times to the specified distribution}} | |||
WDS.Calculate() | |||
{{APIComment|'Get the reliability at 300 hours}} | |||
Dim Rel As Double | |||
Rel = WDS.FittedModel.Reliability(300) |
Revision as of 23:53, 4 April 2014
Provides the functionality of a Weibull++ standard folio, including entering data in a data set, specifying analysis settings and fitting a distribution to the data set. To create plots, use the WAPlots class.
A usage example for this class is available here.
Constructors
- WeibullDataSet Creates a new WeibullDataSet object with an empty data set name.
- WeibullDataSet( String ) Creates a new WeibullDataSet object with the user-specified data set name.
Methods
Use these methods to enter data points into a data sheet and analyze them. The settings for the analysis are specified with this class's properties.
Add/Remove Data
- AddFailure( Double, Integer ) Adds failure times to the data set, using the specified time and number of failures at that time.
- AddSuspension( Double, Integer ) Adds suspensions to the data set, using the specified time and number of suspensions at that time.
- AddFailureInterval( Double, Double, Integer ) Adds interval censored failures to the data set, using the specified start/end times and number of failures that occurred within the interval.
- AddSuspensionInterval( Double, Double, Integer ) Adds interval censored suspensions to the data set, using the specified start/end times and number of suspensions for that interval.
- AddFreeForm( Double, Double ) Adds a free-form data point to the data set, using the specified time and percentage values.
- ClearDataSet Clears all data in the data set and removes the fitted model, if any.
Analyze Data
- Calculate Fits the distribution to the current data set using the settings specified in the AnalysisSettings property.
- CalculateBestFit Automatically finds the best fitting distribution and fits that distribution to the current data set using the settings specified in the BestFitSettings property.
Properties
Use these properties to specify analysis settings and view analysis results, as well as view or edit properties of the data set.
Analysis Settings
- AnalysisSettings (as WeibullAnalysisOptions) Sets the control panel settings for use with the Calculate method.
- BestFitSettings (as WeibullBestFitOptions) Sets the Distribution Wizard and control panel settings for use with the CalculateBestFit method.
- GeneralSettings (as WeibullGeneralOptions) Sets some of the Application Setup calculation options that can apply to both the Calculate and CalculateBestFit methods.
Analysis Results
- FittedModel (as cModel) Gets the fitted model from the life data analysis. This property is cleared if the analysis could not be completed.
- AnalysisResults (as WeibullAnalysisResults) Gets the correlation coefficient, likelihood value and percent non-zero values that were estimated from the analysis, if applicable.
Data Set Properties
- DatasetName (as string) Gets or sets the name of the data set, which will be displayed on any plot you create.
- FailureCount (as integer) Gets the total number of failures in the data set.
- SuspensionCount (as integer) Gets the total number of suspensions in the data set.
Events
The WeibullEvents class contains all the event handlers that can be called by WeibullDataSet. To use events, you must inherit the class, override its methods and assign its instance to the Events property of a WeibullDataSet. WeibullEvents inheritance is not available in VB6/VBA.
The event handlers include:
- Message( WeibullDataSet, String, String, Boolean ) Called when a message should be displayed. Displays a message.
- Question( WeibullDataSet, String, MsgBoxStyle, MsgBoxResult ) Called when an answer to a question is required. Displays a prompt and returns the result.
- GetDistrParameters( WeibullDataSet, String, Boolean, List( Of ParamInputInfo ), Boolean ) Called when additional input is required.
- UpdateCalculationProgress( WeibullDataSet, String, String, Double, Boolean, Long, Boolean ) Called when the calculation progress should be updated. Provides ability to customize the calculation progress display.
- ShowCalculationProgress( WeibullDataSet ) Called when calculation progress should be shown. Shows the current calculation progress if the calculation process is running.
- HideCalculationProgress( WeibullDataSet ) Called when calculation progress should be hidden. Hides the calculation progress display.
Usage Example
This example demonstrates how to fit three failure times to a life distribution and then use the fitted distribution to calculate the reliability at a specified time. Full application examples are available at Synthesis_API_Reference#Application_Examples.
'Initialize a new WeibullDataSet object Dim ADS As New WeibullDataSet("DataSet1") 'Set life distribution WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter 'Set applicable analysis settings WDS.AnalysisSettings.Analysis = WeibullSolverMethod.MLE WDS.AnalysisSettings.RankingMethod = WeibullSolverRankMethod.Median WDS.AnalysisSettings.UseRSRegression = False WDS.AnalysisSettings.ConfBounds = WeibullSolverCBMethod.FisherMatrix WDS.AnalysisSettings.SortBeforeCalculations = True WDS.AnalysisSettings.UngroupGroupedData = False 'Set Application Setup options WDS.AnalysisSettings.UseSpecialSort = True WDS.GeneralSettings.AllowBiasingNormal = False WDS.GeneralSettings.DiscardNegLocation = False WDS.GeneralSettings.ResetExpLocation = False WDS.GeneralSettings.Use3PTrueMLE = False WDS.GeneralSettings.UseExtendedGGamma = False WDS.GeneralSettings.UsePlottedYPoints = False WDS.GeneralSettings.WarnNegLocation = False 'Add failure times WDS.AddFailure(16, 1) WDS.AddFailure(34, 1) WDS.AddFailure(53, 1) WDS.AddFailure(75, 1) WDS.AddFailure(93, 1) WDS.AddFailure(120, 1) 'Add 4 suspensions WDS.AddFailure(120, 4) 'Fit failure times to the specified distribution WDS.Calculate() 'Get the reliability at 300 hours Dim Rel As Double Rel = WDS.FittedModel.Reliability(300)