CModel.SetConfidenceLevel: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:cModel.SetConfidenceLevel}}{{Template:API}}{{Template:APIBreadcrumb|9|.[[CModel Class|cModel]]}}
{{DISPLAYTITLE:cModel.SetConfidenceLevel}}{{Template:API}}{{Template:APIBreadcrumb|.[[CModel Class|cModel]]}}




<onlyinclude>Sets the confidence level for all subsequent confidence bounds calculations. Returns a '''Boolean''' value; when true, indicates a successful update.</onlyinclude>
<onlyinclude>Sets the confidence level to use in confidence bounds calculations for published models. Returns a '''Boolean''' value; when true, indicates that a confidence level has been set.</onlyinclude>


== Syntax ==
== Syntax ==
  '''.SetConfidenceLevel'''(''Level'', ''Sides'', ''UseConfidenceLevelInPercents'', {{APIPrefix|ByRef}} ''isError'')
  '''.SetConfidenceLevel'''(''Level'', ''Sides'', ''UseConfidenceLevelInPercents'', {{APIPrefix|ByRef}} ''sError'')


===Parameters===
===Parameters===
''Level''
''Level''
:Double. The confidence level, entered as a percentage. (Required)
:Required. Double. The confidence level, entered as a percentage.


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


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


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




== Example ==
== Example ==
This example assumes that a published model with ID #47 exists in the repository.
  '''VBA'''
  '''VBA'''
   
   
  {{APIComment|...}}
  {{APIComment|...}}
   
   
  {{APIComment|'Add code to get an existing model or create a new one.}}
  {{APIComment|'Get model ID #47 from project ID #1 in the repository.}}
  {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
  {{APIPrefix|Dim}} AModel {{APIPrefix|As}} cModel
  {{APIComment|...}}
  MyRepository.Project.SetCurrentProject(1)  
  {{APIPrefix|Set}} AModel = MyRepository.Model.GetModel(47)
   
   
  {{APIComment|'Set the confidence level to 90% two-sided bounds.}}
  {{APIComment|'Set the confidence level to 90% two-sided bounds.}}
  {{APIComment|'Declare a string variable for any errors found during this method.}}
  {{APIComment|'Declare a string variable for any errors found during this method.}}
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
  {{APIPrefix|Call}} AModel.SetConfidenceLevel(0.9, ConfBoundsSides_TwoSidedBoth, False, ErrorMsg)
  {{APIPrefix|Call}} AModel.SetConfidenceLevel(0.9, ConfBoundsSides_TwoSidedBoth, False, ErrorMsg)
   
   
  {{APIComment|'Confidence bounds calculations are now possible. For example,}}
  {{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.}}
  {{APIComment|'the following code calculates the 90% two-sided confidence bounds on the reliability at 100 hrs.}}
  {{APIPrefix|Dim}} ResultValue {{APIPrefix|As}} BoundsValues
  {{APIPrefix|Dim}} ResultValue {{APIPrefix|As}} BoundsValues
  {{APIPrefix|Set}} ResultValue = AModel.Bounds_Reliability(100)
  {{APIPrefix|Set}} ResultValue = AModel.Bounds_Reliability(100)


  '''VB.NET'''
  '''VB.NET'''
Line 44: Line 47:
  {{APIComment|...}}
  {{APIComment|...}}
   
   
  {{APIComment|'Add code to get an existing model or create a new one.}}
  {{APIComment|'Get model ID #47 from project ID #1 in the repository.}}
  {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
  {{APIPrefix|Dim}} AModel {{APIPrefix|As}} cModel
  {{APIComment|...}}
  MyRepository.Project.SetCurrentProject(1)  
  AModel = MyRepository.Model.GetModel(47)
   
   
  {{APIComment|'Set the confidence level to 90% two-sided bounds.}}
  {{APIComment|'Set the confidence level to 90% two-sided bounds.}}
  {{APIComment|'Declare a string variable for any errors found during this method.}}
  {{APIComment|'Declare a string variable for any errors found during this method.}}
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
  AModel.SetConfidenceLevel(0.9, ConfBoundsSides.TwoSidedBoth, False, ErrorMsg)
  AModel.SetConfidenceLevel(0.9, ConfBoundsSides.TwoSidedBoth, False, ErrorMsg)
   
   
  {{APIComment|'Confidence bounds calculations are now possible. For example,}}
  {{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.}}
  {{APIComment|'the following code calculates the 90% two-sided confidence bounds on the reliability at 100 hrs.}}
  {{APIPrefix|Dim}} ResultValue {{APIPrefix|As}} BoundsValues
  {{APIPrefix|Dim}} ResultValue {{APIPrefix|As}} BoundsValues
  ResultValue = AModel.Bounds_Reliability(100)
  ResultValue = AModel.Bounds_Reliability(100)

Latest revision as of 19:02, 9 June 2016

APIWiki.png


Member of: SynthesisAPI.cModel


Sets the confidence level to use in confidence bounds calculations for published models. Returns a Boolean value; when true, indicates that a confidence level has been set.

Syntax

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

Parameters

Level

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

Sides

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

UseConfidenceLevelInPercents

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

sError

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


Example

This example assumes that a published model with ID #47 exists in the repository.

VBA

 ... 

 'Get model ID #47 from project ID #1 in the repository. 
  Dim AModel As cModel
  MyRepository.Project.SetCurrentProject(1)  
  Set AModel = MyRepository.Model.GetModel(47)

 '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

 ... 

 'Get model ID #47 from project ID #1 in the repository. 
  Dim AModel As cModel
  MyRepository.Project.SetCurrentProject(1)  
  AModel = MyRepository.Model.GetModel(47)

 '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)