logis: The logistic transform

Description Usage Arguments Value Examples

View source: R/logis.R

Description

Create a matrix YY binding array Y with a vector of ones, placed as the first column of YY. It applies the logistic transform componentwise to the standard matrix multiplication between YY and param.

Usage

1
logis(Y,param)

Arguments

Y

A generic matrix or one dimensional array

param

Vector of coefficients, whose length is NCOL(Y) + 1 (to consider also an intercept term)

Value

Return a vector whose length is NROW(Y) and whose i-th component is the logistic function at the scalar product between the i-th row of YY and the vector param.

Examples

1
2
3
4
n<-50 
Y<-sample(c(1,2,3),n,replace=TRUE) 
param<-c(0.2,0.7)
logis(Y,param)

CUB documentation built on March 31, 2020, 5:14 p.m.