Difference between revisions of "CModel.Bounds Parameters"

From ReliaWiki
Jump to navigation Jump to search
m (Protected "CModel.Bounds Parameters" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) [cascading])
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:APIClass|CModel Class|CModel}}  
+
{{DISPLAYTITLE:cModel.Bounds Parameters}}{{Template:API}}{{Template:APIBreadcrumb|.[[CModel Class|cModel]]}}
Returns bounds on the parameters. Requires the Confidence level to be set. See [[CModel.SetConfindenceLevel|SetConfindenceLevel]].
+
 
 +
 
 +
<onlyinclude>Calculates the confidence bounds on the parameter estimates of an associated cModel object. Returns a '''[[ParamBoundsValues Class|ParamBoundsValues]]''' object that represents the confidence bounds on the parameter estimates.'''</onlyinclude>
 +
 
 +
 
 +
{{Template:API_BoundsNote}}
  
 
== Syntax==
 
== Syntax==
{{APIName|Bounds_Parameters}}
+
'''.Bounds_Parameters()'''
{{APIName|()}}
 
{{APIPrefix|As}}
 
{{APIName|List(}}
 
{{APIPrefix|Of}}
 
{{APIName|[[ParamBoundsValues Class|ParamBoundsValues]])}}<br>
 
{{APIComment|Returns an array containing bounds on all model parameters.}}
 
 
 
== Usage Example ==
 
{{APIComment|Declare a new repository connection class.}}
 
        Private WithEvents MyRepository As New Repository
 
  
{{APIComment|Connect to the Synthesis repository.}}
 
        Dim Success As Boolean = False
 
        Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
 
  
{{APIComment|Get the list of Projects in the connected repository.}}
+
== Example ==
        Dim ListOfModels() As [[NameIdPair Class|NameIdPair]]
+
This example assumes that a published model with ID #47 exists in the repository.  
        ListOfModels = MyRepository.GetAllModelsInfo()
 
  
{{APIComment|Select the ID of the model and retrieve it.}}
+
'''VBA'''
        Dim AModel as cModel
+
        AModel = MyRepository.GetModel(ListOfModels(0).ID)
+
{{APIComment|...}}
 +
 +
{{APIComment|'Get model ID #47 from project ID #1 in the repository.}}
 +
  {{APIPrefix|Dim}} AModel {{APIPrefix|As}} cModel
 +
  MyRepository.Project.SetCurrentProject(1) 
 +
  {{APIPrefix|Set}} AModel = MyRepository.Model.GetModel(47)
 +
 +
{{APIComment|'Set the confidence level to 90% two-sided bounds.}}
 +
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
 +
  {{APIPrefix|Call}} AModel.SetConfidenceLevel(0.9, ConfBoundsSides_TwoSidedBoth, False, ErrorMsg)
 +
 +
{{APIComment|'Calculate the bounds on the model's parameters.}}
 +
  {{APIPrefix|Dim}} ResultValue() {{APIPrefix|As}} ParamBoundsValues
 +
  ResultValue = AModel.Bounds_Parameters
 +
 +
{{APIComment|'Output sample: Display the bounds on the first parameter.}}
 +
  {{APIPrefix|Dim}} ParamName {{APIPrefix|As String}}
 +
  {{APIPrefix|Dim}} ParamUpperVal {{APIPrefix|As Double}}
 +
  {{APIPrefix|Dim}} ParamLowerVal {{APIPrefix|As Double}}
 +
  ParamName = ResultValue(0).ParamName
 +
  ParamUpperVal = ResultValue(0).Upper
 +
  ParamLowerVal = ResultValue(0).Lower
 +
  MsgBox (ParamName & {{APIString|": "}} & ParamUpperVal & {{APIString|" and "}} & ParamLowerVal)
  
{{APIComment|Get the Bounds parameters.}}
+
'''VB.NET'''
        Dim ModelBoundsParameters() as [[ParamBoundsValues Class|ParamBoundsValues]]
+
        ModelBoundsParameters = AModel.Bounds_Parameters
+
{{APIComment|...}}
 +
 +
{{APIComment|'Get model ID #47 from project ID #1 in the repository.}}
 +
  {{APIPrefix|Dim}} AModel {{APIPrefix|As}} cModel
 +
  MyRepository.Project.SetCurrentProject(1) 
 +
  {{APIPrefix|Set}} AModel = MyRepository.Model.GetModel(47)
 +
 
 +
{{APIComment|'Set the confidence level to 90% two-sided bounds.}}
 +
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
 +
  AModel.SetConfidenceLevel(0.9, ConfBoundsSides.TwoSidedBoth, False, ErrorMsg)
 +
 +
{{APIComment|'Calculate the bounds on the model's parameters.}}
 +
  {{APIPrefix|Dim}} ResultValue() {{APIPrefix|As}} ParamBoundsValues
 +
  ResultValue = AModel.Bounds_Parameters
 +
 +
{{APIComment|'Output sample: Display the bounds on the first parameter.}}
 +
  {{APIPrefix|Dim}} ParamName {{APIPrefix|As String}}
 +
  {{APIPrefix|Dim}} ParamUpperVal {{APIPrefix|As Double}}
 +
  {{APIPrefix|Dim}} ParamLowerVal {{APIPrefix|As Double}}
 +
  ParamName = ResultValue(0).ParamName
 +
  ParamUpperVal = ResultValue(0).Upper
 +
  ParamLowerVal = ResultValue(0).Lower
 +
  MsgBox (ParamName & {{APIString|": "}} & ParamUpperVal & {{APIString|" and "}} & ParamLowerVal)

Latest revision as of 19:02, 18 August 2016

APIWiki.png


Member of: SynthesisAPI.cModel


Calculates the confidence bounds on the parameter estimates of an associated cModel object. Returns a ParamBoundsValues object that represents the confidence bounds on the parameter estimates.


Remarks: 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)