Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

threshold

Threshold a matrix/vector below and above


Description

threshold sets values of a vector/matrix below min to min; values above max are set to max.

threshold is mainly used to project sparsified weight vectors (sparsify_weights) back onto the probability simplex (thus min = 0 and then normalize).

Usage

threshold(x, min = -Inf, max = Inf)

Arguments

x

a numeric matrix(like object)

min

minimum value

max

maximum value

See Also

Examples

print(threshold(c(1, 4, 2, -1, 10), min = 0))

LICORS

Light Cone Reconstruction of States - Predictive State Estimation From Spatio-Temporal Data

v0.2.0
GPL-2
Authors
Georg M. Goerg <gmg@stat.cmu.edu>
Initial release
2013-11-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.