This function is for internal use only.
check_initial(initial, nchains)
Either a vector or matrix,.
Integer scalar. Number of chains.
A named matrix.
When initial
is a vector, the values are recycled to form a matrix of
size nchains * length(initial)
.
init <- c(.4, .1)
check_initial(init, 1)
#> par1 par2
#> [1,] 0.4 0.1
check_initial(init, 2)
#> Warning: While using multiple chains, a single initial point has been passed via `initial`: c(0.4, 0.1). The values will be recycled. Ideally you would want to start each chain from different locations.
#> par1 par2
#> [1,] 0.4 0.1
#> [2,] 0.4 0.1
init <- matrix(1:9, ncol=3)
check_initial(init, 3)
#> par1 par2 par3
#> [1,] 1 4 7
#> [2,] 2 5 8
#> [3,] 3 6 9
# check_initial(init, 2) # Returns an error