lib-r-math.js
Advanced tools
Comparing version 1.0.13 to 1.0.14
@@ -0,1 +1,49 @@ | ||
// find more constants of the kind M_XX_XX here | ||
// https://svn.r-project.org/R/trunk/src/include/Rmath.h0.in | ||
/* | ||
WHY DO WE USE CUSTOM ROUND INSTEAD OF Javascript "Math.round" ? | ||
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math/round | ||
Note that this differs from many languages' round() functions, which often round this case to the next integer away from zero, instead (giving a different result in the case of negative numbers with a fractional part of exactly 0.5). | ||
*/ | ||
export const sqr = (x: number) => x * x; | ||
export const ceil = Math.ceil; | ||
export const trunc = Math.trunc; | ||
export const log10 = Math.log10; | ||
export const LONG_MAX = Number.MAX_SAFE_INTEGER; | ||
export const DBL_MAX_10_EXP = Math.log10(Number.MAX_VALUE); | ||
export const MAX_DIGITS = DBL_MAX_10_EXP; | ||
export const INT_MAX = Number.MAX_SAFE_INTEGER; | ||
export const INT_MIN = Number.MIN_SAFE_INTEGER; | ||
export function rround(x: number) { | ||
if (x < 0) { | ||
return trunc(x - 0.5); | ||
} | ||
return trunc(x + 0.5); | ||
} | ||
/* | ||
nearbyint is C99, so all platforms should have it (and AFAIK, all do) | ||
*/ | ||
export const DBL_MANT_DIG = 18; | ||
export const FLT_MANT_DIG = DBL_MANT_DIG; | ||
export const M_LN2 = 0.693147180559945309417232121458; /* ln(2) */ | ||
export const M_1_SQRT_2PI = 0.398942280401432677939946059934; | ||
export const nearbyint = rround; | ||
export const R_forceint = nearbyint; | ||
export const R_rint = nearbyint; | ||
export const M_2PI = 6.283185307179586476925286766559; | ||
export const M_LN_2PI = 1.837877066409345483560659472811; | ||
export const sqrt = Math.sqrt; | ||
@@ -6,13 +54,10 @@ export const DBL_EPSILON = 1E-16; //true for javascript, this was tested | ||
export const exp = Math.exp; | ||
export const rtnsig_BESS = 1e-4; | ||
export const enten_BESS = 1e308; | ||
export const xlrg_BESS_IJ = 1e5; | ||
export const enmten_BESS = 8.9e-308; | ||
export const isInteger = Number.isInteger; | ||
export const sin = Math.sin; | ||
export const cos = Math.cos; | ||
export const pow = Math.pow; | ||
export const ensig_BESS = 1e16; | ||
export const M_1_PI = 1.0 / Math.PI; | ||
export const sqxmin_BESS_K = 1.49e-154; | ||
export const xmax_BESS_K = 705.342;/* maximal x for UNscaled answer */ | ||
export const R_FINITE = (x: number) => Number.isFinite(x); | ||
@@ -22,8 +67,8 @@ export const NaN = Number.NaN; | ||
export const DBL_MIN = FLT_MIN; | ||
export const xlrg_BESS_Y = 1e8; | ||
export const log = Math.log; | ||
export const ISNAN = Number.isNaN; | ||
export const thresh_BESS_Y = 16.; | ||
export const M_eps_sinc = 2.149e-8; | ||
export const ML_NAN = NaN; | ||
export const round = Math.round; | ||
export const ML_POSINF = Number.POSITIVE_INFINITY; | ||
@@ -33,9 +78,45 @@ export const ML_NEGINF = Number.NEGATIVE_INFINITY; | ||
export const M_PI_2 = Math.PI / 2; | ||
export const M_LN_SQRT_PI = 0.5723649429247; // log(sqrt(pi)) | ||
export const M_LN_SQRT_2PI = 0.918938533204672741780329736406; // log(sqrt(2*pi)) | ||
export const M_LN_SQRT_PId2 = 0.225791352644727432363097614947; // log(sqrt(pi/2)) | ||
export const R_D__0 = (log: boolean) => { return log ? ML_NEGINF : 0.0; }; | ||
export const R_D__1 = (log_p: boolean) => { | ||
return log_p ? 0. : 1.0; | ||
}; | ||
export const R_D__0 = (log: boolean): number => { | ||
return log ? ML_NEGINF : 0.0; | ||
}; | ||
export function R_P_bounds_01(lower_tail: boolean, log_p: boolean, x: number, x_min: number, x_max: number): number | undefined { | ||
if (x <= x_min) return R_DT_0(lower_tail, log_p); | ||
if (x >= x_max) return R_DT_1(lower_tail, log_p); | ||
return undefined; | ||
} | ||
export const R_DT_0 = (lower_tail: boolean,log_p: boolean): number => { | ||
return lower_tail ? R_D__0(log_p) : R_D__1(log_p); | ||
}; | ||
export const R_DT_1 = (lower_tail: boolean, log_p: boolean): number => { | ||
return lower_tail ? R_D__1(log_p) : R_D__0(log_p); | ||
}; | ||
export const R_D_val = (log_p: boolean, x: number) => { | ||
return (log_p ? log(x) : (x)); | ||
}; | ||
export const R_D_exp = (log_p: boolean, x: number): number => { | ||
return (log_p ? (x) : exp(x)); | ||
/* exp(x) */ | ||
} | ||
export const floor = Math.floor; | ||
export const trunc = Math.trunc; | ||
export const M_SQRT_2dPI = 0.797884560802865355879892119869; // sqrt(2/pi) | ||
export const R_D_exp = (x: any, logP: any) => { return !!logP ? (x) : Math.exp(x); }; /* exp(x) */ | ||
export const M_LOG10_2 = 0.301029995663981195213738894724; | ||
export enum ME { | ||
@@ -94,5 +175,13 @@ ME_NONE = 0, // no error | ||
return ML_NAN; | ||
} | ||
export function R_D_nonint_check(log: boolean, x: number) { | ||
if (R_nonint(x)) { | ||
MATHLIB_WARNING('non-integer x = %f', x); | ||
return R_D__0(log); | ||
} | ||
return undefined; | ||
} | ||
export function fabs(x: number) { | ||
@@ -106,3 +195,3 @@ return (x < 0 ? -x : x); | ||
export function fmax2(x: number, y: number) { | ||
export function fmax2(x: number, y: number): number { | ||
if (ISNAN(x) || ISNAN(y)) { | ||
@@ -112,2 +201,247 @@ return x + y; | ||
return (x < y) ? y : x; | ||
} | ||
} | ||
export function fmin2(x: number, y: number): number { | ||
if (ISNAN(x) || ISNAN(y)) { | ||
return x + y; | ||
} | ||
return (x < y) ? x : y; | ||
} | ||
export function isOdd(k: number) { | ||
return (floor(k) % 2) === 1; | ||
} | ||
export function Rf_d1mach(i: number): number { | ||
switch (i) { | ||
case 1: return DBL_MIN; | ||
case 2: return DBL_MAX; | ||
case 3: /* = FLT_RADIX ^ - DBL_MANT_DIG | ||
for IEEE: = 2^-53 = 1.110223e-16 = .5*DBL_EPSILON */ | ||
return 0.5 * DBL_EPSILON; | ||
case 4: /* = FLT_RADIX ^ (1- DBL_MANT_DIG) = | ||
for IEEE: = 2^-52 = DBL_EPSILON */ | ||
return DBL_EPSILON; | ||
case 5: return M_LOG10_2; | ||
default: return 0.0; | ||
} | ||
} | ||
export function dF77_NAME(i: number): number { | ||
return Rf_d1mach(i); | ||
} | ||
export function R_D_negInonint(x: number) { | ||
return x < 0.0 || R_nonint(x); | ||
} | ||
export function R_nonint(x: number) { | ||
return (fabs((x) - R_forceint(x)) > 1e-7 * fmax2(1., fabs(x))) | ||
} | ||
export function R_D_fexp(give_log: boolean, f: number, x: number): number { | ||
return (give_log ? -0.5 * log(f) + (x) : exp(x) / sqrt(f)); | ||
} | ||
/** bessel section */ | ||
/** bessel section */ | ||
/** bessel section */ | ||
export const nsig_BESS = 16; | ||
export const ensig_BESS = 1e16; | ||
export const rtnsig_BESS = 1e-4; | ||
export const enmten_BESS = 8.9e-308; | ||
export const enten_BESS = 1e308; | ||
export const exparg_BESS = 709.; | ||
export const xlrg_BESS_IJ = 1e5; | ||
export const xlrg_BESS_Y = 1e8; | ||
export const thresh_BESS_Y = 16.; | ||
export const xmax_BESS_K = 705.342/* maximal x for UNscaled answer */ | ||
/* sqrt(DBL_MIN) = 1.491668e-154 */ | ||
export const sqxmin_BESS_K = 1.49e-154; | ||
/* x < eps_sinc <==> sin(x)/x == 1 (particularly "==>"); | ||
Linux (around 2001-02) gives 2.14946906753213e-08 | ||
Solaris 2.5.1 gives 2.14911933289084e-08 | ||
*/ | ||
export const M_eps_sinc = 2.149e-8; | ||
export function R_pow_di(x: number, n: number) { | ||
let pow: number = 1.0; | ||
if (ISNAN(x)) return x; | ||
if (n != 0) { | ||
if (!R_FINITE(x)) return R_pow(x, n); | ||
if (n < 0) { n = -n; x = 1 / x; } | ||
for (; ;) { | ||
if (n & 1) pow *= x; | ||
if (n >>= 1) x *= x; else break; | ||
} | ||
} | ||
return pow; | ||
} | ||
export function R_pow(x: number, y: number): number { /* = x ^ y */ | ||
/* squaring is the most common of the specially handled cases so | ||
check for it first. */ | ||
if (y == 2.0) | ||
return x * x; | ||
if (x == 1. || y == 0.) | ||
return (1.); | ||
if (x == 0.) { | ||
if (y > 0.) return (0.); | ||
else if (y < 0) return (ML_POSINF); | ||
else return (y); /* NA or NaN, we assert */ | ||
} | ||
if (R_FINITE(x) && R_FINITE(y)) { | ||
/* There was a special case for y == 0.5 here, but | ||
gcc 4.3.0 -g -O2 mis-compiled it. Showed up with | ||
100^0.5 as 3.162278, example(pbirthday) failed. */ | ||
return pow(x, y); | ||
} | ||
if (ISNAN(x) || ISNAN(y)) | ||
return (x + y); | ||
if (!R_FINITE(x)) { | ||
if (x > 0) /* Inf ^ y */ | ||
return (y < 0.) ? 0. : ML_POSINF; | ||
else { /* (-Inf) ^ y */ | ||
if (R_FINITE(y) && y == floor(y)) /* (-Inf) ^ n */ | ||
return (y < 0.) ? 0. : (myfmod(y, 2.) ? x : -x); | ||
} | ||
} | ||
if (!R_FINITE(y)) { | ||
if (x >= 0) { | ||
if (y > 0) /* y == +Inf */ | ||
return (x >= 1) ? R_PosInf : 0.; | ||
else /* y == -Inf */ | ||
return (x < 1) ? R_PosInf : 0.; | ||
} | ||
} | ||
return NaN; // all other cases: (-Inf)^{+-Inf, non-int}; (neg)^{+-Inf} | ||
} | ||
export const R_finite = (x: number) => !Number.isFinite(x); | ||
/* C++ math header undefines any isnan macro. This file | ||
doesn't get C++ headers and so is safe. */ | ||
export const R_isnancpp = (x: number) => ISNAN(x); | ||
export function myfmod(x1: number, x2: number) { | ||
let q = x1 / x2; | ||
return x1 - floor(q) * x2; | ||
} | ||
export function R_powV(x: number, y: number): number /* = x ^ y */ { | ||
if (x == 1. || y == 0.) | ||
return (1.); | ||
if (x == 0.) { | ||
if (y > 0.) return (0.); | ||
/* y < 0 */return (ML_POSINF); | ||
} | ||
if (R_FINITE(x) && R_FINITE(y)) | ||
return (pow(x, y)); | ||
if (ISNAN(x) || ISNAN(y)) { | ||
return (x + y); | ||
} | ||
if (!R_FINITE(x)) { | ||
if (x > 0) /* Inf ^ y */ | ||
return ((y < 0.) ? 0. : ML_POSINF); | ||
else { /* (-Inf) ^ y */ | ||
if (R_FINITE(y) && y == floor(y)) /* (-Inf) ^ n */ | ||
return ((y < 0.) ? 0. : (myfmod(y, 2.) ? x : -x)); | ||
} | ||
} | ||
if (!R_FINITE(y)) { | ||
if (x >= 0) { | ||
if (y > 0) /* y == +Inf */ | ||
return ((x >= 1) ? ML_POSINF : 0.); | ||
else /* y == -Inf */ | ||
return ((x < 1) ? ML_POSINF : 0.); | ||
} | ||
} | ||
return (ML_NAN); /* all other cases: (-Inf)^{+-Inf, | ||
non-int}; (neg)^{+-Inf} */ | ||
} | ||
export const NA_REAL = ML_NAN; | ||
export const R_PosInf = ML_POSINF; | ||
export const R_NegInf = ML_NEGINF; | ||
export function REprintf(fmt: string, ...args: any[]) { | ||
let args2 = Array.from(args);//.slice(1); | ||
console.error.call(console.error, fmt, args2); | ||
} | ||
// return x * Math.pow(2,y) | ||
export function ldexp(x: number, y: number): number { | ||
if (ISNAN(x) || ISNAN(y)) { | ||
return (x + y); | ||
} | ||
if (!R_FINITE(x) || !R_FINITE(y)) { | ||
return ML_POSINF; | ||
} | ||
return x * Math.pow(2, y); | ||
} | ||
export const FLT_RADIX = 2; | ||
export const CHAR_BIT = 8; | ||
export const DBL_MAX_EXP = Math.log2(Number.MAX_VALUE); | ||
export const DBL_MIN_EXP = Math.log2(Number.MIN_VALUE); | ||
export const FLT_MAX_EXP = DBL_MAX_EXP; | ||
export const FLT_MIN_EXP = DBL_MIN_EXP; | ||
export const sizeofInt = 4 * Math.ceil(Math.log(Number.MAX_SAFE_INTEGER) / Math.log(2) / 4 / CHAR_BIT); | ||
export function Rf_i1mach(i: number): number { | ||
switch (i) { | ||
case 1: return 5; | ||
case 2: return 6; | ||
case 3: return 0; | ||
case 4: return 0; | ||
case 5: return CHAR_BIT * sizeofInt; | ||
case 6: return sizeofInt; | ||
case 7: return 2; | ||
case 8: return CHAR_BIT * sizeofInt - 1; | ||
case 9: return INT_MAX; | ||
case 10: return FLT_RADIX; | ||
case 11: return FLT_MANT_DIG; | ||
case 12: return FLT_MIN_EXP; | ||
case 13: return FLT_MAX_EXP; | ||
case 14: return DBL_MANT_DIG; | ||
case 15: return DBL_MIN_EXP; | ||
case 16: return DBL_MAX_EXP; | ||
default: return 0; | ||
} | ||
} | ||
export function iF77_NAME(i: number) { | ||
return Rf_i1mach(i); | ||
} | ||
@@ -0,0 +0,0 @@ // email from George Marsaglia |
@@ -0,0 +0,0 @@ //park node crypto in diff namespace |
@@ -0,0 +0,0 @@ /* |
@@ -76,5 +76,2 @@ /* | ||
// unused now from R | ||
@@ -81,0 +78,0 @@ function bessel_j(x: number, alpha: number): number { |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* |
@@ -47,13 +47,21 @@ /* | ||
import {ISNAN, R_FINITE, ML_POSINF,ML_ERR_return_NAN, ML_ERROR, ME} from "./_general" | ||
import {gammafn} from "./gamma" | ||
import { lbeta } from "./lbeta" | ||
import { | ||
ISNAN, | ||
R_FINITE, | ||
ML_POSINF, | ||
ML_ERR_return_NAN, | ||
ML_ERROR, | ||
ME | ||
} from './_general'; | ||
import { gammafn } from './gamma_fn'; | ||
import { lbeta } from './lbeta'; | ||
//const xmin = - 170.5674972726612; | ||
const xmax = 171.61447887182298; | ||
const xmax = 171.61447887182298; | ||
const lnsml = - 708.39641853226412; | ||
export function beta(a:number, b:number):number { | ||
export function beta(a: number, b: number): number { | ||
/*#ifdef NOMORE_FOR_THREADS | ||
@@ -74,3 +82,3 @@ static double xmin, xmax = 0;//-> typically = 171.61447887 for IEEE | ||
if (ISNAN(a) || ISNAN(b)) return a + b; | ||
if (a < 0 || b < 0) | ||
@@ -92,3 +100,3 @@ return ML_ERR_return_NAN() | ||
} else { | ||
let val:number = lbeta(a, b); | ||
let val: number = lbeta(a, b); | ||
// underflow to 0 is not harmful per se; exp(-999) also gives no warning | ||
@@ -163,2 +171,2 @@ //#ifndef IEEE_754 | ||
} | ||
*/ | ||
*/ |
@@ -52,4 +52,6 @@ /* | ||
import { fabs, NaN } from "./_general" | ||
import { NaN, fabs } from './_general'; | ||
export function chebyshev_init(dos: number[], nos: number, eta: number): number { | ||
@@ -79,3 +81,6 @@ let i: number; | ||
let b0: number, b1: number, b2: number, twox: number; | ||
let b0: number; | ||
let b1: number; | ||
let b2: number; | ||
let twox: number; | ||
let i: number; | ||
@@ -82,0 +87,0 @@ |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* |
/* | ||
* AUTHOR | ||
* Jacob Bogers, jkfbogers@gmail.com | ||
* March 2, 2017 | ||
* | ||
* ORIGINAL C-CODE AUTHOR (R Project) | ||
* Mathlib : A C Library of Special Functions | ||
* Copyright (C) 1998 Ross Ihaka | ||
* Copyright (C) 2000-12 The R Core Team | ||
* Copyright (C) 2003 The R Foundation | ||
* Copyright (C) 2000-2013 The R Core Team | ||
* Copyright (C) 2002-2004 The R Foundation | ||
* | ||
@@ -36,18 +41,28 @@ * This program is free software; you can redistribute it and/or modify | ||
import { ISNAN, R_FINITE, ML_POSINF, ML_ERR_return_NAN, ML_NEGINF, M_LN_SQRT_2PI } from './_general'; | ||
import { | ||
ISNAN, | ||
R_FINITE, | ||
ML_POSINF, | ||
ML_ERR_return_NAN, | ||
ML_NEGINF, | ||
M_LN_SQRT_2PI | ||
} from './_general'; | ||
import { lgammacor } from './lgammacor'; | ||
import { lgammafn } from './lgamma'; | ||
import { gammafn } from './gamma'; | ||
import { lgammafn } from './lgamma_fn'; | ||
import { gammafn } from './gamma_fn'; | ||
export function lbeta(a: number, b: number): number { | ||
let corr: number, p: number, q: number; | ||
let corr: number; | ||
let p: number; | ||
let q: number; | ||
//#ifdef IEEE_754 | ||
if (ISNAN(a) || ISNAN(b)) | ||
return a + b; | ||
//#endif | ||
p = q = a; | ||
if (b < p) p = b;// := min(a,b) | ||
if (b > q) q = b;// := max(a,b) | ||
if (b < p) p = b; // := min(a,b) | ||
if (b > q) q = b; // := max(a,b) | ||
@@ -57,3 +72,3 @@ // both arguments must be >= 0 | ||
return ML_ERR_return_NAN(); | ||
else if (p == 0) { | ||
else if (p === 0) { | ||
return ML_POSINF; | ||
@@ -134,2 +149,2 @@ } | ||
} | ||
*/ | ||
*/ |
@@ -52,3 +52,3 @@ /* | ||
import { ME, ML_ERROR, ML_ERR_return_NAN } from './_general' | ||
import { ME, ML_ERROR, ML_ERR_return_NAN } from './_general'; | ||
import { chebyshev_eval } from './chebyshev'; | ||
@@ -74,5 +74,5 @@ | ||
const nalgm = 5 | ||
const xbig = 94906265.62425156 | ||
const xmax = 3.745194030963158e306 | ||
const nalgm = 5; | ||
const xbig = 94906265.62425156; | ||
const xmax = 3.745194030963158e306; | ||
@@ -88,3 +88,3 @@ export function lgammacor(x: number) { | ||
if (x < 10) | ||
return ML_ERR_return_NAN() | ||
return ML_ERR_return_NAN(); | ||
else if (x >= xmax) { | ||
@@ -145,2 +145,2 @@ ML_ERROR(ME.ME_UNDERFLOW, 'lgammacor'); | ||
} | ||
*/ | ||
*/ |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* AUTHOR |
@@ -43,3 +43,3 @@ /* | ||
import {M_LN_SQRT_2PI} from './_general'; | ||
import {lgammafn} from './lgamma'; | ||
import {lgammafn} from './lgamma_fn'; | ||
@@ -46,0 +46,0 @@ const sferr_halves: number[] = [ |
{ | ||
"name": "lib-r-math.js", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "Javascript Pure Implementation of Statistical R \"core\" numerical libRmath.so", | ||
@@ -20,3 +20,6 @@ "main": "index.js", | ||
"distribution", | ||
"statistic" | ||
"statistic", | ||
"special functions", | ||
"bessel function", | ||
"data science" | ||
], | ||
@@ -23,0 +26,0 @@ "author": "Jacob Bogers", |
@@ -20,2 +20,32 @@ # libRmath.js | ||
|------------------|--------------------|-------------|--------------------| | ||
| Toms708.java | ./lib/Toms708.ts | 14 March 2017 | from Java Version James Curran (j.curran@auckland.ac.nz) (Java version) | | ||
| pbeta.c | ./lib/pbeta.ts | 14 March 2017 | beta distribution function | | ||
| pnorm.c| ./lib/pnorm.ts | 9 March 2017 | Normal distribution function | | ||
| gammalims.c | ./lib/gammalims.ts | 5 march 2017 | calculates legal bounds of gamme_fn| | ||
| fround.c | ./lib/fround.ts | 5 march 2017 | rounds off to a set number of digites | | ||
| fprec.c | ./lib/fprec.ts | 4 march 2017 | Returns the value of x rounded to "digits" significant | | ||
| expm1.c | ./lib/expm1.ts | 4 march 2017 | Compute the Exponential minus 1 | | ||
| dweibull.c | ./lib/dweibull.ts | 4 march 2017 | The density function of the Weibull distribution.| | ||
| dt.c | ./lib/dt.ts| 4 March 2017 | The t density | | ||
| dpois.c | ./lib/dpois.ts | 4 March 2017 | dpois() computes the Poisson probability lb^x exp(-lb) / x! | | ||
| dnchisq.c | ./lib/dnchisq.ts | The density of the noncentral chi-squared distribution with "df" | | ||
| dnt.c | ./lib/dnt.ts| 4 March 2017 | Computes the density of the noncentral beta distribution with | | ||
| dnorm.c | ./lib/dnorm.ts | 25 feb 2017 | Compute the density of the normal distribution. | | ||
| dnf.c | ./lib/dnt.ts | 25 feb 2017 | The density function of the non-central F distribution | | ||
| dnbinom.c | ./lib/dnbinom.ts | 25 feb 2017 | Computes the negative binomial distribution. | | ||
| dlogis.c | ./lib/dlogis.ts | 4 March 2017 | not sure what it does | | ||
| dlnorm.c | ./lib/dlnorm.ts |4 March 2017|The density of the lognormal distribution.| | ||
| dhyper.c | ./lib/dhyper.ts | 4 March 2017 | The hypergeometric probability | | ||
| dgeom.c | ./lib/dgeom.ts | 4 March 2017 | Computes the geometric probabilities, Pr(X=x) = p(1-p)^x. | | ||
| dnbeta.c | ./lib/dnbeta.ts | 4 March 2017 | Computes the density of the noncentral beta distribution with | | ||
| pgamma.c | ./lib/pgamme.ts | 9 March 2017 | This function computes the distribution function for the gamma distribution | | ||
| dgamma.c | ./lib/dgamma.ts | 27 feb 2017 | Computes the density of the gamma distribution | | ||
| lbeta.c | ./lib/lbeta.ts | March 2 2017 | This function returns the value of the log beta function.| | ||
| C99 gamma function | ./lib/c99_gamma.ts | 25 feb 2017 | added C99 gamma and lgamma, | | ||
|dnbinom.c | ./lib/dnbinom.ts | 25 feb 2017 | negative binomial distribution. | ||
|dbeta.c | ./lib/dbeta.ts | 25 feb 2017 | R "dbeta" beta distribution function | | ||
|dbinom.c | ./lib/dbinom.ts | 25 feb 2017 | probability mass function of binomial distribution | | ||
|log1p.c | ./lib/log1p.ts | 25 feb 2017| calculate log(1+x) for small value of x| | ||
|choose.c | choose.ts | 21 feb 2017 | R "choose" function, C(n,k) binomial coefficients | | ||
|gamma_cody.c | gamme_cody.ts| 19 feb 2017| GAMMA function using algo of W. J. Cody, | | ||
@@ -30,8 +60,8 @@ |bessel_i.c | bessel_i.ts | 19 feb 2017 | besseli | | ||
|runif.c | ./runif.ts| 4-feb-2017 | implemented 3 RNG and native browser/node agnostic 64 RNG map to floating number | | ||
|bd0.c | ./lib/bd0.ts |23-jan-2017 | hidden, used by modules dbinom.c ,dpois.c dt.c | | ||
|bd0.c | ./lib/bd0.ts |23-jan-2017 | hidden, used by modules dbinom.c ,dpois.c dt.c | | ||
|beta.c |./lib/beta.ts | 23-jan-2017 | [beta](https://en.wikipedia.org/wiki/Beta_function) | | ||
|chebyshev.c | ./lib/chebyshev.ts | 23-jan-2017 | chebyshev\_init , chebyshev\_eval | | ||
|cospi.c | ./lib/cospi.ts | 23-jan-2017 | cospi, sinpi, tanpi | | ||
|gamma.c |./lib/gamma.ts | 23-jan-2017 | [gammafn] gamme function(https://en.wikipedia.org/wiki/Gamma_function) | | ||
|lgamma.c | ./lib/lgamma.ts | 23-jan-2017 | logarithmic gamma [lgammafn](https://en.wikipedia.org/wiki/Gamma_function) | | ||
|gamma.c |./lib/gamma_fn.ts | 23-jan-2017 | [gammafn] gamme function(https://en.wikipedia.org/wiki/Gamma_function) | | ||
|lgamma.c | ./lib/lgamma_fn.ts | 23-jan-2017 | logarithmic gamma [lgammafn](https://en.wikipedia.org/wiki/Gamma_function) | | ||
|lgammacor.c |./lib/lgammecor.ts | 23-jan-2017 | lgammacor | | ||
@@ -50,9 +80,9 @@ |stirlerr.c | ./lib/stirlerr | 23-jan-2017 | Computes the log of the error term in Stirling's formula ( _stirlerr_ ) | | ||
bessel_y.c | done | no | R "bessely" gives the Bessel function of the second kind . | | ||
beta.c |done ./lib/beta.ts | no | [beta](https://en.wikipedia.org/wiki/Beta_function) | | ||
beta.c |done | no | [beta](https://en.wikipedia.org/wiki/Beta_function) | | ||
chebyshev.c | done ./lib/chebyshev.ts | no | chebyshev\_init , chebyshev\_eval | | ||
choose.c |TODO | | | | ||
choose.c |done | no | R "choose" function, C(n,k) binomial coefficients | | ||
cospi.c | done ./lib/cospi.ts | no| cospi, sinpi, tanpi | | ||
d1mach.c |TODO | | | | ||
dbeta.c | TODO | | | | ||
dbinom.c | TODO| | | | ||
d1mach.c |done | no | included in ./_general.ts | | ||
dbeta.c | done | no | distribution function of beta | | ||
dbinom.c | done | no | probability mass function of binomial distribution | | ||
dcauchy.c | TODO| | | | ||
@@ -62,36 +92,36 @@ dchisq.c | TODO| | | | ||
df.c | TODO| | | | ||
dgamma.c | TODO| | | | ||
dgeom.c |TODO | | | | ||
dhyper.c |TODO | | | | ||
dgamma.c | done| no | Computes the density of the gamma distribution, | | ||
dgeom.c |done |no | Computes the geometric probabilities, Pr(X=x) = p(1-p)^x | | ||
dhyper.c |done | no | The hypergeometric probability | | ||
dlnorm.c |TODO | | | | ||
dlogis.c | TODO| | | | ||
dnbeta.c |TODO | | | | ||
dnbinom.c |TODO | | | | ||
dnbeta.c |done | no | Computes the density of the noncentral beta distribution with | | ||
dnbinom.c |done | no | negative binomial probability prob mass function | | ||
dnchisq.c |TODO | | | | ||
dnf.c |TODO | | | | ||
dnorm.c |TODO | | | | ||
dnt.c |TODO | | | | ||
dpois.c | TODO| | | | ||
dt.c |TODO | | | | ||
dnf.c |done | no | The density function of the non-central F distribution | | ||
dnorm.c |done | no | Compute the density of the normal distribution. | | ||
dnt.c |done | no | the non-central t density | | ||
dpois.c | done| no | dpois() computes the Poisson probability lb^x exp(-lb) / x! | | ||
dt.c |done | no | The t density | | ||
dunif.c | done| no | R "dunif" function | | ||
dweibull.c | TODO| | | | ||
expm1.c |TODO | | | | ||
dweibull.c | done| no | The density function of the Weibull distribution. | | ||
expm1.c |done | no | Compute the Exponential minus 1 | | ||
fmax2.c |TODO | | | | ||
fmin2.c | TODO| | | | ||
fprec.c |TODO | | | | ||
fround.c |TODO | | | | ||
fprec.c |done | no | Returns the value of x rounded to "digits" significant | | ||
fround.c |done | no | fround function | | ||
fsign.c |TODO | | | | ||
ftrunc.c | TODO| | | | ||
gamma.c |done ./lib/gamma.ts | no | [gammafn](https://en.wikipedia.org/wiki/Gamma_function) | | ||
gamma.c |done ./lib/gamma_fn.ts | no | [gammafn](https://en.wikipedia.org/wiki/Gamma_function) | | ||
gamma_cody.c | done| no | GAMMA function using algo of W. J. Cody, | | ||
gammalims.c |TODO | | | | ||
gammalims.c |done | no | calculates legal bounds of gamma_fn | | ||
i1mach.c |TODO | | | | ||
imax2.c |TODO | | | | ||
imin2.c | TODO| | | | ||
lbeta.c | TODO| | | | ||
lgamma.c | done ./lib/lgamma.ts | no | logarithmic gamma [lgammafn](https://en.wikipedia.org/wiki/Gamma_function) | | ||
lbeta.c | done| no | This function returns the value of the log beta function. | | ||
lgamma.c | done ./lib/lgamma_fn.ts | no | logarithmic gamma [lgammafn](https://en.wikipedia.org/wiki/Gamma_function) | | ||
lgammacor.c |done ./lib/lgammecor.ts | no | lgammacor | | ||
log1p.c |TODO | | | | ||
log1p.c | done | no | calculate log(1+x) with high accuracy for small x | | ||
mlutils.c |TODO | | | | ||
pbeta.c |TODO | | | | ||
pbeta.c |done | no | pBeta distribution function | | ||
pbinom.c |TODO | | | | ||
@@ -102,3 +132,3 @@ pcauchy.c | TODO| | | | ||
pf.c |TODO | | | | ||
pgamma.c |TODO | | | | ||
pgamma.c |done | no | This function computes the distribution function for the gamma distribution | | ||
pgeom.c | TODO| | | | ||
@@ -112,3 +142,3 @@ phyper.c |TODO | | | | ||
pnf.c |TODO | | | | ||
pnorm.c | TODO| | | | ||
pnorm.c | done| no | normal distribution function | | ||
pnt.c | TODO| | | | ||
@@ -167,4 +197,4 @@ polygamma.c | TODO| | | | ||
stirlerr.c | done ./lib/stirlerr | no | Computes the log of the error term in Stirling's formula ( _stirlerr_ ) | | ||
toms708.c |TODO | | | | ||
toms708.c |NAP | no | ported instead Java Version from James Curran (j.curran@auckland.ac.nz) (Java version) | | ||
wilcox.c | TODO| | | | ||
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1648171
438
15893
194
1