Ejemplo n.º 1
0
        public SEGUninformativeModel(MeasureList measures, UninformativeModelParameters specificParams, McmcParameters mcmcParams = null)
            : base(measures, specificParams.LogNormalDstrn, /*new Range(specificParams.MuLower, specificParams.MuUpper, specificParams.InitMu),*/ mcmcParams)
        {
            this.MuLower = specificParams.MuLower;
            this.MuUpper = specificParams.MuUpper;
            this.SDRange = specificParams.SDRange;
            this.InitMu  = specificParams.InitMu;
            this.InitSD  = specificParams.InitSD;
            this.Result  = new ModelResult(this, "mu", "sd");
            bool testSD = double.IsNaN(this.InitSD) || (this.InitSD == 0);

            if (Tools.IsND(this.InitMu) || testSD)
            {
                InitialValues initVals = WebExpoFunctions3.DefaultInits(this.Data, this.OutcomeIsLogNormallyDistributed, Tools.Combine(this.MuLower, this.MuUpper), this.SDRange, includeCensoredData: false);
                if (Tools.IsND(this.InitMu))
                {
                    this.InitMu = initVals.Mu;
                }

                if (testSD)
                {
                    this.InitSD = initVals.SigmaWithin;
                }
            }

            if (this.ME.ThroughCV)
            {
                this.Result.Chains.Add("cv");
            }
        }// end constructor
Ejemplo n.º 2
0
        public static UninformativeModelParameters GetDefaults(bool logNormalDstrn)
        {
            UninformativeModelParameters p = new UninformativeModelParameters();

            p.LogNormalDstrn = logNormalDstrn;
            if (p.LogNormalDstrn)
            {
                p.MuLower = -20;
                p.MuUpper = 20;
                p.SDRange = Tools.Combine(.095, 2.3);
                p.InitMu  = -1.2039728043259361; // log(0.3);
                p.InitSD  = 0.91629073187415511; // log(2.5)
            }
            else
            {
                p.MuLower = 40;
                p.MuUpper = 125;
                p.SDRange = Tools.Combine(.1, 20);
                p.InitMu  = 85;
                p.InitSD  = 3;
            }

            return(p);
        }