metrumresearchgroup / bbi

Next generation modeling platform
https://metrumresearchgroup.github.io/bbi/docs
12 stars 2 forks source link

revisit setting stderr related elements to 0 and instead use -Inf if not exists #43

Open dpastoor opened 5 years ago

dpastoor commented 5 years ago

Summary

Currently, for values that do not exists, and empty array is created with zero values. To distinguish between an actual zero value and values that do not exist, set the a value to -INF if it does not exist.

Update: JSON can not marshal/unmarshal -INF, +INF, or NaN. To support this a new float64 type would have to be defined with a custom JSON marshaller, and all references of float64 would need to be change to the new type.

Tests

TestSummary TestSummaryTable

david-lyder commented 5 years ago

Before change (table and JSON):

bbi summary 10 LEM 10 mixture model and IOV on CL Dataset: ../MixSim.CSV Records: 13500 Observations: 12600 Patients: 300 Estimation Method(s):

bbi summary 10 --json

{ "run_details": { "version": "7.4.3", "run_start": "Thu Sep 12 13:09:51 EDT 2019", "run_end": "Thu Sep 12 13:10:08 EDT 2019", "estimation_time": 11.29, "covariance_time": 0.6, "function_evaluations": 367, "significant_digits": 3.1, "problem_text": "LEM 10 mixture model and IOV on CL", "estimation_method": [ "First Order" ], "data_set": "../MixSim.CSV", "number_of_patients": 300, "number_of_obs": 12600, "number_of_data_records": 13500, "output_files_used": [ "10.lst", "10.ext", "10.grd" ] }, "run_heuristics": { "has_final_zero_gradient": "HeuristicFalse", "minimization_successful": "HeuristicTrue" }, "parameters_data": [ { "method": "TABLE NO. 1: First Order: Goal Function=MINIMUM VALUE OF OBJECTIVE FUNCTION: Problem=1 Subproblem=0 Superproblem1=0 Iteration1=0 Superproblem2=0 Iteration2=0", "estimates": { "theta": [ 14.2204, 100.996, 0.824135, 0.988974, 1.70925 ], "omega": [ 0.0490352, 0, 0.0482149, 0, 0, 0.0359252, 0, 0, 0, 0.0359252, 0, 0, 0, 0, 0.0359252 ], "sigma": [ 0.0458045, 0 ] }, "std_err": { "theta": [ 0, 0, 0, 0, 0 ], "omega": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "sigma": [ 0, 0 ] }, "random_effect_sd": { "omega": [ 0.221439, 0, 0.219579, 0, 0, 0.189539, 0, 0, 0, 0.189539, 0, 0, 0, 0, 0.189539 ], "sigma": [ 0.21402, 0 ] }, "random_effect_sdse": {}, "fixed": { "theta": [ 0, 0, 0, 0, 0 ], "omega": [ 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], "sigma": [ 0, 1 ] } } ], "parameter_structures": { "Theta": 6, "Omega": [ 1, 0, 2, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0, 3 ], "Sigma": [ 1, 0, 1 ] }, "parameter_names": { "theta": [ "1. CL POP 1", "2. V", "3. WT ON CL", "4. WT ON V", "5. CL POP 2", "6. PROB POP 1" ] }, "ofv": { "ofv": 23157.251036757752, "ofv_no_constant": 17485.751, "ofv_with_constant": 40643.001566747465 }, "shrinkage_details": [ { "eta": { "sd": [ 0, 0, 0, 0, 0 ], "vr": [ 0, 0, 0, 0, 0 ] }, "ebv": { "sd": [ 0, 0, 0, 0, 0 ], "vr": [ 0, 0, 0, 0, 0 ] }, "eps": { "sd": [ 0, 0 ], "vr": [ 0, 0 ] } } ], "covariance_theta": [ { "Values": null, "Dim": 0 } ], "correlation_theta": [ { "Values": null, "Dim": 0 } ] }