#include <R.h>
#include <Rmath.h>
#include <Rdefines.h>
#include "internal.h"
Go to the source code of this file.
◆ ExpitTransform()
SEXP ExpitTransform |
( |
SEXP |
X | ) |
|
Definition at line 26 of file transformations.c.
26 {
27 double *x;
28 int k, n;
29 PROTECT(
X = duplicate(AS_NUMERIC(
X)));
32 for (k = 0; k < n; k++, x++)
33 *x = 1.0/(1.0+exp(-(*x)));
34 UNPROTECT(1);
36}
◆ InverseLogBarycentricTransform()
SEXP InverseLogBarycentricTransform |
( |
SEXP |
Y | ) |
|
Definition at line 47 of file transformations.c.
47 {
49 PROTECT(
Y = AS_NUMERIC(
Y));
50 PROTECT(
X = NEW_NUMERIC(LENGTH(
Y)));
52 UNPROTECT(2);
54}
static R_INLINE void from_log_barycentric(double *xt, const double *x, int n)
◆ LogBarycentricTransform()
SEXP LogBarycentricTransform |
( |
SEXP |
X | ) |
|
Definition at line 38 of file transformations.c.
38 {
40 PROTECT(
X = AS_NUMERIC(
X));
41 PROTECT(
Y = NEW_NUMERIC(LENGTH(
X)));
43 UNPROTECT(2);
45}
static R_INLINE void to_log_barycentric(double *xt, const double *x, int n)
◆ LogitTransform()
SEXP LogitTransform |
( |
SEXP |
P | ) |
|
Definition at line 14 of file transformations.c.
14 {
15 double *p;
16 int k, n;
17 PROTECT(P = duplicate(AS_NUMERIC(P)));
18 p = REAL(P);
19 n = LENGTH(P);
20 for (k = 0; k < n; k++, p++)
22 UNPROTECT(1);
23 return P;
24}
static R_INLINE double logit(double p)