CModel.Bounds Parameters: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
<onlyinclude>Calculates the confidence bounds on the parameter estimates. Returns a '''[[ParamBoundsValues Class|ParamBoundsValues]]''' object array that contains contains the values.'''</onlyinclude>
<onlyinclude>Calculates the confidence bounds on the parameter estimates. Returns a '''[[ParamBoundsValues Class|ParamBoundsValues]]''' object array that contains contains the values.'''</onlyinclude>


You must first use the [[CModel.SetConfidenceLevel|SetConfidenceLevel]] method to specify the confidence bound settings, and then use this method to perform the calculations.  
You must first use the [[CModel.SetConfidenceLevel|SetConfidenceLevel]] method to specify the confidence bound settings, and then use this method to perform the calculations. This method applies to published models only. Returns nothing if the calculation is performed on a non-published model.


== Syntax==
== Syntax==
Line 11: Line 11:


== 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.}}
  {{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|'Calculate the bounds on the model's parameters.}}
  {{APIComment|'Calculate the bounds on the model's parameters.}}
  {{APIPrefix|Dim}} ResultValue() {{APIPrefix|As}} ParamBoundsValues
  {{APIPrefix|Dim}} ResultValue() {{APIPrefix|As}} ParamBoundsValues
  ResultValue = AModel.Bounds_Parameters
  ResultValue = AModel.Bounds_Parameters
   
   
  {{APIComment|'Output sample: Display the bounds on the first parameter.}}
  {{APIComment|'Output sample: Display the bounds on the first parameter.}}
  {{APIPrefix|Dim}} ParamName {{APIPrefix|As String}}
  {{APIPrefix|Dim}} ParamName {{APIPrefix|As String}}
  {{APIPrefix|Dim}} ParamUpperVal {{APIPrefix|As Double}}
  {{APIPrefix|Dim}} ParamUpperVal {{APIPrefix|As Double}}
  {{APIPrefix|Dim}} ParamLowerVal {{APIPrefix|As Double}}
  {{APIPrefix|Dim}} ParamLowerVal {{APIPrefix|As Double}}
  ParamName = ResultValue(0).ParamName
  ParamName = ResultValue(0).ParamName
  ParamUpperVal = ResultValue(0).Upper
  ParamUpperVal = ResultValue(0).Upper
  ParamLowerVal = ResultValue(0).Lower
  ParamLowerVal = ResultValue(0).Lower
  MsgBox (ParamName & {{APIString|": "}} & ParamUpperVal & {{APIString|" and "}} & ParamLowerVal)
  MsgBox (ParamName & {{APIString|": "}} & ParamUpperVal & {{APIString|" and "}} & ParamLowerVal)


  '''VB.NET'''
  '''VB.NET'''
Line 40: Line 43:
  {{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.}}
  {{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|'Calculate the bounds on the model's parameters.}}
  {{APIComment|'Calculate the bounds on the model's parameters.}}
  {{APIPrefix|Dim}} ResultValue() {{APIPrefix|As}} ParamBoundsValues
  {{APIPrefix|Dim}} ResultValue() {{APIPrefix|As}} ParamBoundsValues
  ResultValue = AModel.Bounds_Parameters
  ResultValue = AModel.Bounds_Parameters
   
   
  {{APIComment|'Output sample: Display the bounds on the first parameter.}}
  {{APIComment|'Output sample: Display the bounds on the first parameter.}}
  {{APIPrefix|Dim}} ParamName {{APIPrefix|As String}}
  {{APIPrefix|Dim}} ParamName {{APIPrefix|As String}}
  {{APIPrefix|Dim}} ParamUpperVal {{APIPrefix|As Double}}
  {{APIPrefix|Dim}} ParamUpperVal {{APIPrefix|As Double}}
  {{APIPrefix|Dim}} ParamLowerVal {{APIPrefix|As Double}}
  {{APIPrefix|Dim}} ParamLowerVal {{APIPrefix|As Double}}
  ParamName = ResultValue(0).ParamName
  ParamName = ResultValue(0).ParamName
  ParamUpperVal = ResultValue(0).Upper
  ParamUpperVal = ResultValue(0).Upper
  ParamLowerVal = ResultValue(0).Lower
  ParamLowerVal = ResultValue(0).Lower
  MsgBox (ParamName & {{APIString|": "}} & ParamUpperVal & {{APIString|" and "}} & ParamLowerVal)
  MsgBox (ParamName & {{APIString|": "}} & ParamUpperVal & {{APIString|" and "}} & ParamLowerVal)

Revision as of 18:38, 5 November 2015

APIWiki.png


Member of: SynthesisAPI9.cModel


Calculates the confidence bounds on the parameter estimates. Returns a ParamBoundsValues object array that contains contains the values.

You must first use the SetConfidenceLevel method to specify the confidence bound settings, and then use this method to perform the calculations. This method applies to published models only. Returns nothing if the calculation is performed on a non-published model.

Syntax

.Bounds_Parameters()


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. 
  Dim ErrorMsg As String
  Call AModel.SetConfidenceLevel(0.9, ConfBoundsSides_TwoSidedBoth, False, ErrorMsg)

 'Calculate the bounds on the model's parameters. 
  Dim ResultValue() As ParamBoundsValues
  ResultValue = AModel.Bounds_Parameters

 'Output sample: Display the bounds on the first parameter. 
  Dim ParamName As String
  Dim ParamUpperVal As Double
  Dim ParamLowerVal As Double
  ParamName = ResultValue(0).ParamName
  ParamUpperVal = ResultValue(0).Upper
  ParamLowerVal = ResultValue(0).Lower
  MsgBox (ParamName & ": " & ParamUpperVal & " and " & ParamLowerVal)
VB.NET

 ... 

 '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. 
  Dim ErrorMsg As String
  AModel.SetConfidenceLevel(0.9, ConfBoundsSides.TwoSidedBoth, False, ErrorMsg)

 'Calculate the bounds on the model's parameters. 
  Dim ResultValue() As ParamBoundsValues
  ResultValue = AModel.Bounds_Parameters

 'Output sample: Display the bounds on the first parameter. 
  Dim ParamName As String
  Dim ParamUpperVal As Double
  Dim ParamLowerVal As Double
  ParamName = ResultValue(0).ParamName
  ParamUpperVal = ResultValue(0).Upper
  ParamLowerVal = ResultValue(0).Lower
  MsgBox (ParamName & ": " & ParamUpperVal & " and " & ParamLowerVal)