Description Usage Arguments Value Examples
View source: R/utility_functions.R
A function that, given a vector of probabilities that sum to one,
will determine the closest values that could be passed to the
softmax function to produce those probabilities using the
optim
function.
1 | reverseSoftmax(y, init = NULL, restrict = NULL)
|
y |
a vector of probabilities (positive, sum to 1). |
init |
the starting values for the optim function. If empty, generates random values from a normal distribution. |
restrict |
a logical vector indicating whether certain values of x should be fixed to 0. |
The output from the optim function.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.