| getSurprisal_vector | R Documentation |
Internal soundgen function called by getSurprisal.
Estimates the unexpectedness or "surprisal" of the last element of input
vector.
getSurprisal_vector(x, method = c("acf", "np")[1], best_lag = NULL)
x |
numeric vector representing the time sequence of interest, eg amplitudes in a frequency bin over multiple STFT frames |
method |
acf = change in maximum autocorrelation after adding the final
point, np = nonlinear prediction (see |
best_lag |
(only for method = 'acf') if specified, we don't calculate the ACF but simply compare autocorrelation at best_lag with vs without the final point |
x = c(rep(1, 3), rep(0, 4), rep(1, 3), rep(0, 4), rep(1, 3), 0, 0)
soundgen:::getSurprisal_vector(x)
soundgen:::getSurprisal_vector(c(x, 1))
soundgen:::getSurprisal_vector(c(x, 13))
soundgen:::getSurprisal_vector(x, method = 'np')
soundgen:::getSurprisal_vector(c(x, 1), method = 'np')
soundgen:::getSurprisal_vector(c(x, 13), method = 'np')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.