Calculating Equation

Below is the example of using the GetMs operation to calculate an equation. The request contains an instance of opened modeling container, equation calculation pattern, and parameters of operation execution. The response contains an instance of the model that contains an equation with calculation results.

To execute the example, the equation must be calculated with the ARIMA method.

The C# example uses the PrintStat, PrintCoef, PrintStatCoef, printARMA, printSeries, printCorrel, printArray auxiliary operations to display results.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetMs xmlns="http://www.prognoz.ru/PP.SOM.Som">
<tMs xmlns="">
  <id>FMCFHDKCILMBFOAEIPIHNADFKGINDLOELLPHABJCJOEOKJNL!M!S!CLICDCEKCILMBFOAENGEBOPHPJKKIMALEIIAELEOPFIDCCJFF</id>
  </tMs>
<tArg xmlns="">
<pattern>
  <obInst>false</obInst>
  <all>false</all>
<item>
  <key>89669</key>
<problem>
<metamodel>
  <calculationChain>Get</calculationChain>
<calcChainPattern>
<modelPattern>
<transform>
<formulas>
  <method />
  </formulas>
  <displayId>true</displayId>
<equationsFormula>
  <method />
  </equationsFormula>
  <kind>true</kind>
  </transform>
  </modelPattern>
<entryKeys>
  <l>4</l>
  </entryKeys>
  </calcChainPattern>
  </metamodel>
  </problem>
  </item>
  </pattern>
<execParams>
  <k>0</k>
<modelKeys>
  <l>4</l>
  </modelKeys>
  <scenarioKeys />
  <execMethod>true</execMethod>
  <execSummaryStatistics>true</execSummaryStatistics>
  <execCoefficients>true</execCoefficients>
  <execEvaluateSeries>true</execEvaluateSeries>
  <execARMACoefficients>true</execARMACoefficients>
  <execAutoCorrelation>true</execAutoCorrelation>
  <execInitDefault>true</execInitDefault>
  <execStatCoefficients>true</execStatCoefficients>
  <execGenerateName>true</execGenerateName>
  </execParams>
  </tArg>
  </GetMs>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetMsResult xmlns="http://www.prognoz.ru/PP.SOM.Som" xmlns:q1="http://www.prognoz.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>FMCFHDKCILMBFOAEIPIHNADFKGINDLOELLPHABJCJOEOKJNL!M!S!CLICDCEKCILMBFOAENGEBOPHPJKKIMALEIIAELEOPFIDCCJFF</id>
  </id>
<meta xmlns="">
<item>
  <k>89669</k>
  <id>MODEL_NEW</id>
  <n>MODEL_NEW</n>
  <vis>1</vis>
  <type>Problem</type>
<problemMd>
<metamodel>
  <k>89670</k>
<calculationChain>
<its>
<Item>
  <k>4</k>
  <id>OBJ4</id>
  <n>MyOutputVavable|A[t] = A0, (From parent)-(From parent)</n>
  <vis>1</vis>
  <type>Model</type>
  <excluded>0</excluded>
  <graphMeta />
<model>
<transform>
<formulas>
<its>
<it>
  <k>0</k>
  <kind>Arima</kind>
<method>
<arima>
  <maxIteration>500</maxIteration>
  <constantMode>AutoEstimate</constantMode>
  <constantValue>21.1</constantValue>
<missingData>
  <specifiedVector />
  <method>Casewise</method>
  <methodParameter>5</methodParameter>
  <specifiedValue>0</specifiedValue>
<specifiedTerm>
  <k>4294967295</k>
  </specifiedTerm>
  </missingData>
  <confidenceLevel>0.95</confidenceLevel>
<ARMA>
  <orderAR />
  <orderMA />
  <calcInitMode>Auto</calcInitMode>
  <initAR />
  <initMA />
  <initIntercept>NaN</initIntercept>
  <estimationMethod>LevenbergMarquardt</estimationMethod>
  <tolerance>0.0001</tolerance>
  <maxIteration>500</maxIteration>
<coefficientsAR>
  <estimate />
  <standardError />
  <tStatistic />
  <probability />
  </coefficientsAR>
<coefficientsMA>
  <estimate />
  <standardError />
  <tStatistic />
  <probability />
  </coefficientsMA>
  <diff>0</diff>
  <diffSeas>1</diffSeas>
  <orderARSeas />
  <orderMASeas />
  <initARSeas />
  <initMASeas />
  <periodSeas>0</periodSeas>
<coefficientsARSeas>
  <estimate />
  <standardError />
  <tStatistic />
  <probability />
  </coefficientsARSeas>
<coefficientsMASeas>
  <estimate />
  <standardError />
  <tStatistic />
  <probability />
  </coefficientsMASeas>
  <useARMAasInstrums>1</useARMAasInstrums>
  <useAnalyticDeriv>1</useAnalyticDeriv>
  <useBackCast>1</useBackCast>
  </ARMA>
<explained>
<slice>
  <k>0</k>
  <id>MyOutputVavable|A</id>
  <n>MyOutputVavable|A</n>
  <vis>1</vis>
  <variableKey>1</variableKey>
  <stubKey>89671</stubKey>
<selections>
<its>
<Item>
<id>
  <id>89683</id>
  </id>
  <variant>2</variant>
  </Item>
  </its>
  </selections>
  <aggregator>None</aggregator>
<parametrizedDimensions>
<its>
<Item>
  <dimension>0</dimension>
  <parameter>0</parameter>
  </Item>
  </its>
  </parametrizedDimensions>
<unitInfo>
  <unit>4294967295</unit>
  <measure>4294967295</measure>
  <baseUnit>4294967295</baseUnit>
  <unitsDimensionKey>0</unitsDimensionKey>
  </unitInfo>
  <level>Year</level>
  </slice>
  <lag />
  <key>0</key>
  <termToText>{MyOutputVavable|A[t]}</termToText>
  <termToInnerText>@_1:0[]</termToInnerText>
<termInfo>
  <k>4294967295</k>
  <lag>0</lag>
<inversion>
  <type>None</type>
  <lag>PrecidingValue</lag>
  <previousLag>-1</previousLag>
  <seasonality>None</seasonality>
  <dependence>Linear</dependence>
  <K>3</K>
  </inversion>
<slice>
  <k>0</k>
  <id>MyOutputVavable|A</id>
  <n>MyOutputVavable|A</n>
  <vis>1</vis>
  <variableKey>1</variableKey>
  <stubKey>89671</stubKey>
<selections>
<its>
<Item>
<id>
  <id>89683</id>
  </id>
  <variant>2</variant>
  </Item>
  </its>
  </selections>
  <aggregator>None</aggregator>
<parametrizedDimensions>
<its>
<Item>
  <dimension>0</dimension>
  <parameter>0</parameter>
  </Item>
  </its>
  </parametrizedDimensions>
<unitInfo>
  <unit>4294967295</unit>
  <measure>4294967295</measure>
  <baseUnit>4294967295</baseUnit>
  <unitsDimensionKey>0</unitsDimensionKey>
  </unitInfo>
  <level>Year</level>
  </slice>
  <date>1899-12-30</date>
  </termInfo>
<unitInfo>
  <unit>4294967295</unit>
  <measure>4294967295</measure>
  <baseUnit>4294967295</baseUnit>
  <unitsDimensionKey>0</unitsDimensionKey>
  </unitInfo>
  <included>0</included>
  </explained>
<autoCorrelation>
<acf>
  <d>0.8806007142476413</d>
  <d>0.7755396833857469</d>
  <d>0.6492537711209424</d>
  <d>0.5441074569585843</d>
  <d>0.4357976653696499</d>
  <d>0.3308992057992645</d>
  <d>0.230094344651138</d>
  <d>0.1340653483289803</d>
  <d>0.04349448323650126</d>
  <d>-0.04093598422258941</d>
  </acf>
<pacf>
  <d>0.8806007142476413</d>
  <d>0.0003654786750526034</d>
  <d>-0.1503469976514621</d>
  <d>0.009199850923512483</d>
  <d>-0.06627064694467796</d>
  <d>-0.07473420934025392</d>
  <d>-0.05207086459054212</d>
  <d>-0.06025413480285589</d>
  <d>-0.06127247771726842</d>
  <d>-0.05803709524513948</d>
  </pacf>
<qStatistics>
  <d>22.58132583422224</d>
  <d>40.82566711623952</d>
  <d>54.16802252411557</d>
  <d>63.96468294205459</d>
  <d>70.54856258696468</d>
  <d>74.53415453907314</d>
  <d>76.5627229925804</d>
  <d>77.2896519275377</d>
  <d>77.37066419885673</d>
  <d>77.44691104245111</d>
  </qStatistics>
<probability>
  <d>2.014330523714136e-06</d>
  <d>1.364014567961647e-09</d>
  <d>1.033195751176663e-11</d>
  <d>4.251043961289724e-13</d>
  <d>7.882583474838611e-14</d>
  <d>4.785061236134425e-14</d>
  <d>6.905587213168474e-14</d>
  <d>1.714184350021242e-13</d>
  <d>5.370148770111882e-13</d>
  <d>1.585953590677036e-12</d>
  </probability>
  <confidenceLevel>0.3779644730092272</confidenceLevel>
  </autoCorrelation>
<armaCoefficients>
  <orderAR />
  <orderMA />
<coefficientsAR>
  <estimate />
  <standardError />
  <tStatistic />
  <probability />
  </coefficientsAR>
<coefficientsMA>
  <estimate />
  <standardError />
  <tStatistic />
  <probability />
  </coefficientsMA>
  <orderARSeas />
  <orderMASeas />
<coefficientsARSeas>
  <estimate />
  <standardError />
  <tStatistic />
  <probability />
  </coefficientsARSeas>
<coefficientsMASeas>
  <estimate />
  <standardError />
  <tStatistic />
  <probability />
  </coefficientsMASeas>
  </armaCoefficients>
<statCoefficients>
<intercept>
  <mode>AutoEstimate</mode>
  <estimate>21.1</estimate>
  <standardError>2.402626767647315</standardError>
  <tStatistic>8.782054826044169</tStatistic>
  <probability>4.117620577837044e-09</probability>
  </intercept>
<coefficients>
  <estimate />
  <standardError />
  <tStatistic />
  <probability />
  </coefficients>
  </statCoefficients>
  </arima>
<summaryStatistics>
  <stR2>-2.220446049250313e-16</stR2>
  <stAdjR2>-2.220446049250313e-16</stAdjR2>
  <stR2_2>-2.220446049250313e-16</stR2_2>
  <stAdjR2_2>-2.220446049250313e-16</stAdjR2_2>
  <stSE>12.25104077211402</stSE>
  <stSSR>3752.200000000001</stSSR>
  <stLogL>-101.5284158459659</stLogL>
  <stDW>0.02452161398646127</stDW>
  <stDWLowerBound>5.059215779628777e-27</stDWLowerBound>
  <stDWUpperBound>5.059215779628777e-27</stDWUpperBound>
  <stSD>12.25104077211402</stSD>
  <stAIC>7.886801218920452</stAIC>
  <stSC>7.935189547305892</stSC>
  <stFstat_2>-INF</stFstat_2>
  <stProbFstat_2>NaN</stProbFstat_2>
  <stFstat>-INF</stFstat>
  <stProbFstat>NaN</stProbFstat>
  <stME>-5.465713352000771e-15</stME>
  <stMAE>10.4</stMAE>
  <stMSE>144.3153846153846</stMSE>
  <stMaxAE>20.1</stMaxAE>
  <stSqMSE>12.01313383823658</stSqMSE>
  <stVE>144.3153846153846</stVE>
  <stSEE>12.01313383823657</stSEE>
  <stMD>21.1</stMD>
  <stHQcriterion>7.900735306675025</stHQcriterion>
  <stAvgLogL>NaN</stAvgLogL>
  <stMcFaddenRsquared>NaN</stMcFaddenRsquared>
  <stRestrLogL>NaN</stRestrLogL>
  <stLRstatistic>NaN</stLRstatistic>
  <stLRprobability>NaN</stLRprobability>
  <stIncludedObservations>26</stIncludedObservations>
  <stJstat>NaN</stJstat>
  <stProbJstat>NaN</stProbJstat>
  <stNumOfIter>-1</stNumOfIter>
  <stJBStat>1.524528747984945</stJBStat>
  <stProbJBStat>0.4666086533649697</stProbJBStat>
  </summaryStatistics>
  <name>21.1000</name>
<evaluateSeries>
<its>
<Item>
  <scenarioKey>4294967295</scenarioKey>
<fact>
  <d>1</d>
  <d>4</d>
  <d>2</d>
  <d>7</d>
  <d>7.5</d>
  <d>9.1</d>
  <d>10.7</d>
  <d>12.3</d>
  <d>13.9</d>
  <d>15.5</d>
  <d>17.1</d>
  <d>18.7</d>
  <d>20.3</d>
  <d>21.9</d>
  <d>23.5</d>
  <d>25.1</d>
  <d>26.7</d>
  <d>28.3</d>
  <d>29.9</d>
  <d>31.5</d>
  <d>33.1</d>
  <d>34.7</d>
  <d>36.3</d>
  <d>37.9</d>
  <d>39.5</d>
  <d>41.1</d>
  <d>NaN</d>
  <d>NaN</d>
  <d>NaN</d>
  </fact>
<modelling>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>21.1</d>
  <d>NaN</d>
  <d>NaN</d>
  <d>NaN</d>
  </modelling>
<residuals>
  <d>-20.1</d>
  <d>-17.1</d>
  <d>-19.1</d>
  <d>-14.1</d>
  <d>-13.6</d>
  <d>-12.00000000000001</d>
  <d>-10.40000000000001</d>
  <d>-8.800000000000004</d>
  <d>-7.200000000000005</d>
  <d>-5.600000000000005</d>
  <d>-4.000000000000004</d>
  <d>-2.400000000000006</d>
  <d>-0.8000000000000043</d>
  <d>0.7999999999999936</d>
  <d>2.399999999999995</d>
  <d>3.999999999999996</d>
  <d>5.599999999999994</d>
  <d>7.199999999999996</d>
  <d>8.799999999999994</d>
  <d>10.4</d>
  <d>12</d>
  <d>13.6</d>
  <d>15.19999999999999</d>
  <d>16.79999999999999</d>
  <d>18.4</d>
  <d>20</d>
  <d>NaN</d>
  <d>NaN</d>
  <d>NaN</d>
  </residuals>
<input>
  <d>3</d>
  <d>7</d>
  <d>2</d>
  <d>6</d>
  <d>4</d>
  <d>1</d>
  <d>5</d>
  <d>3.42857143</d>
  <d>3.28571429</d>
  <d>3.14285714</d>
  <d>3</d>
  <d>2.85714286</d>
  <d>2.71428571</d>
  <d>2.57142857</d>
  <d>2.42857143</d>
  <d>2.28571429</d>
  <d>2.14285714</d>
  <d>2</d>
  <d>1.85714286</d>
  <d>1.71428571</d>
  <d>1.57142857</d>
  <d>1.42857143</d>
  <d>1.28571429</d>
  <d>1.14285714</d>
  <d>1</d>
  <d>0.85714286</d>
  <d>0.71428571</d>
  <d>0.57142857</d>
  <d>NaN</d>
  <d>NaN</d>
  <d>NaN</d>
  </input>
<factors>
  <its />
  </factors>
  </Item>
  </its>
<dates>
  <it>1990A1</it>
  <it>1991A1</it>
  <it>1992A1</it>
  <it>1993A1</it>
  <it>1994A1</it>
  <it>1995A1</it>
  <it>1996A1</it>
  <it>1997A1</it>
  <it>1998A1</it>
  <it>1999A1</it>
  <it>2000A1</it>
  <it>2001A1</it>
  <it>2002A1</it>
  <it>2003A1</it>
  <it>2004A1</it>
  <it>2005A1</it>
  <it>2006A1</it>
  <it>2007A1</it>
  <it>2008A1</it>
  <it>2009A1</it>
  <it>2010A1</it>
  <it>2011A1</it>
  <it>2012A1</it>
  <it>2013A1</it>
  <it>2014A1</it>
  <it>2015A1</it>
  <it>2016A1</it>
  <it>2017A1</it>
  <it>2018A1</it>
  <it>2019A1</it>
  <it>2020A1</it>
  </dates>
  </evaluateSeries>
<inversionInfo>
  <type>None</type>
  <lag>PrecidingValue</lag>
  <previousLag>-1</previousLag>
  <seasonality>None</seasonality>
  <dependence>Linear</dependence>
  <K>3</K>
  </inversionInfo>
  <doUseR>0</doUseR>
  <supportsR>1</supportsR>
  </method>
  <calendarLevel>Year</calendarLevel>
  <outputSliceKey>0</outputSliceKey>
  </it>
  </its>
  </formulas>
  <displayId>0</displayId>
  <kind>Simple</kind>
  </transform>
  <warnings />
  <readOnly>0</readOnly>
  </model>
  </Item>
  </its>
  </calculationChain>
<visualController>
  <userRPath />
  <isRExist>0</isRExist>
  </visualController>
<suppressEmptyFilter>
  <suppressEmpty>0</suppressEmpty>
  <suppressEmptyArea>SerieBounds</suppressEmptyArea>
  </suppressEmptyFilter>
  <readOnly>0</readOnly>
  <variableTestUseR>0</variableTestUseR>
  <calculateIdentOnFact>0</calculateIdentOnFact>
  </metamodel>
  <useScenarios>0</useScenarios>
  <readOnly>0</readOnly>
  </problemMd>
  </item>
  </meta>
  </GetMsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
 "GetMs" : 
  {
   "tMs" : 
    {
     "id" : "FMCFHDKCILMBFOAEIPIHNADFKGINDLOELLPHABJCJOEOKJNL!M!S!CLICDCEKCILMBFOAENGEBOPHPJKKIMALEIIAELEOPFIDCCJFF"
    },
   "tArg" : 
    {
     "pattern" : 
      {
       "obInst" : "false",
       "all" : "false",
       "item" : 
        {
         "key" : "89669",
         "problem" : 
          {
           "metamodel" : 
            {
             "calculationChain" : "Get",
             "calcChainPattern" : 
              {
               "modelPattern" : 
                {
                 "transform" : 
                  {
                   "formulas" : 
                    {
                     "method" : ""
                    },
                   "displayId" : "true",
                   "equationsFormula" : 
                    {
                     "method" : ""
                    },
                   "kind" : "true"
                  }
                },
               "entryKeys" : 
                {
                 "l" : "4"
                }
              }
            }
          }
        }
      },
     "execParams" : 
      {
       "k" : "0",
       "modelKeys" : 
        {
         "l" : "4"
        },
       "scenarioKeys" : "",
       "execMethod" : "true",
       "execSummaryStatistics" : "true",
       "execCoefficients" : "true",
       "execEvaluateSeries" : "true",
       "execARMACoefficients" : "true",
       "execAutoCorrelation" : "true",
       "execInitDefault" : "true",
       "execStatCoefficients" : "true",
       "execGenerateName" : "true"
      }
    }
  }
}

JSON response:

{
 "GetMsResult" : 
  {
   "id" : 
    {
     "id" : "FMCFHDKCILMBFOAEIPIHNADFKGINDLOELLPHABJCJOEOKJNL!M!S!CLICDCEKCILMBFOAENGEBOPHPJKKIMALEIIAELEOPFIDCCJFF"
    },
   "meta" : 
    {
     "item" : 
      {
       "k" : "89669",
       "id" : "MODEL_NEW",
       "n" : "MODEL_NEW",
       "vis" : "1",
       "type" : "Problem",
       "problemMd" : 
        {
         "metamodel" : 
          {
           "k" : "89670",
           "calculationChain" : 
            {
             "its" : 
              {
               "Item" : 
                {
                 "k" : "4",
                 "id" : "OBJ4",
                 "n" : "MyOutputVavable|A[t] = A0, (From parent)-(From parent)",
                 "vis" : "1",
                 "type" : "Model",
                 "excluded" : "0",
                 "graphMeta" : "",
                 "model" : 
                  {
                   "transform" : 
                    {
                     "formulas" : 
                      {
                       "its" : 
                        {
                         "it" : 
                          [
                            {
                             "k" : "0",
                             "kind" : "Arima",
                             "method" : 
                              {
                               "arima" : 
                                {
                                 "maxIteration" : "500",
                                 "constantMode" : "AutoEstimate",
                                 "constantValue" : "21.1",
                                 "missingData" : 
                                  {
                                   "specifiedVector" : "",
                                   "method" : "Casewise",
                                   "methodParameter" : "5",
                                   "specifiedValue" : "0",
                                   "specifiedTerm" : 
                                    {
                                     "k" : "4294967295"
                                    }
                                  },
                                 "confidenceLevel" : "0.95",
                                 "ARMA" : 
                                  {
                                   "orderAR" : "",
                                   "orderMA" : "",
                                   "calcInitMode" : "Auto",
                                   "initAR" : "",
                                   "initMA" : "",
                                   "initIntercept" : "NaN",
                                   "estimationMethod" : "LevenbergMarquardt",
                                   "tolerance" : "0.0001",
                                   "maxIteration" : "500",
                                   "coefficientsAR" : 
                                    {
                                     "estimate" : "",
                                     "standardError" : "",
                                     "tStatistic" : "",
                                     "probability" : ""
                                    },
                                   "coefficientsMA" : 
                                    {
                                     "estimate" : "",
                                     "standardError" : "",
                                     "tStatistic" : "",
                                     "probability" : ""
                                    },
                                   "diff" : "0",
                                   "diffSeas" : "1",
                                   "orderARSeas" : "",
                                   "orderMASeas" : "",
                                   "initARSeas" : "",
                                   "initMASeas" : "",
                                   "periodSeas" : "0",
                                   "coefficientsARSeas" : 
                                    {
                                     "estimate" : "",
                                     "standardError" : "",
                                     "tStatistic" : "",
                                     "probability" : ""
                                    },
                                   "coefficientsMASeas" : 
                                    {
                                     "estimate" : "",
                                     "standardError" : "",
                                     "tStatistic" : "",
                                     "probability" : ""
                                    },
                                   "useARMAasInstrums" : "1",
                                   "useAnalyticDeriv" : "1",
                                   "useBackCast" : "1"
                                  },
                                 "explained" : 
                                  {
                                   "slice" : 
                                    {
                                     "k" : "0",
                                     "id" : "MyOutputVavable|A",
                                     "n" : "MyOutputVavable|A",
                                     "vis" : "1",
                                     "variableKey" : "1",
                                     "stubKey" : "89671",
                                     "selections" : 
                                      {
                                       "its" : 
                                        {
                                         "Item" : 
                                          {
                                           "id" : 
                                            {
                                             "id" : "89683"
                                            },
                                           "variant" : "2"
                                          }
                                        }
                                      },
                                     "aggregator" : "None",
                                     "parametrizedDimensions" : 
                                      {
                                       "its" : 
                                        {
                                         "Item" : 
                                          {
                                           "dimension" : "0",
                                           "parameter" : "0"
                                          }
                                        }
                                      },
                                     "unitInfo" : 
                                      {
                                       "unit" : "4294967295",
                                       "measure" : "4294967295",
                                       "baseUnit" : "4294967295",
                                       "unitsDimensionKey" : "0"
                                      },
                                     "level" : "Year"
                                    },
                                   "lag" : "",
                                   "key" : "0",
                                   "termToText" : "{MyOutputVavable|A[t]}",
                                   "termToInnerText" : "@_1:0[]",
                                   "termInfo" : 
                                    {
                                     "k" : "4294967295",
                                     "lag" : "0",
                                     "inversion" : 
                                      {
                                       "type" : "None",
                                       "lag" : "PrecidingValue",
                                       "previousLag" : "-1",
                                       "seasonality" : "None",
                                       "dependence" : "Linear",
                                       "K" : "3"
                                      },
                                     "slice" : 
                                      {
                                       "k" : "0",
                                       "id" : "MyOutputVavable|A",
                                       "n" : "MyOutputVavable|A",
                                       "vis" : "1",
                                       "variableKey" : "1",
                                       "stubKey" : "89671",
                                       "selections" : 
                                        {
                                         "its" : 
                                          {
                                           "Item" : 
                                            {
                                             "id" : 
                                              {
                                               "id" : "89683"
                                              },
                                             "variant" : "2"
                                            }
                                          }
                                        },
                                       "aggregator" : "None",
                                       "parametrizedDimensions" : 
                                        {
                                         "its" : 
                                          {
                                           "Item" : 
                                            {
                                             "dimension" : "0",
                                             "parameter" : "0"
                                            }
                                          }
                                        },
                                       "unitInfo" : 
                                        {
                                         "unit" : "4294967295",
                                         "measure" : "4294967295",
                                         "baseUnit" : "4294967295",
                                         "unitsDimensionKey" : "0"
                                        },
                                       "level" : "Year"
                                      },
                                     "date" : "1899-12-30"
                                    },
                                   "unitInfo" : 
                                    {
                                     "unit" : "4294967295",
                                     "measure" : "4294967295",
                                     "baseUnit" : "4294967295",
                                     "unitsDimensionKey" : "0"
                                    },
                                   "included" : "0"
                                  },
                                 "autoCorrelation" : 
                                  {
                                   "acf" : 
                                    {
                                     "d" : 
                                      [
                                        "0.8806007142476413",
                                        "0.7755396833857469",
                                        "0.6492537711209424",
                                        "0.5441074569585843",
                                        "0.4357976653696499",
                                        "0.3308992057992645",
                                        "0.230094344651138",
                                        "0.1340653483289803",
                                        "0.04349448323650126",
                                        "-0.04093598422258941"
                                      ]
                                    },
                                   "pacf" : 
                                    {
                                     "d" : 
                                      [
                                        "0.8806007142476413",
                                        "0.0003654786750526034",
                                        "-0.1503469976514621",
                                        "0.009199850923512483",
                                        "-0.06627064694467796",
                                        "-0.07473420934025392",
                                        "-0.05207086459054212",
                                        "-0.06025413480285589",
                                        "-0.06127247771726842",
                                        "-0.05803709524513948"
                                      ]
                                    },
                                   "qStatistics" : 
                                    {
                                     "d" : 
                                      [
                                        "22.58132583422224",
                                        "40.82566711623952",
                                        "54.16802252411557",
                                        "63.96468294205459",
                                        "70.54856258696468",
                                        "74.53415453907314",
                                        "76.5627229925804",
                                        "77.2896519275377",
                                        "77.37066419885673",
                                        "77.44691104245111"
                                      ]
                                    },
                                   "probability" : 
                                    {
                                     "d" : 
                                      [
                                        "2.014330523714136e-06",
                                        "1.364014567961647e-09",
                                        "1.033195751176663e-11",
                                        "4.251043961289724e-13",
                                        "7.882583474838611e-14",
                                        "4.785061236134425e-14",
                                        "6.905587213168474e-14",
                                        "1.714184350021242e-13",
                                        "5.370148770111882e-13",
                                        "1.585953590677036e-12"
                                      ]
                                    },
                                   "confidenceLevel" : "0.3779644730092272"
                                  },
                                 "armaCoefficients" : 
                                  {
                                   "orderAR" : "",
                                   "orderMA" : "",
                                   "coefficientsAR" : 
                                    {
                                     "estimate" : "",
                                     "standardError" : "",
                                     "tStatistic" : "",
                                     "probability" : ""
                                    },
                                   "coefficientsMA" : 
                                    {
                                     "estimate" : "",
                                     "standardError" : "",
                                     "tStatistic" : "",
                                     "probability" : ""
                                    },
                                   "orderARSeas" : "",
                                   "orderMASeas" : "",
                                   "coefficientsARSeas" : 
                                    {
                                     "estimate" : "",
                                     "standardError" : "",
                                     "tStatistic" : "",
                                     "probability" : ""
                                    },
                                   "coefficientsMASeas" : 
                                    {
                                     "estimate" : "",
                                     "standardError" : "",
                                     "tStatistic" : "",
                                     "probability" : ""
                                    }
                                  },
                                 "statCoefficients" : 
                                  {
                                   "intercept" : 
                                    {
                                     "mode" : "AutoEstimate",
                                     "estimate" : "21.1",
                                     "standardError" : "2.402626767647315",
                                     "tStatistic" : "8.782054826044169",
                                     "probability" : "4.117620577837044e-09"
                                    },
                                   "coefficients" : 
                                    {
                                     "estimate" : "",
                                     "standardError" : "",
                                     "tStatistic" : "",
                                     "probability" : ""
                                    }
                                  }
                                },
                               "summaryStatistics" : 
                                {
                                 "stR2" : "-2.220446049250313e-16",
                                 "stAdjR2" : "-2.220446049250313e-16",
                                 "stR2_2" : "-2.220446049250313e-16",
                                 "stAdjR2_2" : "-2.220446049250313e-16",
                                 "stSE" : "12.25104077211402",
                                 "stSSR" : "3752.200000000001",
                                 "stLogL" : "-101.5284158459659",
                                 "stDW" : "0.02452161398646127",
                                 "stDWLowerBound" : "5.059215779628777e-27",
                                 "stDWUpperBound" : "5.059215779628777e-27",
                                 "stSD" : "12.25104077211402",
                                 "stAIC" : "7.886801218920452",
                                 "stSC" : "7.935189547305892",
                                 "stFstat_2" : "-INF",
                                 "stProbFstat_2" : "NaN",
                                 "stFstat" : "-INF",
                                 "stProbFstat" : "NaN",
                                 "stME" : "-5.465713352000771e-15",
                                 "stMAE" : "10.4",
                                 "stMSE" : "144.3153846153846",
                                 "stMaxAE" : "20.1",
                                 "stSqMSE" : "12.01313383823658",
                                 "stVE" : "144.3153846153846",
                                 "stSEE" : "12.01313383823657",
                                 "stMD" : "21.1",
                                 "stHQcriterion" : "7.900735306675025",
                                 "stAvgLogL" : "NaN",
                                 "stMcFaddenRsquared" : "NaN",
                                 "stRestrLogL" : "NaN",
                                 "stLRstatistic" : "NaN",
                                 "stLRprobability" : "NaN",
                                 "stIncludedObservations" : "26",
                                 "stJstat" : "NaN",
                                 "stProbJstat" : "NaN",
                                 "stNumOfIter" : "-1",
                                 "stJBStat" : "1.524528747984945",
                                 "stProbJBStat" : "0.4666086533649697"
                                },
                               "name" : "21.1000",
                               "evaluateSeries" : 
                                {
                                 "its" : 
                                  {
                                   "Item" : 
                                    {
                                     "scenarioKey" : "4294967295",
                                     "fact" : 
                                      {
                                       "d" : 
                                        [
                                          "1",
                                          "4",
                                          "2",
                                          "7",
                                          "7.5",
                                          "9.1",
                                          "10.7",
                                          "12.3",
                                          "13.9",
                                          "15.5",
                                          "17.1",
                                          "18.7",
                                          "20.3",
                                          "21.9",
                                          "23.5",
                                          "25.1",
                                          "26.7",
                                          "28.3",
                                          "29.9",
                                          "31.5",
                                          "33.1",
                                          "34.7",
                                          "36.3",
                                          "37.9",
                                          "39.5",
                                          "41.1",
                                          "NaN",
                                          "NaN",
                                          "NaN"
                                        ]
                                      },
                                     "modelling" : 
                                      {
                                       "d" : 
                                        [
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "21.1",
                                          "NaN",
                                          "NaN",
                                          "NaN"
                                        ]
                                      },
                                     "residuals" : 
                                      {
                                       "d" : 
                                        [
                                          "-20.1",
                                          "-17.1",
                                          "-19.1",
                                          "-14.1",
                                          "-13.6",
                                          "-12.00000000000001",
                                          "-10.40000000000001",
                                          "-8.800000000000004",
                                          "-7.200000000000005",
                                          "-5.600000000000005",
                                          "-4.000000000000004",
                                          "-2.400000000000006",
                                          "-0.8000000000000043",
                                          "0.7999999999999936",
                                          "2.399999999999995",
                                          "3.999999999999996",
                                          "5.599999999999994",
                                          "7.199999999999996",
                                          "8.799999999999994",
                                          "10.4",
                                          "12",
                                          "13.6",
                                          "15.19999999999999",
                                          "16.79999999999999",
                                          "18.4",
                                          "20",
                                          "NaN",
                                          "NaN",
                                          "NaN"
                                        ]
                                      },
                                     "input" : 
                                      {
                                       "d" : 
                                        [
                                          "3",
                                          "7",
                                          "2",
                                          "6",
                                          "4",
                                          "1",
                                          "5",
                                          "3.42857143",
                                          "3.28571429",
                                          "3.14285714",
                                          "3",
                                          "2.85714286",
                                          "2.71428571",
                                          "2.57142857",
                                          "2.42857143",
                                          "2.28571429",
                                          "2.14285714",
                                          "2",
                                          "1.85714286",
                                          "1.71428571",
                                          "1.57142857",
                                          "1.42857143",
                                          "1.28571429",
                                          "1.14285714",
                                          "1",
                                          "0.85714286",
                                          "0.71428571",
                                          "0.57142857",
                                          "NaN",
                                          "NaN",
                                          "NaN"
                                        ]
                                      },
                                     "factors" : 
                                      {
                                       "its" : ""
                                      }
                                    }
                                  },
                                 "dates" : 
                                  {
                                   "it" : 
                                    [
                                      "1990A1",
                                      "1991A1",
                                      "1992A1",
                                      "1993A1",
                                      "1994A1",
                                      "1995A1",
                                      "1996A1",
                                      "1997A1",
                                      "1998A1",
                                      "1999A1",
                                      "2000A1",
                                      "2001A1",
                                      "2002A1",
                                      "2003A1",
                                      "2004A1",
                                      "2005A1",
                                      "2006A1",
                                      "2007A1",
                                      "2008A1",
                                      "2009A1",
                                      "2010A1",
                                      "2011A1",
                                      "2012A1",
                                      "2013A1",
                                      "2014A1",
                                      "2015A1",
                                      "2016A1",
                                      "2017A1",
                                      "2018A1",
                                      "2019A1",
                                      "2020A1"
                                    ]
                                  }
                                },
                               "inversionInfo" : 
                                {
                                 "type" : "None",
                                 "lag" : "PrecidingValue",
                                 "previousLag" : "-1",
                                 "seasonality" : "None",
                                 "dependence" : "Linear",
                                 "K" : "3"
                                },
                               "doUseR" : "0",
                               "supportsR" : "1"
                              },
                             "calendarLevel" : "Year",
                             "outputSliceKey" : "0"
                            }
                          ]
                        }
                      },
                     "displayId" : "0",
                     "kind" : "Simple"
                    },
                   "warnings" : "",
                   "readOnly" : "0"
                  }
                }
              }
            },
           "visualController" : 
            {
             "userRPath" : "",
             "isRExist" : "0"
            },
           "suppressEmptyFilter" : 
            {
             "suppressEmpty" : "0",
             "suppressEmptyArea" : "SerieBounds"
            },
           "readOnly" : "0",
           "variableTestUseR" : "0",
           "calculateIdentOnFact" : "0"
          },
         "useScenarios" : "0",
         "readOnly" : "0"
        }
      }
    }
  }
}
public static MsCalculationChainEntry GetMsCalcEq(MsId ms, ulong modelKey, ulong eqKey)
{
    var getMsOp = new GetMs();
    // Set operation execution parameters
    getMsOp.tMs = ms;
    getMsOp.tArg = new GetMsArg()
    {  // Set data getting pattern
        pattern = new MsMdPattern()
        {
            obInst = false,
            all = false,
            item = new MsItemPattern()
            {  // Specify model key
                key = modelKey,
                problem = new MsProblemPattern()
                {
                    metamodel = new MsMetaModelPattern()
                    {
                        calculationChain = ListOperation.Get,
                        calcChainPattern = new MsCalculationChainPattern()
                        {
                            entryKeys = new long[] { (long)eqKey },
                            modelPattern = new MsModelPattern()
                            {
                                transform = new MsFormulaTransformPattern()
                                {
                                    kind = true,
                                    formulas = new TsFormulaPattern()
                                    {
                                        method = new TsMethodPattern() { }
                                    },
                                    displayId = true,
                                    equationsFormula = new TsFormulaPattern()
                                    {
                                        method = new TsMethodPattern() { }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }, // Set equation calculation parameters
        execParams = new MsMdExecParams()
        {
            k = 0,
            execMethod = true,           
            execEvaluateSeries = true,
            execGenerateName = true,
            execSummaryStatistics = true,
            execAutoCorrelation = true,
            execCoefficients = true,
            execStatCoefficients = true,
            execARMACoefficients = true,
            modelKeys = new long[] { (long)eqKey },
            scenarioKeys = new long[] { },
            execInitDefault = true,
            options = null
        }
    };
    // Create a proxy object for operation execution
    var somClient = new SomPortTypeClient();
    GetMsResult getMsResult = somClient.GetMs(getMsOp);
    MsCalculationChainEntry chainEntry = getMsResult.meta.item.problemMd.metamodel.calculationChain.its.GetValue(0) as MsCalculationChainEntry;
    // Display errors and warnings
    MsModel eq = chainEntry.model;
    if (eq.warnings != null) 
    {
        Console.WriteLine(&quot;-- Warnings --&quot;);
        Console.WriteLine(&quot;&quot;.PadRight(3) +printArray(eq.warnings));
    }
    if (eq.error == null) //Check if errors occurred on equation calculation
    {   // Equation is calculated without errors 
        // Get calculation results   
        TsFormula formula = eq.transform.formulas.its.GetValue(0) as TsFormula;
        TsArimaMethod arima = formula.method.arima;
        // Get summary statistics and display into console window
        StatSummaryStatistics stat = formula.method.summaryStatistics;
        PrintStat(stat);
        // Get coefficient values and display into console window
        StatModelCoefficients coef = arima.statCoefficients;
        PrintCoef(coef);
        // Get values of autoregression coefficients, moving average coefficients and display into console window
        SlARMA armaCoef = arima.armaCoefficients;
        printARMA(armaCoef);
        // Get autocorrelation analysis values
        MsAutoCorrelationResult corr = arima.autoCorrelation;
        printCorrel(corr);
        // Get calculated values and display into console window
        MsEvaluateSeriesResult seriesRes = formula.method.evaluateSeries;
        printSeries(seriesRes);
    }
    else // Errors occurred on equation calculation
    {
        Console.WriteLine(&quot;-- Errors --&quot;);
        Console.WriteLine(eq.error);
    }
    // Returns the model that contains equation
    return chainEntry;
}
//Procedure of displaying summary statistics values into console window
public static void PrintStat(StatSummaryStatistics stat) 
{
    Console.WriteLine(&quot;-- Summary statistics --&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Quality criteria -&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- determination coefficient: &quot; + stat.stR2);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- adjusted determination coefficient: &quot; + stat.stAdjR2);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- determination coefficient (uncentered): &quot; + stat.stR2_2);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- adjusted determination coefficient (uncentered): &quot; + stat.stAdjR2_2);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- Fisher statistics: &quot; + stat.stFstat);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- Fisher statistics probability: &quot; + stat.stProbFstat);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- log-likelihood function: &quot; + stat.stLogL);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- Akaike information criterion: &quot; + stat.stAIC);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- Schwarz information criterion: &quot; + stat.stSC);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- standard error: &quot; + stat.stSE);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- J-statistics: &quot; + stat.stJstat);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- J-statistics probability: &quot; + stat.stProbJstat);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- diagnostic criteria -&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- Durbin-Watson statistic: &quot; + stat.stDW);
    Console.WriteLine(&quot;&quot;.PadRight(9) + &quot;- lower limit probability: &quot; + stat.stDWLowerBound);
    Console.WriteLine(&quot;&quot;.PadRight(9) + &quot;- upper limit probability: &quot; + stat.stDWUpperBound);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- HQ-criterion: &quot; + stat.stHQcriterion);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- mean of log-likelihood function: &quot; + stat.stAvgLogL);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- McFadden determination coefficient: &quot; + stat.stMcFaddenRsquared);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- restricted log-likelihood function: &quot; + stat.stRestrLogL);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- LR statistics: &quot; + stat.stLRstatistic);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- p-value of probability for the LR-statistics: &quot; + stat.stLRprobability);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- residual analysis -&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- mean error: &quot; + stat.stME);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- mean absolute error: &quot; + stat.stMAE);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- mean squared error: &quot; + stat.stMSE);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- root mean squared error: &quot; + stat.stSqMSE);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- standard deviation of residuals: &quot; + stat.stSEE);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- Jarque-Bera statistics: &quot; + stat.stJBStat);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- sum of squared residuals: &quot; + stat.stSSR);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- maximum absolute error: &quot; + stat.stMaxAE);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Common -&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- number of observations: &quot; + stat.stIncludedObservations);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- number of iterations after which the method has converged: &quot; + stat.stNumOfIter);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- average of dependent variable: &quot; + stat.stMD);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- standard deviation of dependent variable: &quot; + stat.stSD);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- residual variable: &quot; + stat.stVE);
}
// Procedure of displaying coefficient values into console window
public static void PrintCoef(StatModelCoefficients coef) 
{
    Console.WriteLine(&quot;-- Coefficients --&quot;);
    StatIntercept constVal = coef.intercept;
    Console.WriteLine(&quot;&quot;.PadRight(3)+&quot;- Constant -&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6)+&quot; - calculation mode: &quot;+constVal.mode);
    Console.WriteLine(&quot;&quot;.PadRight(6)+&quot; - value: &quot;+constVal.estimate);
    Console.WriteLine(&quot;&quot;.PadRight(6)+&quot; - standard error: &quot;+constVal.standardError);
    Console.WriteLine(&quot;&quot;.PadRight(6)+&quot; - t-statistics: &quot;+constVal.tStatistic);
    Console.WriteLine(&quot;&quot;.PadRight(6)+&quot; - probablity: &quot;+constVal.probability);  
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Factor -&quot;);
    PrintStatCoef(6, coef.coefficients);
}
public static void PrintStatCoef(int pad, StatCoefficients statCoef) 
{
    Console.WriteLine(&quot;&quot;.PadRight(pad) + &quot; - value: &quot; + printArray(statCoef.estimate));
    Console.WriteLine(&quot;&quot;.PadRight(pad) + &quot; - standard error: &quot; + printArray(statCoef.standardError));
    Console.WriteLine(&quot;&quot;.PadRight(pad) + &quot; - t-statistics: &quot; + printArray(statCoef.tStatistic));
    Console.WriteLine(&quot;&quot;.PadRight(pad) + &quot; - probability: &quot; + printArray(statCoef.probability));
}
// Procedure of displaying ARMA coefficients into console window
public static void printARMA(SlARMA armaCoef) 
{
    Console.WriteLine(&quot;-- Autoregression and moving average cofficients --&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Autoregression coefficients -&quot;);
    PrintStatCoef(6, armaCoef.coefficientsAR);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Seasonal autoregression coefficients -&quot;);
    PrintStatCoef(6, armaCoef.coefficientsARSeas);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Moving average coefficients -&quot;);
    PrintStatCoef(6, armaCoef.coefficientsMA);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Seasonal moving average coefficients -&quot;);
    PrintStatCoef(6, armaCoef.coefficientsMASeas);
}
// Procedure of displaying calculated values
public static void printSeries(MsEvaluateSeriesResult seriesRes) 
{
    Console.WriteLine(&quot;-- Calculated values --&quot;);
    MsEvaluateSeriesResultForScenario res = seriesRes.its.GetValue(0) as MsEvaluateSeriesResultForScenario;
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Scenario data -&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + &quot;- key: &quot;+ res.scenarioKey);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Calculation dates -&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(seriesRes.dates));
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Source series -&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(res.fact));
    if (res.modelling != null)
    {
        Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Modeling series -&quot;);
        Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(res.modelling));
    }
    if (res.forecast != null)
    {
        Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Forecasting series -&quot;);
        Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(res.forecast));
    }
    if (res.residuals != null)
    {
        Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Residual series -&quot;);
        Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(res.residuals));
    }
    if (res.lowerConfidenceLevel != null)
    {
        Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Lower confidence limit -&quot;);
        Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(res.lowerConfidenceLevel));
    }
    if (res.upperConfidenceLevel != null)
    {
        Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Upper confidence limit -&quot;);
        Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(res.upperConfidenceLevel));
    }
    if (res.dLowerConfidenceLevel != null)
    {
        Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Lower dynamic confidence limit -&quot;);
        Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(res.dLowerConfidenceLevel));
    }
    if (res.dUpperConfidenceLevel != null)
    {
        Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Upper dynamic confidence limit -&quot;);
        Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(res.dUpperConfidenceLevel));
    }
    if (res.factsMatrix != null)
    {
        Console.WriteLine(&quot;&quot;.PadRight(3) + &quot;- Factor matrix -&quot;);
        Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(res.factsMatrix));
    }
}
// Procedure of displaying autocorrelation analysis results into console window
public static void printCorrel(MsAutoCorrelationResult corr) 
{
    Console.WriteLine(&quot;-- ACF and PACF --&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot; - confidence limits relevance: &quot; + corr.confidenceLevel);
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot; - Ljung-Box q-statistics -&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(corr.qStatistics));
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot; - q-statistics probability -&quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(corr.probability));
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot; - Autocorrelation function - &quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(corr.acf));
    Console.WriteLine(&quot;&quot;.PadRight(3) + &quot; - Partial autocorrelation function - &quot;);
    Console.WriteLine(&quot;&quot;.PadRight(6) + printArray(corr.pacf));
}
// Procedure of displaying array of values into console window
public static string printArray(Array arr) 
{
    if (arr != null)
    {
        int rank = arr.Rank;
        string s = &quot;&quot;;
        if (rank == 1)
        {
            for (int i = 0; i &lt;= (arr.Length - 1); i++)
            {
                s = s + arr.GetValue(i) + &quot;; &quot;;
            };
        }
        else
        {
            for (int i = 0; i &lt;= (arr.GetLength(0) - 1); i++)
            {
                for (int j = 0; j &lt;= (arr.GetLength(1) - 1); j++)
                {
                    s = s + arr.GetValue(i, j) + &quot;; &quot;;
                };
                s = s + &quot;\n\r&quot;;
            };
        };
        return s;
    }
    else { return &quot;No values&quot;; };
}

See also:

GetMs: Operation