SoftMax: Take softmax of a vector of values. Input are reals and...

View source: R/aux.R

SoftMaxR Documentation

Take softmax of a vector of values. Input are reals and output will be a vector of probabilities.

Description

Take softmax of a vector of values. Input are reals and output will be a vector of probabilities.

Usage

SoftMax(x, return.log = TRUE, logfn = log)

Arguments

x

Vector of real numbers, can be negative or positive

return.log

Return the log of the probabilities

logfn

function for logarithm. Default natural log. Can also use log2.

Value

plog vector of probabilities

Examples

p.mat <- SoftMax(jfit$ll.mat)  # convert a vector of log-likelihoods into a vector of probabilities

jakeyeung/scChIX documentation built on May 7, 2023, 9:14 a.m.