Ejemplo n.º 1
0
        public CPHDist(int ndim, GetParamVec alphaFunc, GetParamVec rateFunc,
                       GetParam lambdaFunc, GetParamVec scaledRateFunc, double epsi)
        {
            this.ndim       = ndim;
            this.alphaFunc  = alphaFunc;
            this.rateFunc   = rateFunc;
            this.lambdaFunc = lambdaFunc;
            this.epsi       = epsi;

            cache_x = new double[ndim];
            cache_t = 0.0;
            Blas.Dcopy(ndim, Alpha, cache_x);

            max_right = 10;
            prob      = new double[max_right + 1];
            unif      = new CPHUniformization(ndim, lambdaFunc, scaledRateFunc);
        }
Ejemplo n.º 2
0
        public CPHEMSRM(CPHParam param, double epsi = 1.0e-8)
            : base(param.N + "-CanonicalPH SRGM", 2 * param.N, param.GetOmega,
                   new CPHDist(param.N, param.GetAlpha, param.GetRate, param.GetLambda, param.GetScaledRate, epsi))
        {
            ndim       = param.N;
            this.param = param;
            this.epsi  = epsi;
            cuni       = new CPHUniformization(ndim, param.GetLambda, param.GetScaledRate);

            tmp = new double[ndim];
            h0  = new double[ndim * 2];
            pi2 = new double[ndim];

            //vf = new double[ndim];
            //vf2 = new double[ndim];

            eb  = new double[ndim];
            eb2 = new double[ndim];
            en  = new double[ndim * 2];
            ey  = new double[ndim];
        }