tanh_transform

Function tanh_transform 

Source
pub fn tanh_transform<T>(data: &[T]) -> Vec<f64>
where T: Num + NumCast + Copy,
Expand description

Applies the hyperbolic tangent transformation to a numeric data series.

This is a sigmoid family transform, so it will produce an S curve squashing values into the bounded range of (-1, 1) preserving the sign and relative magnitude which can be useful for dampening tails and emphasizing variations near zero.

ยงExample

use quant_mathema::transforms::tanh_transform;

let data = vec![1.0, 2.0, 10.0, 100.0];
let data_log_trans = tanh_transform(&data);