x <- tf_rgp(3)
layout(t(1:3))
plot(x, col = 1:3)
# each function's values to [0,1]:
x_clamp <- (x - tf_fmin(x)) / (tf_fmax(x) - tf_fmin(x))
plot(x_clamp, col = 1:3)
# standardize each function to have mean / integral 0 and sd 1:
x_std <- (x - tf_fmean(x)) / tf_fsd(x)
tf_fvar(x_std) == c(1, 1, 1)
plot(x_std, col = 1:3)
# Custom functions:
# 80%tiles of each function's values:
tf_fwise(x, ~ quantile(.x$value, .8)) |> unlist()
# minimal value of each function for t >.5
tf_fwise(x, ~ min(.x$value[.x$arg > .5])) |> unlist()
tf_crosscor(x, -x)
tf_crosscov(x, x) == tf_fvar(x)
Run the code above in your browser using DataLab