示例#1
0
文件: invexp.c 项目: mrthat/actuar
double qinvexp(double p, double scale, int lower_tail, int log_p)
{
    if (!R_FINITE(scale) || scale <= 0.0)
        return R_NaN;

    ACT_Q_P01_boundaries(p, 0, R_PosInf);
    p = ACT_D_qIv(p);

    return -scale / log(ACT_D_Lval(p));
}
示例#2
0
文件: invpareto.c 项目: mrthat/actuar
double qinvpareto(double p, double shape, double scale, int lower_tail,
                  int log_p)
{
    if (!R_FINITE(shape) ||
        !R_FINITE(scale) ||
        shape <= 0.0 ||
        scale <= 0.0)
        return R_NaN;;

    ACT_Q_P01_boundaries(p, 0, R_PosInf);
    p = ACT_D_qIv(p);

    return scale / (R_pow(ACT_D_Lval(p), -1.0 / shape) - 1.0);
}
示例#3
0
文件: invexp.c 项目: cran/actuar
double qinvexp(double p, double scale, int lower_tail, int log_p)
{
#ifdef IEEE_754
    if (ISNAN(p) || ISNAN(scale))
	return p + scale;
#endif
    if (!R_FINITE(scale) || scale <= 0.0)
        return R_NaN;

    ACT_Q_P01_boundaries(p, 0, R_PosInf);
    p = ACT_D_qIv(p);

    return -scale / log(ACT_D_Lval(p));
}
示例#4
0
文件: pareto1.c 项目: cran/actuar
double qpareto1(double p, double shape, double min, int lower_tail, int log_p)
{
#ifdef IEEE_754
    if (ISNAN(p) || ISNAN(shape) || ISNAN(min))
	return p + shape + min;
#endif
    if (!R_FINITE(shape) ||
        !R_FINITE(min)   ||
        shape <= 0.0 ||
        min <= 0.0)
        return R_NaN;

    ACT_Q_P01_boundaries(p, min, R_PosInf);
    p = ACT_D_qIv(p);

    return min / R_pow(ACT_D_Cval(p), 1.0 / shape);
}
示例#5
0
double qinvparalogis(double p, double shape, double scale, int lower_tail,
                     int log_p)
{
    double tmp;

    if (!R_FINITE(shape) ||
        !R_FINITE(scale) ||
        shape <= 0.0 ||
        scale <= 0.0)
        return R_NaN;;

    ACT_Q_P01_boundaries(p, 0, R_PosInf);
    p = ACT_D_qIv(p);

    tmp = -1.0 / shape;

    return scale * R_pow(R_pow(ACT_D_Lval(p), tmp) - 1.0, tmp);
}