CModel.SetConfidenceLevel: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:cModel.SetConfidenceLevel}}
{{DISPLAYTITLE:cModel.SetConfidenceLevel}}{{Template:API}}{{Template:APIBreadcrumb|9|.[[CModel Class|cModel]]}}
{{Template:APIClass|CModel Class|cModel}}  
{{Template:CModel.SetConfindenceLevel.Cmt}} {{Template:BooleanReturn.Cmt}}


==Syntax==
*SetConfidenceLevel( Level {{APIPrefix|As Double}} , Sides {{APIPrefix|As}} [[ConfBoundsSides Enumeration|ConfBoundsSides]] , UseConfidenceLevelInPercents {{APIPrefix|As Boolean}} , {{APIPrefix|sError}} {{APIPrefix|As String}} ) {{APIPrefix|As Boolean}}


Parameters
<onlyinclude>Sets the confidence level for all subsequent confidence bounds calculations. Returns a '''Boolean''' value; when true, indicates a successful update.</onlyinclude>
:''Level'': The confidence level, entered as a percentage.


:''Sides'': The sides setting for this confidence level (e.g., lower bound), specified using the [[ConfBoundsSides Enumeration|ConfBoundsSides]] enumeration.
== Syntax ==
'''.SetConfidenceLevel'''(''Level'', ''Sides'', ''UseConfidenceLevelInPercents'', {{APIPrefix|ByRef}} ''isError'')


:''UseConfidenceLevelInPercents'': Whether to show the result as a percentage (otherwise it is shown as a decimal).
===Parameters===
''Level''
:Double. The confidence level, entered as a percentage. (Required)


:''sError'': Return string for any error results.
''Sides''
: The sides setting (e.g., lower bound) for this confidence level. Can be any [[ConfBoundsSides Enumeration|ConfBoundsSides]] constant. (Required)


== Usage Example ==
''UseConfidenceLevelInPercents''
  {{APIComment|'Declare the cModel class using an in-line parameter list.}}
:Boolean. When true, the result is shown as a percentage; otherwise, it is shown as a decimal. (Required)
   Dim newModel As New cModel(ModelTypeEnum.Weibull2, ModelCategoryEnum.Reliability, "NewModel1", 1, 100)
 
''sError''
:String. Returns a string for any error results. (Required)
 
 
== Example ==
'''VBA'''
{{APIComment|...}}
{{APIComment|'Add code to get an existing model or create a new one.}}
  {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
{{APIComment|...}}
{{APIComment|'Set the confidence level to 90% two-sided bounds.}}
  {{APIComment|'Declare a string variable for any errors found during this method.}}
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
  {{APIPrefix|Call}} AModel.SetConfidenceLevel(0.9, ConfBoundsSides_TwoSidedBoth, False, ErrorMsg)
{{APIComment|'Confidence bounds calculations are now possible. For example,}}
{{APIComment|'the following code calculates the 90% two-sided confidence bounds on the reliability at 100 hrs.}}
  {{APIPrefix|Dim}} ResultValue {{APIPrefix|As}} BoundsValues
  {{APIPrefix|Set}} ResultValue = AModel.Bounds_Reliability(100)
 
'''VB.NET'''
{{APIComment|...}}
{{APIComment|'Add code to get an existing model or create a new one.}}
   {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
{{APIComment|...}}
{{APIComment|'Set the confidence level to 90% two-sided bounds.}}
{{APIComment|'Declare a string variable for any errors found during this method.}}
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
  AModel.SetConfidenceLevel(0.9, ConfBoundsSides.TwoSidedBoth, False, ErrorMsg)
   
   
  {{APIComment|'Set a new confidence level. Set SetsError for any errors found during this method}}
  {{APIComment|'Confidence bounds calculations are now possible. For example,}}
   Dim SuccessSetConfLevel As Boolean
{{APIComment|'the following code calculates the 90% two-sided confidence bounds on the reliability at 100 hrs.}}
   Dim SetsError As String
   {{APIPrefix|Dim}} ResultValue {{APIPrefix|As}} BoundsValues
  SuccessSetConfLevel = newModel.SetConfindenceLevel(.9, [[ConfBoundsSides]].TwoSidedBoth, False, SetsError)
   ResultValue = AModel.Bounds_Reliability(100)

Revision as of 18:15, 29 July 2015

APIWiki.png


Member of: SynthesisAPI9.cModel


Sets the confidence level for all subsequent confidence bounds calculations. Returns a Boolean value; when true, indicates a successful update.

Syntax

.SetConfidenceLevel(Level, Sides, UseConfidenceLevelInPercents, ByRef isError)

Parameters

Level

Double. The confidence level, entered as a percentage. (Required)

Sides

The sides setting (e.g., lower bound) for this confidence level. Can be any ConfBoundsSides constant. (Required)

UseConfidenceLevelInPercents

Boolean. When true, the result is shown as a percentage; otherwise, it is shown as a decimal. (Required)

sError

String. Returns a string for any error results. (Required)


Example

VBA

 ... 

 'Add code to get an existing model or create a new one. 
 Dim AModel As New cModel
 ... 

 'Set the confidence level to 90% two-sided bounds. 
 'Declare a string variable for any errors found during this method. 
 Dim ErrorMsg As String
 Call AModel.SetConfidenceLevel(0.9, ConfBoundsSides_TwoSidedBoth, False, ErrorMsg)

 'Confidence bounds calculations are now possible. For example, 
 'the following code calculates the 90% two-sided confidence bounds on the reliability at 100 hrs. 
 Dim ResultValue As BoundsValues
 Set ResultValue = AModel.Bounds_Reliability(100)
VB.NET

 ... 

 'Add code to get an existing model or create a new one. 
 Dim AModel As New cModel
 ... 

 'Set the confidence level to 90% two-sided bounds. 
 'Declare a string variable for any errors found during this method. 
 Dim ErrorMsg As String
 AModel.SetConfidenceLevel(0.9, ConfBoundsSides.TwoSidedBoth, False, ErrorMsg)

 'Confidence bounds calculations are now possible. For example, 
 'the following code calculates the 90% two-sided confidence bounds on the reliability at 100 hrs. 
 Dim ResultValue As BoundsValues
 ResultValue = AModel.Bounds_Reliability(100)