inv.logit.mat: Inverse logit for matrices

Description Usage Arguments Examples

View source: R/helper_functions.R

Description

Apply the inverse logit function to a matrix, element-wise. It generalizes the inv.logit function from the gtools library to matrices

Usage

1
inv.logit.mat(x, min = 0, max = 1)

Arguments

x

matrix

min

Lower end of logit interval

max

Upper end of logit interval

Examples

1
2
(mat = matrix(rnorm(10 * 5), nrow = 10, ncol = 5))
inv.logit.mat(mat)

Example output

            [,1]       [,2]        [,3]        [,4]       [,5]
 [1,] -0.5153974 -1.0068626 -2.26412510 -1.06127663 -1.1811490
 [2,]  0.1551598  1.1307165  0.93095656  0.01736056 -0.2826905
 [3,]  0.3269701  0.4890665  1.04705236  0.55507406  0.9231282
 [4,]  0.2000674 -0.6597388  0.58309363 -1.69744958  1.3000309
 [5,] -0.9189839 -0.6045833 -0.64144876  1.03788359 -0.4179665
 [6,]  1.2911436  0.2451001  0.34322390 -1.64433026  2.2846013
 [7,] -1.0131266 -2.1661930 -0.99378557 -1.43274328 -2.2760155
 [8,]  0.8004989  0.7139791  0.02495324 -0.07011612  1.1524563
 [9,]  0.2627893 -0.1965272 -0.99495354  0.29697401  0.9173110
[10,] -0.2220084  0.7736911  1.12797250  1.84556942  0.7011578
           [,1]      [,2]       [,3]      [,4]       [,5]
 [1,] 0.3739291 0.2675943 0.09413801 0.2570656 0.23484567
 [2,] 0.5387123 0.7559711 0.71726931 0.5043400 0.42979429
 [3,] 0.5810220 0.6198865 0.74020847 0.6353120 0.71567907
 [4,] 0.5498507 0.3407983 0.64177894 0.1547987 0.78584018
 [5,] 0.2851650 0.3532958 0.34491912 0.7384414 0.39700346
 [6,] 0.7843407 0.5609701 0.58497343 0.1618767 0.90759367
 [7,] 0.2663684 0.1028277 0.27016500 0.1926716 0.09312892
 [8,] 0.6900812 0.6712798 0.50623799 0.4824781 0.75995929
 [9,] 0.5653218 0.4510257 0.26993477 0.5737026 0.71449388
[10,] 0.4447248 0.6843188 0.75546454 0.8636061 0.66844441

logisticPCA documentation built on May 1, 2019, 10:12 p.m.