Description Usage Arguments Details Value Examples
Evaluate expression from Stan program
1 | evaluate.expression(stan.expression, ...)
|
stan.expression |
String representing Stan expression. All variables must be passed in ... . |
... |
Any variables present in the parent environment that are needed to evaluate stan.expression |
First, all variables specified in ... are loaded into the function environment. Then, all multipliction is replaced by
The result of the Stan expression
1 2 3 4 5 6 7 8 9 10 11 12 | X <- matrix(1:9, nrow = 3)
b <- c(4, 5, 6)
stan.expression <- "(3 + 2) * X * (5 * b)"
# These results match:
evaluate.expression(stan.expression)
print((3 + 2) * X %*% (5 * b))
# [,1]
# [1,] 1650
# [2,] 2025
# [3,] 2400
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.