-
Notifications
You must be signed in to change notification settings - Fork 30
/
310_Rmath.Rmd
executable file
·196 lines (148 loc) · 7.89 KB
/
310_Rmath.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# R Math Library
R Math Library is a library that provides functions such as math and statistics defined by R. These functions become available when you include `Rmath.h`. Since Rmath itself is an independent library, it can be used from other programs. You can also call the function defined in `Rmath.h` from Rcpp. They are defined in the `R::` namespace.
The function of `Rmath.h` is written in C language and it is not vectorized.
```c
double R::norm_rand(void)
double R::unif_rand(void)
double R::exp_rand(void)
void R::pnorm_both(double x, double *cum, double *ccum, int lt, int lg)
void R::rmultinom(int n, double* prob, int k, int* rn)
double R::dsignrank(double x, double n, int lg)
double R::psignrank(double x, double n, int lt, int lg)
double R::qsignrank(double x, double n, int lt, int lg)
double R::rsignrank(double n)
double R::dwilcox(double x, double m, double n, int lg)
double R::pwilcox(double q, double m, double n, int lt, int lg)
double R::qwilcox(double x, double m, double n, int lt, int lg)
double R::rwilcox(double m, double n)
double R::ptukey(double q, double rr, double cc, double df, int lt, int lg)
double R::qtukey(double p, double rr, double cc, double df, int lt, int lg)
double R::log1pmx(double x)
double R::log1pexp(double x)
double R::lgamma1p(double a)
double R::logspace_add(double lx, double ly)
double R::logspace_sub(double lx, double ly)
double R::gammafn(double x)
double R::lgammafn(double x)
double R::lgammafn_sign(double x, int *sgn)
void R::dpsifn(double x, int n, int kode, int m, double *ans, int *nz, int *ierr)
double R::psigamma(double x, double deriv)
double R::digamma(double x)
double R::trigamma(double x)
double R::tetragamma(double x)
double R::pentagamma(double x)
double R::beta(double a, double b)
double R::lbeta(double a, double b)
double R::choose(double n, double k)
double R::lchoose(double n, double k)
double R::bessel_i(double x, double al, double ex)
double R::bessel_j(double x, double al)
double R::bessel_k(double x, double al, double ex)
double R::bessel_y(double x, double al)
double R::bessel_i_ex(double x, double al, double ex, double *bi)
double R::bessel_j_ex(double x, double al, double *bj)
double R::bessel_k_ex(double x, double al, double ex, double *bk)
double R::bessel_y_ex(double x, double al, double *by)
double R::hypot(double a, double b)
double R::pythag(double a, double b)
double R::expm1(double x); /* = exp(x)-1 {care for small x} */
double R::log1p(double x); /* = log(1+x) {care for small x} */
int R::imax2(int x, int y)
int R::imin2(int x, int y)
double R::fmax2(double x, double y)
double R::fmin2(double x, double y)
double R::sign(double x)
double R::fprec(double x, double dg)
double R::fround(double x, double dg)
double R::fsign(double x, double y)
double R::ftrunc(double x)
```
The probability distribution function is also described on the page [Probability distributions](21_dpqr_functions.md).
```cpp
double R::dnorm(double x, double mu, double sigma, int lg)
double R::pnorm(double x, double mu, double sigma, int lt, int lg)
double R::qnorm(double p, double mu, double sigma, int lt, int lg)
double R::rnorm(double mu, double sigma)
double R::dunif(double x, double a, double b, int lg)
double R::punif(double x, double a, double b, int lt, int lg)
double R::qunif(double p, double a, double b, int lt, int lg)
double R::runif(double a, double b)
double R::dgamma(double x, double shp, double scl, int lg)
double R::pgamma(double x, double alp, double scl, int lt, int lg)
double R::qgamma(double p, double alp, double scl, int lt, int lg)
double R::rgamma(double a, double scl)
double R::dbeta(double x, double a, double b, int lg)
double R::pbeta(double x, double p, double q, int lt, int lg)
double R::qbeta(double a, double p, double q, int lt, int lg)
double R::rbeta(double a, double b)
double R::dlnorm(double x, double ml, double sl, int lg)
double R::plnorm(double x, double ml, double sl, int lt, int lg)
double R::qlnorm(double p, double ml, double sl, int lt, int lg)
double R::rlnorm(double ml, double sl)
double R::dchisq(double x, double df, int lg)
double R::pchisq(double x, double df, int lt, int lg)
double R::qchisq(double p, double df, int lt, int lg)
double R::rchisq(double df)
double R::dnchisq(double x, double df, double ncp, int lg)
double R::pnchisq(double x, double df, double ncp, int lt, int lg)
double R::qnchisq(double p, double df, double ncp, int lt, int lg)
double R::rnchisq(double df, double lb)
double R::df(double x, double df1, double df2, int lg)
double R::pf(double x, double df1, double df2, int lt, int lg)
double R::qf(double p, double df1, double df2, int lt, int lg)
double R::rf(double df1, double df2)
double R::dt(double x, double n, int lg)
double R::pt(double x, double n, int lt, int lg)
double R::qt(double p, double n, int lt, int lg)
double R::rt(double n)
double R::dbinom(double x, double n, double p, int lg)
double R::pbinom(double x, double n, double p, int lt, int lg)
double R::qbinom(double p, double n, double m, int lt, int lg)
double R::rbinom(double n, double p)
double R::dcauchy(double x, double lc, double sl, int lg)
double R::pcauchy(double x, double lc, double sl, int lt, int lg)
double R::qcauchy(double p, double lc, double sl, int lt, int lg)
double R::rcauchy(double lc, double sl)
double R::dexp(double x, double sl, int lg)
double R::pexp(double x, double sl, int lt, int lg)
double R::qexp(double p, double sl, int lt, int lg)
double R::rexp(double sl)
double R::dgeom(double x, double p, int lg)
double R::pgeom(double x, double p, int lt, int lg)
double R::qgeom(double p, double pb, int lt, int lg)
double R::rgeom(double p)
double R::dhyper(double x, double r, double b, double n, int lg)
double R::phyper(double x, double r, double b, double n, int lt, int lg)
double R::qhyper(double p, double r, double b, double n, int lt, int lg)
double R::rhyper(double r, double b, double n)
double R::dnbinom(double x, double sz, double pb, int lg)
double R::pnbinom(double x, double sz, double pb, int lt, int lg)
double R::qnbinom(double p, double sz, double pb, int lt, int lg)
double R::rnbinom(double sz, double pb)
double R::dnbinom_mu(double x, double sz, double mu, int lg)
double R::pnbinom_mu(double x, double sz, double mu, int lt, int lg)
double R::qnbinom_mu(double x, double sz, double mu, int lt, int lg)
double R::rnbinom_mu(double sz, double mu)
double R::dpois(double x, double lb, int lg)
double R::ppois(double x, double lb, int lt, int lg)
double R::qpois(double p, double lb, int lt, int lg)
double R::rpois(double mu)
double R::dlogis(double x, double lc, double sl, int lg)
double R::plogis(double x, double lc, double sl, int lt, int lg)
double R::qlogis(double p, double lc, double sl, int lt, int lg)
double R::rlogis(double lc, double sl)
double R::dnbeta(double x, double a, double b, double ncp, int lg)
double R::pnbeta(double x, double a, double b, double ncp, int lt, int lg)
double R::qnbeta(double p, double a, double b, double ncp, int lt, int lg)
double R::rnbeta(double a, double b, double np)
double R::dnf(double x, double df1, double df2, double ncp, int lg)
double R::pnf(double x, double df1, double df2, double ncp, int lt, int lg)
double R::qnf(double p, double df1, double df2, double ncp, int lt, int lg)
double R::dnt(double x, double df, double ncp, int lg)
double R::pnt(double x, double df, double ncp, int lt, int lg)
double R::qnt(double p, double df, double ncp, int lt, int lg)
double R::dweibull(double x, double sh, double sl, int lg)
double R::pweibull(double x, double sh, double sl, int lt, int lg)
double R::qweibull(double p, double sh, double sl, int lt, int lg)
double R::rweibull(double sh, double sl)
```