public override Tuple <string, ExposureMetricFunc>[] DefineContent(Dictionary <string, object> customVals) { Dictionary <string, double[]> lowWWCorrMeas = new Dictionary <string, double[]> { { "worker-01", new double[] { 185, 34.8, 16.7, 12.4, 18.6, 47.4, 52.6, 15.3, 27.6, 26.3 } }, { "worker-02", new double[] { 4.79, 23, 7.54, 62.3, 8.55, 9.28, 43.6, 94.2, 44.6, 66.6 } }, { "worker-03", new double[] { 8.85, 31.7, 15.8, 89.6, 164, 40.5, 47.6, 75.5, 10.7, 62.3 } }, { "worker-04", new double[] { 16.4, 6.91, 87.4, 20, 16.8, 7.12, 6.99, 16.4, 12.6, 63.9 } }, { "worker-05", new double[] { 14.7, 59.6, 15, 21.8, 20.6, 96.1, 16.8, 15.8, 8.02, 26.7 } }, { "worker-06", new double[] { 37.9, 96.9, 40.8, 106, 21.7, 25.8, 51.3, 23, 18.9, 20.2 } }, { "worker-07", new double[] { 22, 44.8, 37.5, 16.6, 30.7, 7.07, 7.18, 80.9, 44.5, 135 } }, { "worker-08", new double[] { 69.9, 30.5, 33.4, 53, 70.7, 78.3, 18, 45.2, 51.4, 33.7 } }, { "worker-09", new double[] { 28.1, 7.49, 16, 23, 99.9, 12, 11.8, 57.4, 8.79, 24 } }, { "worker-10", new double[] { 113, 7.68, 85.6, 196, 35, 17.6, 60.7, 15.5, 34.3, 12.1 } }, }; Dictionary <string, double[]> highWWCorrMeas = new Dictionary <string, double[]> { { "worker-01", new double[] { 66.8, 46, 61.1, 54.6, 31.7, 74.3, 60.9, 53.4, 38.9, 27.5 } }, { "worker-02", new double[] { 14.2, 53.9, 21.8, 47.8, 48.8, 76.5, 41.3, 20.4, 31.9, 31.1 } }, { "worker-03", new double[] { 186, 84.6, 94.4, 218, 189, 130, 107, 80.6, 288, 173 } }, { "worker-04", new double[] { 23.5, 16.2, 40.2, 130, 42.2, 25.7, 35.4, 40.8, 109, 40.9 } }, { "worker-05", new double[] { 43.8, 31.1, 13.1, 24.1, 27.7, 23.9, 40.2, 60.3, 29.8, 37.2 } }, { "worker-06", new double[] { 41, 11.4, 4.44, 12.9, 22.7, 20.5, 12.6, 8.35, 13.6, 28.1 } }, { "worker-07", new double[] { 6.56, 9.5, 6.97, 5.92, 2.42, 14, 12.3, 3.07, 7.01, 6.49 } }, { "worker-08", new double[] { 9.21, 9.42, 28.7, 72.9, 35.6, 17.2, 20.2, 13.4, 10.5, 26.3 } }, { "worker-09", new double[] { 19.6, 14.3, 22.8, 35.1, 28.9, 36.9, 13, 13.3, 13.6, 37 } }, { "worker-10", new double[] { 78.7, 28.2, 41.3, 14.4, 72.9, 10.2, 16.2, 15.8, 42.2, 61 } }, }; BWModelParameters bwParams = BWModelParameters.GetDefaults(true); ExposureMetricEstimates emeLowWWCorr = new ExposureMetricEstimates( new BetweenWorkerModel(measures: new MeasureList(workerMeasures: lowWWCorrMeas, oel: 150), specificParams: bwParams)); ExposureMetricEstimates emeHighWWCorr = new ExposureMetricEstimates( new BetweenWorkerModel(measures: new MeasureList(workerMeasures: highWWCorrMeas, oel: 150), specificParams: bwParams)); double lowWWCorrLowestGm, lowWWCorrHighestGm, highWWCorrLowestGm, highWWCorrHighestGm; string widLowWWCorrLeastExpo = emeLowWWCorr.FindExposedWorker(findMostExposed: false, gm: out lowWWCorrLowestGm); string widLowWWCorrMostExpo = emeLowWWCorr.FindExposedWorker(findMostExposed: true, gm: out lowWWCorrHighestGm); ExposureMetricEstimates emeLowLeast = emeLowWWCorr.GetWorkerEstimates(widLowWWCorrLeastExpo); ExposureMetricEstimates emeLowMost = emeLowWWCorr.GetWorkerEstimates(widLowWWCorrMostExpo); string widHighWWCorrLeastExpo = emeHighWWCorr.FindExposedWorker(findMostExposed: false, gm: out highWWCorrLowestGm); string widHighWWCorrMostExpo = emeHighWWCorr.FindExposedWorker(findMostExposed: true, gm: out highWWCorrHighestGm); ExposureMetricEstimates emeHighLeast = emeHighWWCorr.GetWorkerEstimates(widHighWWCorrLeastExpo); ExposureMetricEstimates emeHighMost = emeHighWWCorr.GetWorkerEstimates(widHighWWCorrMostExpo); this.Emes = new ExposureMetricEstimates[] { emeLowLeast, emeLowMost, emeHighLeast, emeHighMost }; return(new Tuple <string, ExposureMetricFunc>[] { Tuple.Create("GM", new ExposureMetricFunc(e => e.GeomMean())), Tuple.Create("GSD", new ExposureMetricFunc(e => e.GeomStanDev())), Tuple.Create("Exceedance fraction (%)", new ExposureMetricFunc(e => e.ExceedanceFrac())), Tuple.Create("95th percentile", new ExposureMetricFunc(e => e.P95())), Tuple.Create("Arithmetic mean", new ExposureMetricFunc(e => e.ArithMean())) }); }
private void ToggleModel(bool distLogNormal, bool useBWModel, string senderName = null) { ModelParams = SEGInformedVarModelParameters.GetDefaults(distLogNormal); BwModelParams = BWModelParameters.GetDefaults(distLogNormal); BWUModelParams = BWModelParameters_UniformPriorOnSDs.GetDefaults(distLogNormal); Entrs = Entrees.GetDefaults(distLogNormal, useBWModel); foreach (TextBox tb in FindVisualChildren <TextBox>(this)) { try { BindingProxy bp = tb.FindResource("boundsProxy") as BindingProxy; bp.Bounds.setState(distLogNormal); bp.MinValue = bp.Bounds.Minimum; bp.MaxValue = bp.Bounds.Maximum; } catch (ResourceReferenceKeyNotFoundException) { } } MECanvas.Visibility = (bool)UseModelGES.IsChecked ? Visibility.Visible : Visibility.Hidden; MERange = resetMeasErrRange(); SDRange = UninformativeModelParameters.GetDefaults(distLogNormal).SDRange; if (senderName.StartsWith("UseModel")) { if (useBWModel) { BWCanvas.Margin = DAPLabel.Margin; BWInitValsCanvas.Margin = InitValLabel.Margin; } foreach (Canvas canv in FindVisualChildren <Canvas>(this)) { if (canv.Name.StartsWith("BW")) { canv.Visibility = canv.Visibility == Visibility.Hidden ? Visibility.Visible : Visibility.Hidden; } } } OnPropertyChanged(); }
public override Tuple <string, ExposureMetricFunc>[] DefineContent(Dictionary <string, object> customVals) { Dictionary <string, double[]> realisticMeasures = new Dictionary <string, double[]> { { "worker-1", new double[] { 76.2, 82.3, 81.7, 73.7, 79.4, 79.1, 80.2, 71, 86.9, 75.6 } }, { "worker-2", new double[] { 70.6, 78.7, 77.6, 76.9, 79.5, 84.8, 77.6, 65.5, 74.1, 69.9 } }, { "worker-3", new double[] { 79.2, 77.7, 73.5, 78.9, 81.6, 83.1, 85.1, 84.2, 79.8, 84.1 } }, { "worker-4", new double[] { 79.1, 77.6, 81.2, 82.6, 81.6, 82.4, 76.9, 87.6, 80.4, 79.7 } }, { "worker-5", new double[] { 85.3, 92.2, 75.8, 84.1, 76.1, 84.6, 78.9, 75.8, 89, 87.1 } }, { "worker-6", new double[] { 77.8, 89, 81.9, 80.4, 88.5, 87, 85, 88.1, 81.3, 90.6 } }, { "worker-7", new double[] { 79.1, 80.7, 85.8, 84.8, 88.5, 82.6, 78.6, 90.1, 82.9, 83 } }, { "worker-8", new double[] { 80, 76.6, 84.6, 77.1, 81.5, 77.4, 73.5, 82.2, 74.4, 77.6 } }, { "worker-9", new double[] { 80, 81.2, 73.8, 80.7, 76.9, 77.5, 74.6, 70.6, 82.3, 66.4 } }, { "worker-10", new double[] { 89.1, 85.4, 81.8, 88.1, 86.4, 81.6, 86.8, 81.4, 86.7, 83.6 } } }; BWModelParameters modelParams = BWModelParameters.GetDefaults(logNormalDstrn: false); //this.OverwriteDefaults(modelParams, customVals); McmcParameters mcmcParams = new McmcParameters(); //this.OverwriteDefaults(mcmcParams, customVals); ExposureMetricEstimates eme = new ExposureMetricEstimates( new BetweenWorkerModel(measures: new MeasureList(workerMeasures: realisticMeasures, oel: 85), specificParams: modelParams, mcmcParams: mcmcParams)); this.Emes = new ExposureMetricEstimates[] { eme }; return(new Tuple <string, ExposureMetricFunc>[] { Tuple.Create("Arithmetic mean (90% CrI)", new ExposureMetricFunc(e => e.ArithMean())), Tuple.Create("Between-worker arithmetic standard deviation (90% CrI)", new ExposureMetricFunc(e => e.ArithStanDev())), Tuple.Create("Within-worker arithmetic standard deviation (90% CrI)", new ExposureMetricFunc(e => e.ArithStanDev(false))), Tuple.Create("Within-worker correlation (rho) (90% CrI)", new ExposureMetricFunc(e => e.Rho())), Tuple.Create("Probability that rho>0.2", new ExposureMetricFunc(e => e.RhoProbGt(0.2))), Tuple.Create("R.difference (90% CrI)", new ExposureMetricFunc(e => e.RDiff())), Tuple.Create("Probability of individual overexposure (95th percentile) in % (90% CrI)", new ExposureMetricFunc(e => e.IndivOverexpoP95())), Tuple.Create("Chances that the above probability is >20%", new ExposureMetricFunc(e => e.IndivOverexpoP95ProbGt(20))), Tuple.Create("Probability of individual overexposure (arithmetic mean) in % (90% CrI)", new ExposureMetricFunc(e => e.IndivOverexpoAm())), Tuple.Create("Chances that the above probability is >20%", new ExposureMetricFunc(e => e.IndivOverexpoAmProbGt(20))), }); }
public override Tuple <string, ExposureMetricFunc>[] DefineContent(Dictionary <string, object> customVals) { Dictionary <string, double[]> realisticMeasures = new Dictionary <string, double[]> { { "worker-01", new double[] { 31, 60.1, 133, 27.1 } }, { "worker-02", new double[] { 61.1, 5.27, 30.4, 31.7 } }, { "worker-03", new double[] { 20.5, 16.5, 15.5, 71.5 } } }; BWModelParameters modelParams = BWModelParameters.GetDefaults(logNormalDstrn: true); this.OverwriteDefaults(modelParams, customVals); McmcParameters mcmcParams = new McmcParameters(); this.OverwriteDefaults(mcmcParams, customVals); ExposureMetricEstimates eme = new ExposureMetricEstimates( new BetweenWorkerModel(measures: new MeasureList(workerMeasures: realisticMeasures, oel: 150), specificParams: modelParams, mcmcParams: mcmcParams)); this.Emes = new ExposureMetricEstimates[] { eme }; return(new Tuple <string, ExposureMetricFunc>[] { Tuple.Create("Group GM (90% CrI)", new ExposureMetricFunc(e => e.GeomMean())), Tuple.Create("Between-worker GSD (90% CrI)", new ExposureMetricFunc(e => e.GeomStanDev())), Tuple.Create("Within-worker GSD (90% CrI)", new ExposureMetricFunc(e => e.GeomStanDev(false))), Tuple.Create("Within-worker correlation (rho) (90% CrI)", new ExposureMetricFunc(e => e.Rho())), Tuple.Create("Probability that rho>0.2", new ExposureMetricFunc(e => e.RhoProbGt(0.2))), Tuple.Create("R.ratio (+90% CrI)", new ExposureMetricFunc(e => e.RRatio())), Tuple.Create("Probability that R>2", new ExposureMetricFunc(e => e.RRatioProbGt(2))), Tuple.Create("Probability that R>10", new ExposureMetricFunc(e => e.RRatioProbGt(10))), Tuple.Create("Probability of individual overexposure (95th percentile) in % (90% CrI)", new ExposureMetricFunc(e => e.IndivOverexpoP95())), Tuple.Create("Chances that the above probability is >20%", new ExposureMetricFunc(e => e.IndivOverexpoP95ProbGt(20))), Tuple.Create("Probability of individual overexposure (arithmetic mean) in % (90% CrI)", new ExposureMetricFunc(e => e.IndivOverexpoAm())), Tuple.Create("Chances that the above probability is >20%", new ExposureMetricFunc(e => e.IndivOverexpoAmProbGt(20))), }); }
public override Tuple <string, ExposureMetricFunc>[] DefineContent(Dictionary <string, object> customVals) { Dictionary <string, double[]> lowWWCorrMeas = new Dictionary <string, double[]> { { "worker-01", new double[] { 185, 34.8, 16.7, 12.4, 18.6, 47.4, 52.6, 15.3, 27.6, 26.3 } }, { "worker-02", new double[] { 4.79, 23, 7.54, 62.3, 8.55, 9.28, 43.6, 94.2, 44.6, 66.6 } }, { "worker-03", new double[] { 8.85, 31.7, 15.8, 89.6, 164, 40.5, 47.6, 75.5, 10.7, 62.3 } }, { "worker-04", new double[] { 16.4, 6.91, 87.4, 20, 16.8, 7.12, 6.99, 16.4, 12.6, 63.9 } }, { "worker-05", new double[] { 14.7, 59.6, 15, 21.8, 20.6, 96.1, 16.8, 15.8, 8.02, 26.7 } }, { "worker-06", new double[] { 37.9, 96.9, 40.8, 106, 21.7, 25.8, 51.3, 23, 18.9, 20.2 } }, { "worker-07", new double[] { 22, 44.8, 37.5, 16.6, 30.7, 7.07, 7.18, 80.9, 44.5, 135 } }, { "worker-08", new double[] { 69.9, 30.5, 33.4, 53, 70.7, 78.3, 18, 45.2, 51.4, 33.7 } }, { "worker-09", new double[] { 28.1, 7.49, 16, 23, 99.9, 12, 11.8, 57.4, 8.79, 24 } }, { "worker-10", new double[] { 113, 7.68, 85.6, 196, 35, 17.6, 60.7, 15.5, 34.3, 12.1 } }, }; Dictionary <string, double[]> highWWCorrMeas = new Dictionary <string, double[]> { { "worker-01", new double[] { 66.8, 46, 61.1, 54.6, 31.7, 74.3, 60.9, 53.4, 38.9, 27.5 } }, { "worker-02", new double[] { 14.2, 53.9, 21.8, 47.8, 48.8, 76.5, 41.3, 20.4, 31.9, 31.1 } }, { "worker-03", new double[] { 186, 84.6, 94.4, 218, 189, 130, 107, 80.6, 288, 173 } }, { "worker-04", new double[] { 23.5, 16.2, 40.2, 130, 42.2, 25.7, 35.4, 40.8, 109, 40.9 } }, { "worker-05", new double[] { 43.8, 31.1, 13.1, 24.1, 27.7, 23.9, 40.2, 60.3, 29.8, 37.2 } }, { "worker-06", new double[] { 41, 11.4, 4.44, 12.9, 22.7, 20.5, 12.6, 8.35, 13.6, 28.1 } }, { "worker-07", new double[] { 6.56, 9.5, 6.97, 5.92, 2.42, 14, 12.3, 3.07, 7.01, 6.49 } }, { "worker-08", new double[] { 9.21, 9.42, 28.7, 72.9, 35.6, 17.2, 20.2, 13.4, 10.5, 26.3 } }, { "worker-09", new double[] { 19.6, 14.3, 22.8, 35.1, 28.9, 36.9, 13, 13.3, 13.6, 37 } }, { "worker-10", new double[] { 78.7, 28.2, 41.3, 14.4, 72.9, 10.2, 16.2, 15.8, 42.2, 61 } }, }; BWModelParameters modelParams = BWModelParameters.GetDefaults(logNormalDstrn: true); this.OverwriteDefaults(modelParams, customVals); McmcParameters mcmcParams = new McmcParameters(); this.OverwriteDefaults(mcmcParams, customVals); BWModelParameters bwParams = BWModelParameters.GetDefaults(true); ExposureMetricEstimates emeLowWWCorr = new ExposureMetricEstimates( new BetweenWorkerModel(measures: new MeasureList(workerMeasures: lowWWCorrMeas, oel: 150), specificParams: modelParams, mcmcParams: mcmcParams)); ExposureMetricEstimates emeHighWWCorr = new ExposureMetricEstimates( new BetweenWorkerModel(measures: new MeasureList(workerMeasures: highWWCorrMeas, oel: 150), specificParams: modelParams, mcmcParams: mcmcParams)); this.Emes = new ExposureMetricEstimates[] { emeLowWWCorr, emeHighWWCorr }; return(new Tuple <string, ExposureMetricFunc>[] { Tuple.Create("Group GM (90% CrI)", new ExposureMetricFunc(e => e.GeomMean())), Tuple.Create("Between-worker GSD (90% CrI)", new ExposureMetricFunc(e => e.GeomStanDev())), Tuple.Create("Within-worker GSD (90% CrI)", new ExposureMetricFunc(e => e.GeomStanDev(false))), Tuple.Create("Within-worker correlation (rho) (90% CrI)", new ExposureMetricFunc(e => e.Rho())), Tuple.Create("Probability that rho>0.2", new ExposureMetricFunc(e => e.RhoProbGt(0.2))), Tuple.Create("R.ratio (+90% CrI)", new ExposureMetricFunc(e => e.RRatio())), Tuple.Create("Probability that R>2", new ExposureMetricFunc(e => e.RRatioProbGt(2))), Tuple.Create("Probability that R>10", new ExposureMetricFunc(e => e.RRatioProbGt(10))), Tuple.Create("Probability of individual overexposure (95th percentile) in % (90% CrI)", new ExposureMetricFunc(e => e.IndivOverexpoP95())), Tuple.Create("Chances that the above probability is >20%", new ExposureMetricFunc(e => e.IndivOverexpoP95ProbGt(20))), Tuple.Create("Probability of individual overexposure (arithmetic mean) in % (90% CrI)", new ExposureMetricFunc(e => e.IndivOverexpoAm())), Tuple.Create("Chances that the above probability is >20%", new ExposureMetricFunc(e => e.IndivOverexpoAmProbGt(20))), }); }