{ Analytica Model Test_SipMath_3_1, encoding="UTF-8" } SoftwareVersion 7.2.2 { System Variables with non-default values: } SampleSize := 1000 TypeChecking := 1 Checking := 1 SaveOptions := 2 SaveValues := 0 {!-50299|DiagramColor Model: 0x00ffffff} {!-50299|DiagramColor Module: 0x00ffffff} {!-50299|DiagramColor LinkModule: 0x00ffffff} {!-50299|DiagramColor Library: 0x00ffffff} {!-50299|DiagramColor LinkLibrary: 0x00ffffff} {!-50299|DiagramColor Form: 0x00ffffff} NodeInfo FormNode: 1,0,0,,0,0,,,,0,,,0 {!-50299|NodeColor Text: 0x00f3f3f3} Model Test_SipMath_3_1 Title: Test SipMath 3.1 Author: Lonnie Chrisman, Ph.D.~ Lumina Decision Systems Date: Wed, Oct 21, 2026 7:42 AM DiagState: 2,0,1,1250,471,17,10 WindState: 2,110,416,720,350 FontStyle: Arial,15 FileInfo: 0,Model Test_SipMath_3_1,2,2,0,0,W:\Testmodels\Test SipMath 3.1.ana {!70104|Att_GUID: c7b87b6f-57bb-4663-b87b-77926948f9e3 bc8d4963-0d86-403f-82a1-7dccbf352a0f} Include 0,LinkLibrary SipMath_3_1,2,2,0,0,SipMath 3.1 library.ana NodeLocation SipMath_3_1: 136,160,2 NodeSize SipMath_3_1: 88,32 Module QA_Fixtures Title: QA Fixtures Description: Embedded canonical JSON examples and additional deterministic test fixtures. No network dependency when tests run. NodeLocation: 136,264,2 NodeSize: 88,32 NodeInfo: 1,,,,,,,0,,,,,,0 DiagState: 2,0,1,1264,476,17,10 Constant Canonical_Single_JSON Title: Canonical Single JSON Description: Canonical library 01 from Probability Management (2021-08-23), whitespace compacted. Original calibration values preserved. Source: https://www.probabilitymanagement.org/s/Lib_01_Single-Variable_2021_08_23.SIPmath Definition: '{"name":"Single Variable Library","objectType":"sipModel","libraryType":"SIPmath_3_0","dateCreated":"2021-08-17","provenance":"SLS","U01":{"rng":[{"name":"HDR101","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":1,"varId":1,"seed3":2,"seed4":2}}]},"sips":[{"name":"Unbounded","ref":{"source":"rng","name":"HDR101"},"function":"Metalog_1_0","metadata":{"Average":-0.508109215629409,"Trial1":0.108155020321771,"Trial2":0.422196005333154,"Trial3":-0.0278776878964113},"arguments":{"aCoefficients":[-0.44366710027334577,0.31428823046335125,-0.46025990428473268,0.52556291243339126,2.11565238380833565]}}]}' NodeLocation: 160,96,2 NodeSize: 120,24 NodeInfo: 1,,,,,,,0,,,,,,0 Constant Canonical_Copula_JSON Title: Canonical Copula JSON Description: Canonical library 02 extract: exact RNGs, coefficient vectors, matrix and Trial1/2/3 calibration metadata. Display density arrays omitted. Source: https://www.probabilitymanagement.org/s/Lib_02_Gauss_2021_08_23.SIPmath Definition: '{~ "name":"Gaussian Copula Development Time Library","objectType":"sipModel","libraryType":"SIPmath_3_0",~ "globalVariables":[{"name":"correlationMatrixValue","value":{"columns":["Accounts","Products","Orders","Fulfillment"],"rows":["Accounts","Products","Orders","Fulfillment"],"matrix":[{"row":"Accounts","col":"Accounts","value":1},{"row":"Accounts","col":"Products","value":0},{"row":"Accounts","col":"Orders","value":0},{"row":"Accounts","col":"Fulfillment","value":0},{"row":"Products","col":"Products","value":1},{"row":"Products","col":"Orders","value":0},{"row":"Products","col":"Fulfillment","value":0.75},{"row":"Orders","col":"Orders","value":1},{"row":"Orders","col":"Fulfillment","value":0},{"row":"Fulfillment","col":"Fulfillment","value":1}]}}],~ "U01":{"rng":[~ {"name":"HDR4","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":9039920,"varId":4,"seed3":0,"seed4":0}},~ {"name":"HDR5","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":9039920,"varId":5,"seed3":0,"seed4":0}},~ {"name":"HDR6","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":9039920,"varId":6,"seed3":0,"seed4":0}},~ {"name":"HDR7","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":9039920,"varId":7,"seed3":0,"seed4":0}},~ {"name":"HDR8","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":9039920,"varId":8,"seed3":0,"seed4":0}}],~ "copula":[{"name":"Gaussian","function":"GaussianCopula","arguments":{"correlationMatrix":{"type":"globalVariables","value":"correlationMatrixValue"},"rng":["HDR4","HDR5","HDR6","HDR7"]},"copulaLayer":["cl1","cl2","cl3","cl4"]}]},~ "sips":[~ {"name":"Accounts","ref":{"source":"copula","name":"Gaussian","copulaLayer":"cl1"},"function":"Metalog_1_0","arguments":{"aCoefficients":[9.872717622,1.678242357,2.54967822,3.535388319,-13.40905029]},"metadata":{"Trial1":5.91064824323855,"Trial2":3.99951401423695,"Trial3":3.61593085127843}},~ {"name":"Products","ref":{"source":"copula","name":"Gaussian","copulaLayer":"cl2"},"function":"Metalog_1_0","arguments":{"aCoefficients":[10.28359942,1.433048092,1.737463084,3.927285373,-13.45782811]},"metadata":{"Trial1":4.81850430027545,"Trial2":16.264999616127,"Trial3":9.21182344011462}},~ {"name":"Orders","ref":{"source":"copula","name":"Gaussian","copulaLayer":"cl3"},"function":"Metalog_1_0","arguments":{"aCoefficients":[8.526657058,4.390832871,7.645594813,-11.34424622,-27.90451926]},"metadata":{"Trial1":8.84993813887317,"Trial2":5.73877017205265,"Trial3":7.90854997496018}},~ {"name":"Fulfillment","ref":{"source":"copula","name":"Gaussian","copulaLayer":"cl4"},"function":"Metalog_1_0","arguments":{"aCoefficients":[8.93145879,3.863446641,6.494528709,-8.804090192,-25.50440804]},"metadata":{"Trial1":6.7522436646553,"Trial2":11.4933053690752,"Trial3":5.97047076730257}},~ {"name":"Marketing","ref":{"source":"rng","name":"HDR8"},"function":"Metalog_1_0","arguments":{"aCoefficients":[9.872717622,1.678242357,2.54967822,3.535388319,-13.40905029]},"metadata":{"Trial1":4.97377773402723,"Trial2":5.26303264347232,"Trial3":11.3668582781926}}~ ]~ }' NodeLocation: 464,96,2 NodeSize: 120,24 NodeInfo: 1,,,,,,,0,,,,,,0 Constant Canonical_Discrete_JSON Title: Canonical Discrete JSON Description: Canonical library 06, complete numerical table and calibration metadata, whitespace compacted. Source: https://www.probabilitymanagement.org/s/Lib_06_Poisson_2021_08_23.SIPmath Definition: '{"name":"Discrete Poisson Variable With Lookup Library","objectType":"sipModel","libraryType":"SIPmath_3_0","U01":{"rng":[{"name":"HDR9","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":9039920,"varId":9,"seed3":0,"seed4":0}}]},"sips":[{"name":"Poisson","ref":{"source":"rng","name":"HDR9"},"function":"Lookup_Table","metadata":{"Lambda":0.5,"Trial6":1,"Trial23":2,"Trial299":3},"arguments":{"value":[[0.606530660,0],[0.909795990,1],[0.985612322,2],[0.998248377,3],[0.999827884,4],[0.999985835,5],[0.999998998,6],[0.999999938,7],[0.999999997,8],[1,9]]}}]}' NodeLocation: 160,176,2 NodeSize: 120,24 NodeInfo: 1,,,,,,,0,,,,,,0 Constant Canonical_Parameters_JSON Title: Canonical Parameters JSON Description: Canonical library 09 numerical extract, including duplicate environment-specific StandardNormal entries. Source: https://www.probabilitymanagement.org/s/Lib_09_Input_Param_and_Environment_Specific_2021_09_07.SIPmath. Original first-three-trial expectations are in QA. Definition: '{"name":"Basic Library","objectType":"sipModel","libraryType":"SIPmath_3_0",~ "U01":{"rng":[~ {"name":"HDR1","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":9039920,"varId":1,"seed3":0,"seed4":0}},~ {"name":"HDR2","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":9039920,"varId":2,"seed3":{"type":"parameter","name":"User-entered Seed3"},"seed4":0}},~ {"name":"HDR3","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":9039920,"varId":3,"seed3":0,"seed4":0}}]},~ "sips":[~ {"name":"Variable1","ref":{"source":"rng","name":"HDR1"},"function":"Metalog_1_0","arguments":{"lowerBound":0,"upperBound":5,"aCoefficients":[-0.44366710027334577,0.31428823046335125,-0.4602599042847327,0.5255629124333913,2.1156523838083356]}},~ {"name":"Variable2_seed3_param","ref":{"source":"rng","name":"HDR2"},"function":"Metalog_1_0","arguments":{"aCoefficients":[10.28359942,1.433048092,1.737463084,3.927285373,-13.45782811]}},~ {"name":"StandardNormal","ref":{"source":"rng","name":"HDR3"},"function":"Metalog_1_0","arguments":{"aCoefficients":[-1.18721e-8,-108.7360185,0.000228037,437.4513354,-0.000910088,988.3027041,-3370.883493,-0.001941269,0.006475465,-2823.944368,7434.879183,0.004897097,-0.011367609,2456.743398,-3595.592826,-0.003114859]}},~ {"name":"StandardNormal","ref":{"source":"rng","name":"HDR3"},"environment":"ExcelFrontline","function":"PsiNormal","arguments":{"mean":0,"stdDev":1}},~ {"name":"StandardNormal","ref":{"source":"rng","name":"HDR3"},"environment":"ExcelPalisade","function":"RiskNormal","arguments":{"mean":0,"stdDev":1}}~ ]}' NodeLocation: 160,256,2 NodeSize: 120,24 NodeInfo: 1,,,,,,,0,,,,,,0 Constant Synthetic_Stored_JSON Title: Synthetic Stored JSON Description: Small synthetic fixture for inline arrays, external resources and stored copula layers. External resources are explicitly provided in QA, never fetched. Definition: '{"objectType":"sipModel","PM_Trials":3,~ "U01":{"rng":[{"name":"Counter","function":"Index","arguments":{"counter":"PM_Index"}}],~ "copula":[{"name":"Stored","function":"SIP_Array","arguments":{"type":"csv","url":"fixture:copula","value":["A","B"]},"copulaLayer":["A","B"]}]},~ "sips":[~ {"name":"Array","function":"SIP_Array","ref":{"source":"rng","name":"Counter"},"arguments":{"type":"array","value":[10,20,30]}},~ {"name":"External","function":"SIP_Array","arguments":{"type":"csv","url":"fixture:data","value":["X"]}},~ {"name":"CopulaA","function":"Metalog_2_0","ref":{"source":"copula","name":"Stored","copulaLayer":"A"},"arguments":{"aCoefficients":[0,1]}},~ {"name":"CopulaB","function":"Metalog_2_0","ref":{"source":"copula","name":"Stored","copulaLayer":"B"},"arguments":{"aCoefficients":[0,1]}}~ ]}' NodeLocation: 464,256,2 NodeSize: 120,24 NodeInfo: 1,,,,,,,0,,,,,,0 Constant Canonical_Bounds_JSON Title: Canonical Bounds JSON Description: Canonical library 08 extract, retaining all eight coefficient/bound/rounding definitions and all 24 first-three-trial expectations. Display/average metadata omitted. Source: https://www.probabilitymanagement.org/s/Lib_08_Rounded_Bounded_Single_HDR_2021_08_23.SIPmath Definition: '{"name":"Bounded Rounded Library","objectType":"sipModel","libraryType":"SIPmath_3_0",~ "U01":{"rng":[{"name":"HDR101","function":"HDR_2_0","arguments":{"counter":"PM_Index","entity":1,"varId":1,"seed3":2,"seed4":2}}]},~ "sips":[~ {"name":"Unbounded","ref":{"source":"rng","name":"HDR101"},"function":"Metalog_1_0","arguments":{"aCoefficients":[-0.44366710027334577,0.31428823046335125,-0.46025990428473268,0.52556291243339126,2.11565238380833565]},"metadata":{"Trial1":0.108155020321771,"Trial2":0.422196005333154,"Trial3":-0.0278776878964113}},~ {"name":"LowerBounded","ref":{"source":"rng","name":"HDR101"},"function":"Metalog_1_0","arguments":{"lowerBound":0,"aCoefficients":[-0.44366710027334577,0.31428823046335125,-0.46025990428473268,0.52556291243339126,2.11565238380833565]},"metadata":{"Trial1":1.11422045881313,"Trial2":1.52530746378309,"Trial3":0.972507308941779}},~ {"name":"UpperBounded","ref":{"source":"rng","name":"HDR101"},"function":"Metalog_1_0","arguments":{"upperBound":5,"aCoefficients":[-0.44366710027334577,0.31428823046335125,-0.46025990428473268,0.52556291243339126,2.11565238380833565]},"metadata":{"Trial1":4.10251154330337,"Trial2":4.34439447538021,"Trial3":3.97173009312584}},~ {"name":"Bounded","ref":{"source":"rng","name":"HDR101"},"function":"Metalog_1_0","arguments":{"lowerBound":0,"upperBound":5,"aCoefficients":[-0.44366710027334577,0.31428823046335125,-0.46025990428473268,0.52556291243339126,2.11565238380833565]},"metadata":{"Trial1":2.63506214351606,"Trial2":3.02004307526592,"Trial3":2.46515514678502}},~ {"name":"Unrounded","ref":{"source":"rng","name":"HDR101"},"function":"Metalog_1_0","arguments":{"aCoefficients":[-44.366710027334577,31.428823046335125,-46.025990428473271,52.556291243339125,211.565238380833563]},"metadata":{"Trial1":10.8155020321771,"Trial2":42.2196005333154,"Trial3":-2.78776878964113}},~ {"name":"RoundNearest","ref":{"source":"rng","name":"HDR101"},"function":"Metalog_1_0","rounding":"nearest","arguments":{"aCoefficients":[-44.366710027334577,31.428823046335125,-46.025990428473271,52.556291243339125,211.565238380833563]},"metadata":{"Trial1":11,"Trial2":42,"Trial3":-3}},~ {"name":"RoundUp","ref":{"source":"rng","name":"HDR101"},"function":"Metalog_1_0","rounding":"up","arguments":{"aCoefficients":[-44.366710027334577,31.428823046335125,-46.025990428473271,52.556291243339125,211.565238380833563]},"metadata":{"Trial1":11,"Trial2":43,"Trial3":-3}},~ {"name":"RoundDown","ref":{"source":"rng","name":"HDR101"},"function":"Metalog_1_0","rounding":"down","arguments":{"aCoefficients":[-44.366710027334577,31.428823046335125,-46.025990428473271,52.556291243339125,211.565238380833563]},"metadata":{"Trial1":10,"Trial2":42,"Trial3":-2}}~ ]}' NodeLocation: 464,176,2 NodeSize: 120,24 NodeInfo: 1,,,,,,,0,,,,,,0 Close QA_Fixtures Module SIP_QA Title: SIP QA Description: Deterministic regression tests, canonical calibration comparisons, numerical primitive tests, array-abstraction tests, and negative validation/security tests. Every residual should be within its tolerance. NodeLocation: 136,376,2 NodeSize: 88,32 NodeInfo: 1,,,,,,,0,,,,,,0 DiagState: 2,0,1,1264,476,17,10 Function QA_Basis_Residual(n : positive atom; version : positive atom) Title: QA Basis Residual Description: Independent direct basis-sum oracle for unbounded Metalog quantiles. Exercises every term count 2..16, including odd legacy lengths needing padding. Definition: LocalIndex K := 1..n;~ LocalIndex P := [0.01, 0.2, 0.5, 0.8, 0.99];~ Local a := 1 / @K^2;~ Local power := Floor((@K - 1) / 2);~ Local logTerm := If version = 1 Then~ @K = 2 or @K = 3 or (@K >= 6 and Mod(@K, 2) = 0)~ Else Mod(@K, 4) = 2 or Mod(@K, 4) = 3;~ Local expected := Sum(a * (P - 0.5)^power * (If logTerm Then Ln(P / (1 - P)) Else 1), K);~ Max(Abs(SIP_Metalog(P, a, K, version:version) - expected), P) NodeLocation: 128,176,2 NodeSize: 96,24 NodeInfo: 1,,,,,,,0,,,,,,0 Index QA_Case Title: QA Case Description: Regression case names. QA_Residual reports numerical errors; expected errors return zero when correctly rejected. Definition: [~ 'Canonical single calibration',~ 'Canonical Gaussian calibration',~ 'Canonical discrete calibration',~ 'Canonical parameter calibration',~ 'Canonical 16-term legacy calibration',~ 'Metalog 1.0 all term counts',~ 'Metalog 2.0 all term counts',~ 'Lower bound transform',~ 'Upper bound transform',~ 'Both bounds transform',~ 'Negative rounding conventions',~ 'JSON export round trip',~ 'HDR seed mapping',~ 'Explicit trial reproducibility',~ 'Run sample equals explicit trials',~ 'Mid is trial one',~ 'Caller scenario array abstraction',~ 'Copula identity matrix',~ 'Cholesky equals correlation path',~ 'Copula different index labels',~ 'Stored array positions',~ 'Lookup exact boundary',~ 'Preloaded external array',~ 'Stored copula layer',~ 'DIST native round trip',~ 'Nested array trial dimension',~ 'Environment-independent selection',~ 'Environment-specific selection',~ 'Calibration missing is not passed',~ 'Reject stored trial overflow',~ 'Reject fractional trial',~ 'Reject invalid lookup CDF',~ 'Reject asymmetric correlation',~ 'Reject missing parameter',~ 'Reject unknown function',~ 'Reject missing external resource',~ 'Reject duplicate name/environment',~ 'Reject invalid header',~ 'Reject invalid probability',~ 'Reject seed out of range'~ ] NodeLocation: 128,64,2 NodeSize: 88,24 NodeInfo: 1,,,,,,,0,,,,,,0 Variable QA_Residual Title: QA Residual Description: Numerical absolute residual for every QA_Case; zero is ideal. Unexpected errors become INF. Negative tests return zero only when an error is actually raised. All tests avoid network/file access and do not change global sample settings. Definition: Local single := SIP_Parse(Canonical_Single_JSON);~ Local gauss := SIP_Parse(Canonical_Copula_JSON);~ Local discrete := SIP_Parse(Canonical_Discrete_JSON);~ Local param := SIP_Parse(Canonical_Parameters_JSON);~ Local stored := SIP_Parse(Synthetic_Stored_JSON);~ Local params := ParseJSON('{"User-entered Seed3":1}');~ Local resources := ParseJSON('{"fixture:data":{"X":[4,5,6]},"fixture:copula":{"A":[0.2,0.5,0.8],"B":[0.8,0.5,0.2]}}');~ LocalIndex T := 1..3;~ LocalIndex Names := SIP_Names(gauss);~ LocalIndex K := 1..3;~ LocalIndex I := ['A','B'];~ LocalIndex J := ['X','Y'];~ LocalIndex Terms := 2..16;~ Local a := Array(K, [1, 0.5, 0.1]);~ Local p := Array(T, [0.2, 0.5, 0.8]);~ Local m := Array(I, J, [[1, 0.6], [0.6, 1]]);~ Local l := Decompose(m, I, J);~ Local u := SIP_Uniform(T, varId:@I);~ Local q := SIP_Metalog(p, a, K);~ Array(QA_Case, [~ { 01: published single-variable calibration }~ Try(Max(Abs(SIP_Evaluate(single, 'Unbounded', T)~ - Array(T, [0.108155020321771, 0.422196005333154, -0.0278776878964113])), T), catch:Inf),~ { 02: every Gaussian-copula SIP including independent Marketing }~ Try(Max(Max(SIP_Calibration(gauss, Names, T)->absoluteError, T), Names), catch:Inf),~ { 03: published discrete trials }~ Try((LocalIndex D := [6,23,299]; Max(Abs(SIP_Evaluate(discrete, 'Poisson', D) - Array(D,[1,2,3])), D)), catch:Inf),~ { 04: user-entered seed }~ Try(Max(Abs(SIP_Evaluate(param, 'Variable2_seed3_param', T, params)~ - Array(T,[11.091734,12.036073,7.760296])), T), catch:Inf),~ { 05: published 16-term legacy coefficients }~ Try(Max(Abs(SIP_Evaluate(param, 'StandardNormal', T)~ - Array(T,[-0.079230,-1.046566,0.081651])), T), catch:Inf),~ { 06,07: independent basis oracles for every length }~ Try(Max(QA_Basis_Residual(Terms,1),Terms), catch:Inf),~ Try(Max(QA_Basis_Residual(Terms,2),Terms), catch:Inf),~ { 08,09,10: all bounding transformations }~ Try(Max(Abs(SIP_Metalog(p,a,K,lowerBound:2) - (2+Exp(q))),T), catch:Inf),~ Try(Max(Abs(SIP_Metalog(p,a,K,upperBound:5) - (5-Exp(-q))),T), catch:Inf),~ Try(Max(Abs(SIP_Metalog(p,a,K,lowerBound:2,upperBound:5) - (2+3/(1+Exp(-q)))),T), catch:Inf),~ { 11: canonical Excel-style negative rounding }~ Try(Max(Abs(SIP_Round([-2.8,2.8], 'up') - [-3,3]))~ + Max(Abs(SIP_Round([-2.8,2.8], 'down') - [-2,2]))~ + Max(Abs(SIP_Round([-2.5,2.5], 'nearest') - [-3,3])), catch:Inf),~ { 12: JSON export/import preserves coefficients and seeds }~ Try(Max(Abs(SIP_Evaluate(SIP_Parse(SIP_Export_Metalog('X',a,K,entity:5,varId:9)), 'X',T)~ - SIP_Metalog(SIP_Uniform(T,entity:5,varId:9),a,K)),T), catch:Inf),~ { 13,14: exact seed mapping and repeatability }~ Try(Max(Abs(SIP_Uniform(T,entity:17,varId:23,seed3:4,seed4:8) - Hubbard_HDR(T,23,17,4,8)),T), catch:Inf),~ Try(Max(Abs(SIP_Evaluate(single,'Unbounded',T) - SIP_Evaluate(single,'Unbounded',T)),T), catch:Inf),~ { 15,16: Analytica evaluation modes }~ Try(Max(Abs(Sample(SIP_Sample(single,'Unbounded')) - SIP_Evaluate(single,'Unbounded',Run)),Run), catch:Inf),~ Try(Abs(Mid(SIP_Sample(single,'Unbounded')) - SIP_Evaluate(single,'Unbounded',1)), catch:Inf),~ { 17: scenario arrays preserve caller index identity }~ Try(Max(Max(Abs(SIP_Metalog(p,a+@I,K) - (q + Sum(@I * (p-0.5)^Floor((@K-1)/2)~ * (If Mod(@K,4)=2 or Mod(@K,4)=3 Then Ln(p/(1-p)) Else 1),K))),T),I), catch:Inf),~ { 18: identity copula }~ Try(Max(Max(Abs(SIP_Gaussian_Copula(u,If @I=@J Then 1 Else 0,I,J)-u),I),T), catch:Inf),~ { 19: Cholesky path equals correlation path }~ Try(Max(Max(Abs(SIP_Gaussian_Copula(u,m,I,J) - SIP_Gaussian_Copula(u,l,I,J,True)),I),T), catch:Inf),~ { 20: distinct row and column labels, reference first output }~ Try(Max(Abs(SIP_Gaussian_Copula(u,m,I,J)[@I=1] - u[@I=1]),T), catch:Inf),~ { 21,22: stored trials and lookup boundary }~ Try(Max(Abs(SIP_Evaluate(stored,'Array',T) - Array(T,[10,20,30])),T), catch:Inf),~ Try(Abs(SIP_Lookup(0.6,Array(I,[0.6,1]),Array(I,[10,20]),I)-10), catch:Inf),~ { 23,24: explicitly preloaded external data and stored copula }~ Try(Max(Abs(SIP_Evaluate(stored,'External',T,resources:resources)-Array(T,[4,5,6])),T), catch:Inf),~ Try(Max(Abs(SIP_Evaluate(stored,'CopulaA',T,resources:resources)-Ln(p/(1-p))),T), catch:Inf),~ { 25: native DIST codec }~ Try((Local enc:=SipEncode(T,T,type:'Double'); Max(Abs(SIP_Stored(_Struct(type:'DIST',value:enc),T)-T),T)), catch:Inf),~ { 26: last dimension is trials }~ Try((Local x:=SIP_Tensor_At(ParseJSON('{"v":[[1,2,3],[4,5,6]]}')->v,2);~ Max(Abs(x-Array(x.Dim1,[2,5])),x.Dim1)), catch:Inf),~ { 27,28: environment alternatives }~ Try(If SIP_Field(SIP_Select(param,'StandardNormal'),'function')='Metalog_1_0' Then 0 Else 1, catch:Inf),~ Try(Max(Abs(SIP_Evaluate(param,'StandardNormal',T,environment:'ExcelFrontline')-CumNormalInv(SIP_Rng(param,'HDR3',T))),T), catch:Inf),~ { 29: missing calibration is explicitly Null }~ Try(If IsNull(SIP_Calibration(stored,'Array',1)->passed) Then 0 Else 1, catch:Inf),~ { 30..40: must fail safely, without code execution or resource downloads }~ Try((SIP_Evaluate(stored,'Array',4); 1), catch:0),~ Try((SIP_Evaluate(single,'Unbounded',1.5); 1), catch:0),~ Try((SIP_Lookup(0.5,Array(I,[0.8,0.7]),I,I); 1), catch:0),~ Try((SIP_Gaussian_Copula(u,Array(I,J,[[1,0.2],[0.6,1]]),I,J); 1), catch:0),~ Try((SIP_Evaluate(param,'Variable2_seed3_param',1); 1), catch:0),~ Try((SIP_Evaluate(SIP_Parse('{"objectType":"sipModel","sips":[{"name":"Bad","function":"Execute_arbitrary_code"}]}'),'Bad',1); 1), catch:0),~ Try((SIP_Evaluate(stored,'External',1); 1), catch:0),~ Try((SIP_Parse('{"objectType":"sipModel","sips":[{"name":"X"},{"name":"X"}]}'); 1), catch:0),~ Try((SIP_Parse('{"objectType":"wrong","sips":[{"name":"X"}]}'); 1), catch:0),~ Try((SIP_Metalog(0,a,K); 1), catch:0),~ Try((SIP_Uniform(1,seed3:10000001); 1), catch:0)~ ]) NodeLocation: 384,176,2 NodeSize: 96,24 NodeInfo: 1,,,,,,,0,,,,,,0 Variable QA_Tolerance Title: QA Tolerance Description: Absolute error tolerance: rounded published parameter/16-term expectations use 1e-6; Gaussian published values 1e-7; other floating comparisons 1e-10. No statistical sampling acceptance tests. Definition: If @QA_Case = 4 or @QA_Case = 5 Then 1e-6~ Else If @QA_Case = 2 Then 1e-7~ Else 1e-10 NodeLocation: 384,256,2 NodeSize: 96,24 NodeInfo: 1,,,,,,,0,,,,,,0 Variable QA_Passed Title: QA Passed Description: One boolean per test. Null or nonfinite residual is a failure, not silently omitted from the overall result. Definition: If IsNull(QA_Residual) Then False~ Else QA_Residual <= QA_Tolerance NodeLocation: 640,216,2 NodeSize: 88,24 NodeInfo: 1,,,,,,,0,,,,,,0 Variable QA_Bounded_Calibration Title: QA Bounded Calibration Description: All 24 published trial values from canonical library 08, including upper-only bounds and negative up/down rounding. Returns per-SIP per-trial calibration structs. Definition: Local library := SIP_Parse(Canonical_Bounds_JSON);~ LocalIndex Name := SIP_Names(library);~ LocalIndex T := 1..3;~ SIP_Calibration(library, Name, T) NodeLocation: 128,336,2 NodeSize: 112,24 NodeInfo: 1,,,,,,,0,,,,,,0 Variable QA_Extended Title: QA Extended Description: Four additional integration-path residuals: JSON DIST dispatch, JSON Cholesky matrix dispatch, calibrationTrials metadata arrays, and multiDimSIP_Array dispatch. Every residual should be <=1e-10. Definition: LocalIndex Check := ['DIST JSON dispatch','Cholesky JSON dispatch','CalibrationTrials array','Multidimensional JSON dispatch'];~ LocalIndex T := 1..3;~ Array(Check, [~ Try((~ Local encoded := SipEncode(T,T,type:'Double');~ Local json := MakeJSON(_Struct(objectType:'sipModel',sips:[_Struct(name:'D',function:'DIST',arguments:_Struct(value:encoded))]),flags:1);~ Max(Abs(SIP_Evaluate(SIP_Parse(json),'D',T)-T),T)~ ), catch:Inf),~ Try((~ Local lib := SIP_Parse('{"objectType":"sipModel","U01":{"rng":[{"name":"R1","function":"HDR_2_0","arguments":{"varId":1}},{"name":"R2","function":"HDR_2_0","arguments":{"varId":2}}],"copula":[{"name":"G","function":"GaussianCopula","arguments":{"rng":["R1","R2"],"choleskyMatrix":{"rows":["a","b"],"columns":["a","b"],"matrix":[{"row":"a","col":"a","value":1},{"row":"b","col":"a","value":0.6},{"row":"b","col":"b","value":0.8}]}},"copulaLayer":["A","B"]}]},"sips":[{"name":"X","function":"Metalog_2_0","ref":{"source":"copula","name":"G","copulaLayer":"B"},"arguments":{"aCoefficients":[0,1]}}]}');~ Local z := 0.6*CumNormalInv(SIP_Uniform(T,varId:1)) + 0.8*CumNormalInv(SIP_Uniform(T,varId:2));~ Local p := CumNormal(z);~ Max(Abs(SIP_Evaluate(lib,'X',T)-Ln(p/(1-p))),T)~ ), catch:Inf),~ Try((~ Local lib := SIP_Parse('{"objectType":"sipModel","sips":[{"name":"A","function":"SIP_Array","arguments":{"value":[10,20,30]},"metadata":{"calibrationTrials":[10,20,30]}}]}');~ 1 - Min(SIP_Calibration(lib,'A',T)->passed,T)~ ), catch:Inf),~ Try((~ Local lib := SIP_Parse('{"objectType":"sipModel","sips":[{"name":"Tensor","function":"multiDimSIP_Array","arguments":{"value":[[1,2,3],[4,5,6]]}}]}');~ Local x := SIP_Evaluate(lib,'Tensor',2);~ Max(Abs(x - Array(x.Dim1,[2,5])),x.Dim1)~ ), catch:Inf)~ ]) NodeLocation: 384,336,2 NodeSize: 96,24 NodeInfo: 1,,,,,,,0,,,,,,0 Close SIP_QA Module Native_Array_Examples Title: Native Array Examples Description: Examples of vectorized coefficients, seeds and explicit caller-owned dimensions, independent of JSON container identity. NodeLocation: 624,376,2 NodeSize: 96,32 NodeInfo: 1,,,,,,,0,,,,,,0 DiagState: 2,0,1,1264,476,17,10 Index Product1 Title: Product Description: Shared model dimension used by coefficients and stream IDs. Definition: ['A', 'B', 'C'] NodeLocation: 128,64,2 NodeSize: 88,24 NodeInfo: 1,,,,,,,0,,,,,,0 Index Metalog_Term Title: Metalog Term Description: Coefficient dimension; consumed by SIP_Metalog. Definition: 1..3 NodeLocation: 384,64,2 NodeSize: 88,24 NodeInfo: 1,,,,,,,0,,,,,,0 Variable Product_Coefficients Title: Product Coefficients Description: Three Metalog 2.0 coefficient vectors, indexed by Product and Metalog_Term. Uses native Array; no JSON indexes leak into model. Definition: Array(Metalog_Term, [10 * @Product1, 1 + @Product1 / 2, 0]) NodeLocation: 128,200,2 NodeSize: 96,24 NodeInfo: 1,,,,,,,0,,,,,,0 Variable Product_Trials Title: Product Trials Description: Independent HDR streams across Product, sharing explicit Trial. Result dimensions are exactly Product and Trial. Definition: SIP_Metalog(~ SIP_Uniform(Trial, entity:9039920, varId:@Product1),~ Product_Coefficients, Metalog_Term~ ) NodeLocation: 384,152,2 NodeSize: 96,24 NodeInfo: 1,,,,,,,0,,,,,,0 Chance Product_Sample Title: Product Sample Description: Native Analytica uncertainty example. HDR_U gives uniform Mid=0.5; SIP_Metalog consumes coefficient dimension and retains Product and Run in Sample mode. Definition: SIP_Metalog(~ HDR_U(seed1:@Product1, seed2:9039920),~ Product_Coefficients, Metalog_Term~ ) NodeLocation: 384,248,2 NodeSize: 96,24 NodeInfo: 1,,,,,,,0,,,,,,0 Close Native_Array_Examples Variable Example_Library Title: Example Library Description: Parse once; downstream examples reuse this native JSON struct. All provenance/calibration metadata remains accessible. Definition: SIP_Parse(Canonical_Copula_JSON) NodeLocation: 376,216,2 NodeSize: 88,24 NodeInfo: 1,,,,,,,0,,,,,,0 ValueState: 2,452,458,416,303,,MIDM Index SIP_Name Title: SIP Name Description: Caller-owned output dimension; explicitly shared by all library outputs. Definition: SIP_Names(Example_Library) NodeLocation: 376,64,2 NodeSize: 80,24 NodeInfo: 1,,,,,,,0,,,,,,0 Index Trial Title: Trial Description: Explicit first ten SIPmath trials, independent of Analytica's sample settings. Definition: 1..10 NodeLocation: 624,64,2 NodeSize: 80,24 NodeInfo: 1,,,,,,,0,,,,,,0 Variable Example_Trials Title: Example Trials Description: Deterministic coherent [SIP_Name,Trial] sample table. SIP_Name and Trial are retained; internal coefficient and copula dimensions are consumed. Definition: SIP_Evaluate(Example_Library, SIP_Name, Trial) NodeLocation: 624,264,2 NodeSize: 88,24 NodeInfo: 1,,,,,,,0,,,,,,0 WindState: 2,98,82,720,350 ValueState: 2,36,42,1123,340,,MIDM Chance Example_Sample Title: Example Sample Description: Coherent SIP distributions for Analytica uncertainty calculations. Sample view uses Run; Mid view returns trial 1, not a mean or median. Definition: SIP_Sample(Example_Library, SIP_Name) NodeLocation: 624,168,2 NodeSize: 88,24 NodeInfo: 1,,,,,,,0,,,,,,0 ValueState: 2,388,394,660,239,,STAT ReformVal: [Undefined,Null,Undefined,Undefined,1] Att_ResultSliceState: [SIP_Name,5,Sys_LocalIndex('Step'),1] Att_XRole: -1 Att_ColorRole: Null Variable QA_All_Passed Title: QA All Passed Description: True only when every deterministic QA case passes. Open SIP QA for per-case residuals and tolerances. Definition: Sum(QA_Passed, QA_Case) = IndexLength(QA_Case)~ and Min(~ Min(QA_Bounded_Calibration->passed, QA_Bounded_Calibration.T),~ QA_Bounded_Calibration.Name~ )~ and Max(QA_Extended, QA_Extended.Check) <= 1e-10 NodeLocation: 376,376,2 NodeSize: 88,24 NodeInfo: 1,,,,,,,0,,,,,,0 ValueState: 2,404,410,416,303,,MIDM Text SIP_Example_Guide Title: SIP Example Guide Description: Start with Example Trials (deterministic) or Example Sample (uncertainty views).~ Native Array Examples demonstrates shared model indexes and coefficient arrays.~ SIP QA contains 44 regression checks plus 24 bounded/rounding calibration checks.~ QA All Passed must be True. Fixtures are embedded; tests do not need the internet.~ SIP Sample in Mid view returns trial 1, not a mean or median. NodeLocation: 376,520,1 NodeSize: 336,72 NodeInfo: 1,,,,,,,0,,,,,,0 {!50500|ArrowClass Ar477859243} {!50500|Att_HeadNode: SIP_QA} {!50500|Att_TailNode: SipMath_3_1} {!50500|Att_ArrowWayPoints: [Null,Null,-128,0,-128,1]} {!50500|Att_ArrowProperties: 0} {!50500|ArrowClass Ar1551601067} {!50500|Att_HeadNode: Native_Array_Examples} {!50500|Att_TailNode: SipMath_3_1} {!50500|Att_ArrowWayPoints: [Null,Null,121,-48,121,1]} {!50500|Att_ArrowProperties: 0} Close Test_SipMath_3_1