lib-r-math.js
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -35,6 +35,21 @@ // find more constants of the kind M_XX_XX here | ||
export function imin2(x: number, y: number): number { | ||
return (x < y) ? x : y; | ||
} | ||
/* Use 0.5 - p + 0.5 to perhaps gain 1 bit of accuracy */ | ||
export function R_D_Lval(lower_tail: boolean, p: number): number { | ||
return (lower_tail ? (p) : (0.5 - (p) + 0.5)) /* p */ | ||
} | ||
export function R_D_Cval(lower_tail: boolean, p: number): number { | ||
return (lower_tail ? (0.5 - (p) + 0.5) : (p)) /* 1 - p */ | ||
} | ||
/* | ||
nearbyint is C99, so all platforms should have it (and AFAIK, all do) | ||
*/ | ||
export const M_SQRT_32 = 5.656854249492380195206754896838; /* sqrt(32) */ | ||
export const DBL_MANT_DIG = 18; | ||
@@ -80,3 +95,3 @@ export const FLT_MANT_DIG = DBL_MANT_DIG; | ||
export const M_LN_SQRT_PId2 = 0.225791352644727432363097614947; // log(sqrt(pi/2)) | ||
export const M_LN10 = 2.30258509299404568402 /* log_e 10 */ | ||
export const M_LN10 = 2.30258509299404568402 /* log_e 10 */ | ||
@@ -87,4 +102,4 @@ export const R_D__1 = (log_p: boolean) => { | ||
export const R_D__0 = (log: boolean): number => { | ||
return log ? ML_NEGINF : 0.0; | ||
export const R_D__0 = (log_p: boolean): number => { | ||
return log_p ? ML_NEGINF : 0.0; | ||
}; | ||
@@ -106,6 +121,2 @@ | ||
export function R_D_Lval(lower_tail: boolean, p: number): number { | ||
return (lower_tail ? (p) : (0.5 - (p) + 0.5)) /* p */ | ||
} | ||
export function R_P_bounds_01(lower_tail: boolean, log_p: boolean, x: number, x_min: number, x_max: number): number | undefined { | ||
@@ -112,0 +123,0 @@ if (x <= x_min) return R_DT_0(lower_tail, log_p); |
@@ -6,2 +6,3 @@ /* | ||
* | ||
* ORGINAL AUTHOR | ||
* Algorithm AS 275 Appl.Statist. (1992), vol.41, no.2 | ||
@@ -8,0 +9,0 @@ * original (C) 1992 Royal Statistical Society |
{ | ||
"name": "lib-r-math.js", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "Javascript Pure Implementation of Statistical R \"core\" numerical libRmath.so", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,2 +20,8 @@ # libRmath.js | ||
|------------------|--------------------|-------------|--------------------| | ||
pnorm.c | ./lib/pnorm.ts| 17 March 2017 | normal distribution function | | ||
ppois.c | ./lib/pois.ts | 17 March 2017 | The distribution function of the Poisson distribution. | | ||
pt.c | ./lib/pt.ts | 16 March | t distrib. with n degrees of freedom). | | ||
polygamma.c | ./lib/polygamma.c| 16 March | Compute the derivatives of the psi function and polygamma functions. | | ||
pnt.c | ./lib/pnt.ts| 16 March | Cumulative probability at t of the non-central t-distribution, with df degrees of freedom (may be fractional) and non-centrality, parameter delta.| | ||
pnf.c |./lib/pnf.ts| 15 March | The distribution function of the non-central F distribution.| | ||
|pnchisq.c | ./lib/pnchisq.tc | 14 March | Algorithm AS275: Computing the non-central chi-squared distribution function. | | ||
@@ -157,8 +163,8 @@ pnbinom.c | ./lib/pnbinom.ts | 14 March | The distribution function of the negative binomial distribution. | | ||
pnchisq.c | done| no | Algorithm AS275: Computing the non-central chi-squared distribution function. | | ||
pnf.c |TODO | | | | ||
pnf.c |done | no | The distribution function of the non-central F distribution. | | ||
pnorm.c | done| no | normal distribution function | | ||
pnt.c | TODO| | | | ||
polygamma.c | TODO| | | | ||
ppois.c | TODO| | | | ||
pt.c |TODO | | | | ||
pnt.c | done| | no | Cumulative probability at t of the non-central t-distribution, with df degrees of freedom (may be fractional) and non-centrality, parameter delta. | ||
polygamma.c | done| no | Compute the derivatives of the psi function and polygamma functions. | | ||
ppois.c | done | no | The distribution function of the Poisson distribution. | | ||
pt.c |done | no | t distrib. with n degrees of freedom). | | ||
ptukey.c | TODO| | | | ||
@@ -165,0 +171,0 @@ punif.c | TODO| | | |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1764192
3950
455
14227
220