Ejemplo n.º 1
0
        //响应概率计算
        public double ResponseProbabilityCalculation(double fq, double favg, double fsigma)
        {
            double rpc = LiftingDistributionSelection.PValue(LiftingMethodStandardSelection.InverseProcessValue(fq), LiftingMethodStandardSelection.InverseProcessValue(favg), fsigma);

            pub_function.resolution_getReso(rpc, 0.000001, out rpc);
            return(rpc);
        }
Ejemplo n.º 2
0
        //
        public double[] VarianceFunctionResponsePointIntervalEstimated(double confidenceLevel, int textNumber, double fq, double favg, double fsigma, double fsigmaavg, double fsigmasigma)
        {
            double[] ie        = new double[8];
            double   Tfw       = updownMethod.get_t_shuangce(confidenceLevel, textNumber - 1);
            double   Tfw_dance = updownMethod.get_t_dance(confidenceLevel, textNumber - 1);

            if (fq != 0)
            {
                fq = LiftingDistributionSelection.PValue(LiftingMethodStandardSelection.InverseProcessValue(fq), LiftingMethodStandardSelection.InverseProcessValue(favg), fsigma);
                ie = GetDoubleArray(Tfw, Tfw_dance, fq, favg, fsigma, fsigmaavg, fsigmasigma);
            }
            return(ie);
        }
Ejemplo n.º 3
0
        //响应点区间估计
        public List <IntervalEstimation> ResponsePointIntervalEstimated(double responseProbability, double confidenceLevel, double[] xArray, int[] vArray, double fq, double favg, double fsigma)
        {
            List <IntervalEstimation> intervalEstimations = new List <IntervalEstimation>();

            if (fq != 0)
            {
                responseProbability = LiftingDistributionSelection.PValue(LiftingMethodStandardSelection.InverseProcessValue(fq), LiftingMethodStandardSelection.InverseProcessValue(favg), fsigma);
                pub_function.resolution_getReso(responseProbability, 0.000001, out responseProbability);
            }
            xArray = LiftingMethodStandardSelection.InverseProcessArray(xArray);
            var Single = SingleSideEstimation(xArray, vArray, responseProbability, confidenceLevel, LiftingMethodStandardSelection.InverseProcessValue(favg), fsigma);

            intervalEstimations.Add(GetIntervalEstimationValue(Single));
            var Double = DoubleSideEstimation(xArray, vArray, responseProbability, confidenceLevel, LiftingMethodStandardSelection.InverseProcessValue(favg), fsigma);

            intervalEstimations.Add(GetIntervalEstimationValue(Double));
            return(intervalEstimations);
        }
Ejemplo n.º 4
0
        //响应&&计算
        public Upanddown GetReturn(double[] xArray, int[] vArray, double x0, double d, out double z, double reso, out double z1)
        {
            Upanddown upanddown = new Upanddown();

            x0 = LiftingMethodStandardSelection.InverseProcessValue(x0);
            updownMethod.upanddown_getz(xArray.Length, xArray, vArray, x0, d, out z);
            LiftingDistributionSelection.GetUpanddown(xArray, vArray, x0, d, ref upanddown);
            upanddown.μ0_final = LiftingMethodStandardSelection.GetAvgValue(upanddown.μ0_final);
            pub_function.resolution_getReso(upanddown.G, 0.000001, out upanddown.G);
            pub_function.resolution_getReso(upanddown.H, 0.000001, out upanddown.H);
            pub_function.resolution_getReso(upanddown.A, 0.000001, out upanddown.A);
            pub_function.resolution_getReso(upanddown.B, 0.000001, out upanddown.B);
            pub_function.resolution_getReso(upanddown.M, 0.000001, out upanddown.M);
            pub_function.resolution_getReso(upanddown.b, 0.000001, out upanddown.b);
            pub_function.resolution_getReso(SysParam.p, 0.000001, out upanddown.p);
            GetZ1(z, reso, out z1);
            return(upanddown);
        }
Ejemplo n.º 5
0
        public static LiftingAlgorithm SelectState(UpDownExperiment updateException)
        {
            LiftingDistributionSelection   lds = null;
            LiftingMethodStandardSelection lms = null;

            if (updateException.udt_Distribution == 0)
            {
                lds = new TraditionalMethod();
            }
            else if (updateException.udt_Distribution == 1)
            {
                lds = new AmendmentMethod();
            }
            else if (updateException.udt_Distribution == 2)
            {
                lds = new CombinationMethod();
            }
            else if (updateException.udt_Distribution == 3)
            {
                lds = new LiftingLogistic();
            }

            if (updateException.udt_Standardstate == 0)
            {
                lms = new LiftingStandard();
            }
            else if (updateException.udt_Standardstate == 1)
            {
                lms = new LiftingLn();
            }
            else if (updateException.udt_Standardstate == 2)
            {
                lms = new LiftingLog();
            }
            else if (updateException.udt_Standardstate == 3)
            {
                lms = new LiftingPow(updateException.udt_Power);
            }

            return(new LiftingAlgorithm(lms, lds));
        }
Ejemplo n.º 6
0
        private SideReturnData GetSideReturnDataValue(double Y_Ceiling, double Y_LowerLimit, int Y_PartitionNumber)
        {
            SideReturnData sideReturnData = new SideReturnData();
            double         Y_ScaleLength  = (LiftingDistributionSelection.QValue(Y_Ceiling) - LiftingDistributionSelection.QValue(Y_LowerLimit)) / Y_PartitionNumber;

            sideReturnData.responseProbability = new double[Y_PartitionNumber + 1];
            for (int i = 0; i <= Y_PartitionNumber; i++)
            {
                if (i == 0)
                {
                    sideReturnData.responseProbability[i] = Y_LowerLimit;
                }
                else
                {
                    sideReturnData.responseProbability[i] = LiftingDistributionSelection.PValue(LiftingDistributionSelection.QValue(Y_LowerLimit) + i * Y_ScaleLength, 0, 1);
                }
            }
            sideReturnData.Y_Ceilings     = new double[sideReturnData.responseProbability.Length];
            sideReturnData.Y_LowerLimits  = new double[sideReturnData.responseProbability.Length];
            sideReturnData.responsePoints = new double[sideReturnData.responseProbability.Length];
            return(sideReturnData);
        }
Ejemplo n.º 7
0
        //方差函数法区间计算
        public SideReturnData VarianceFunctionMethod(double Y_Ceiling, double Y_LowerLimit, int Y_PartitionNumber, double ConfidenceLevel, double favg, double fsigma, int intervalChoose, int textNumber, double fsigmaavg, double fsigmasigma)
        {
            var sideReturnData = GetSideReturnDataValue(Y_Ceiling, Y_LowerLimit, Y_PartitionNumber);

            for (int i = 0; i < sideReturnData.responseProbability.Length; i++)
            {
                double[] vfrpie = VarianceFunctionResponseProbabilityIntervalEstimated(sideReturnData.responseProbability[i], ConfidenceLevel, textNumber, favg, fsigma, fsigmaavg, fsigmasigma);
                sideReturnData.responsePoints[i] = LiftingDistributionSelection.IsNormal() && LiftingMethodStandardSelection.IsStandard() ? (favg + pub_function.qnorm(Y_LowerLimit) * fsigma) : 0;

                if (intervalChoose == 1)
                {
                    sideReturnData.Y_Ceilings[i]    = vfrpie[0];
                    sideReturnData.Y_LowerLimits[i] = vfrpie[1];
                }
                else
                {
                    sideReturnData.Y_Ceilings[i]    = vfrpie[2];
                    sideReturnData.Y_LowerLimits[i] = vfrpie[3];
                }
            }
            return(sideReturnData);
        }
Ejemplo n.º 8
0
 public LiftingAlgorithm(LiftingMethodStandardSelection liftingMethodStandardSelection, LiftingDistributionSelection liftingDistributionSelection)
 {
     LiftingMethodStandardSelection = liftingMethodStandardSelection;
     LiftingDistributionSelection   = liftingDistributionSelection;
 }
Ejemplo n.º 9
0
 public double ResponsePointCalculate(double fq, double favg, double fsigma) => LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(favg) + (LiftingDistributionSelection.QValue(fq) * fsigma));
Ejemplo n.º 10
0
 public string DistributionNameAndMethodStandardName()
 {
     return(LiftingDistributionSelection.Distribution() + LiftingMethodStandardSelection.MethodStandard());
 }
Ejemplo n.º 11
0
        //计算多组试验结果
        public MultigroupTest MultigroupTestResult(int[] nj, double[] Gj, double[] Hj, double[] muj, double[] sigmaj)
        {
            int    nfinal         = 0;
            var    multigroupTest = get_multiGroup_result(nj, muj, sigmaj, Gj, Hj, out nfinal);
            double f001           = Math.Sqrt(Math.Pow(multigroupTest.Sigma_mu, 2) + Math.Pow(multigroupTest.Sigma_sigma, 2) * Math.Pow(LiftingDistributionSelection.QValue(0.001), 2));

            pub_function.resolution_getReso(f001, 0.000001, out multigroupTest.prec01);
            double f999 = Math.Sqrt(Math.Pow(multigroupTest.Sigma_mu, 2) + Math.Pow(multigroupTest.Sigma_sigma, 2) * Math.Pow(LiftingDistributionSelection.QValue(0.999), 2));

            pub_function.resolution_getReso(f999, 0.000001, out multigroupTest.prec999);
            double p001 = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(multigroupTest.μ0_final) - LiftingDistributionSelection.DistributionProcess() * multigroupTest.σ0_final);

            pub_function.resolution_getReso(p001, 0.000001, out multigroupTest.rpse01);
            double p999 = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(multigroupTest.μ0_final) + LiftingDistributionSelection.DistributionProcess() * multigroupTest.σ0_final);

            pub_function.resolution_getReso(p999, 0.000001, out multigroupTest.rpse999);
            return(multigroupTest);
        }
Ejemplo n.º 12
0
 public double[] ResponsePointStandardError(double Sigma_mu, double Sigma_sigma)
 {
     double[] rpse = new double[2];
     rpse[0] = pub_function.resolution_getReso(Math.Sqrt(Math.Pow(Sigma_mu, 2) + Math.Pow(Sigma_sigma, 2) * Math.Pow(LiftingDistributionSelection.QValue(0.001), 2)), 0.000001);
     rpse[1] = pub_function.resolution_getReso(Math.Sqrt(Math.Pow(Sigma_mu, 2) + Math.Pow(Sigma_sigma, 2) * Math.Pow(LiftingDistributionSelection.QValue(0.999), 2)), 0.000001);
     return(rpse);
 }
Ejemplo n.º 13
0
 private double[] GetDoubleArray(double Tfw, double Tfw_dance, double fq, double favg, double fsigma, double fsigmaavg, double fsigmasigma)
 {
     double[] ie = new double[8];
     ie[0] = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(favg) + LiftingDistributionSelection.QValue(fq) * fsigma + Tfw * Math.Sqrt(Math.Pow(fsigmaavg, 2) + Math.Pow(fsigmasigma, 2) * Math.Pow(LiftingDistributionSelection.QValue(fq), 2)));
     ie[1] = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(favg) + LiftingDistributionSelection.QValue(fq) * fsigma - Tfw * Math.Sqrt(Math.Pow(fsigmaavg, 2) + Math.Pow(fsigmasigma, 2) * Math.Pow(LiftingDistributionSelection.QValue(fq), 2)));
     ie[2] = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(favg) + LiftingDistributionSelection.QValue(fq) * fsigma + Tfw_dance * Math.Sqrt(Math.Pow(fsigmaavg, 2) + Math.Pow(fsigmasigma, 2) * Math.Pow(LiftingDistributionSelection.QValue(fq), 2)));
     ie[3] = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(favg) + LiftingDistributionSelection.QValue(fq) * fsigma - Tfw_dance * Math.Sqrt(Math.Pow(fsigmaavg, 2) + Math.Pow(fsigmasigma, 2) * Math.Pow(LiftingDistributionSelection.QValue(fq), 2)));
     ie[4] = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(favg) + Tfw * fsigmaavg);
     ie[5] = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(favg) - Tfw * fsigmaavg);
     ie[6] = fsigma + Tfw * fsigmasigma;
     ie[7] = fsigma - Tfw * fsigmasigma;
     return(ie);
 }
Ejemplo n.º 14
0
 public IntervalEstimation DoubleSideEstimation(double[] xArray, int[] vArray, double reponseProbability, double confidenceLevel, double favg, double fsigma) => LiftingDistributionSelection.IntervalDistribution(xArray, vArray, reponseProbability, confidenceLevel, favg, fsigma);
Ejemplo n.º 15
0
        //响应点计算
        public double ResponsePointCalculation(double fq, double fsimga, double favg)
        {
            double rpc = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(favg) + LiftingDistributionSelection.QValue(fq) * fsimga);

            pub_function.resolution_getReso(rpc, 0.000001, out rpc);
            return(rpc);
        }
Ejemplo n.º 16
0
 //
 public double[] GetPrec(double μ0_final, double σ0_final)
 {
     double[] prec = new double[2];
     prec[0] = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(μ0_final) + LiftingDistributionSelection.DistributionProcess() * σ0_final);
     prec[1] = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(μ0_final) - LiftingDistributionSelection.DistributionProcess() * σ0_final);
     return(prec);
 }
Ejemplo n.º 17
0
        //拟然比法区间计算绘图
        public SideReturnData QuasiLikelihoodRatioMethod(double Y_Ceiling, double Y_LowerLimit, int Y_PartitionNumber, double ConfidenceLevel, double favg, double fsigma, double[] xArray, int[] vArray, int intervalChoose)
        {
            var sideReturnData = GetSideReturnDataValue(Y_Ceiling, Y_LowerLimit, Y_PartitionNumber);

            xArray = LiftingMethodStandardSelection.InverseProcessArray(xArray);
            for (int i = 0; i < sideReturnData.responseProbability.Length; i++)
            {
                IntervalEstimation ie = new IntervalEstimation();
                if (intervalChoose == 0)
                {
                    ie = GetIntervalEstimationValue(SingleSideEstimation(xArray, vArray, sideReturnData.responseProbability[i], ConfidenceLevel, LiftingMethodStandardSelection.InverseProcessValue(favg), fsigma));
                }
                else
                {
                    ie = GetIntervalEstimationValue(DoubleSideEstimation(xArray, vArray, sideReturnData.responseProbability[i], ConfidenceLevel, LiftingMethodStandardSelection.InverseProcessValue(favg), fsigma));
                }
                sideReturnData.Y_LowerLimits[i] = ie.Confidence.Down;
                sideReturnData.Y_Ceilings[i]    = ie.Confidence.Up;
                double fq = sideReturnData.responseProbability[i];
                sideReturnData.responsePoints[i] = LiftingMethodStandardSelection.ProcessValue(LiftingMethodStandardSelection.InverseProcessValue(favg) + LiftingDistributionSelection.QValue(fq) * fsigma);
            }
            return(sideReturnData);
        }