test_that("initialise_parameters function calculates expected result", {
# Run tests
expect_equal(with_seed( initialise_parameters( data, 2, 3), seed=555),
list(n_samples = 4L, n_visible = 5L,
alpha = structure(c(0.68537637940608, 0.941285585868172, 0.846372533589602,
0.768671284778975, 0.822967653512023, 0.518435457954183,
0.985264301300049, 0.602565649314784, 0.518772968323901,
0.923364789807238), .Dim = c(2L, 5L)),
p_y_given_x_3d = structure(c(0.388687904506141, 0.256188378541972, 0.242420277433569,
0.405190881616297, 0.286561950318234, 0.233236150924278,
0.404562486949248, 0.365643911697397, 0.274321764596747,
0.418819124471162, 0.268309656323452, 0.360271015908094,
0.452195864617176, 0.306200068303793, 0.234577972377384,
0.368175269360559, 0.336990330897112, 0.324992496986866,
0.489270066242979, 0.23453810247561, 0.26124218506459,
0.460563780771929, 0.360859540673368, 0.266180818942043),
.Dim = c(2L, 4L, 3L)),
log_z = structure(c(1.44204437946298, 1.45203719021524, 1.4825121887298,
1.45814431315314, 1.46191592957143, 1.4715081058887,
1.45806093228679, 1.44295698249135), .Dim = c(2L, 4L))))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.