Description Usage Arguments Details Examples
This function is used to specify a divergence function beyond the three already implemented ones.
1 | add_divergence(name, divergence)
|
name |
A character string with the name of the divergence. |
divergence |
A function with arguments (pre_change_mean, pre_change_sd, post_change_mean, post_change_sd), that returns the measured divergence. |
After calling this function, your implemented divergence function can used in
tpca
by the argument divergence = name
.
1 2 3 4 5 | simple_divergence <- function(mu1, sigma1, mu2, sigma2) {
(mu2 - mu1)^2 + sigma2^2 / sigma1^2
}
add_divergence('simple', simple_divergence)
tpca(generate_cov_mat(10), divergence = 'simple')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.