Peter Ralph
1 December 2020 – Advanced Biological Statistics
To simulate from: \[\begin{aligned} \mu_i &= b_0 + b_1 X_{i1} + \cdots + b_k X_{ik} \\ Y_i &\sim \Normal(\mu_i, \sigma) . \end{aligned}\]
either
To simulate from: \[\begin{aligned} \mu_i &= b_0 + b_1 X_{i1} + \cdots + b_k X_{i1} \\ Y_i &\sim \Normal(\mu_i, \sigma) . \end{aligned}\]
of
In R, %*%
is matrix multiplication: if
then X %*% b
(or, \(X b\) in math notation) is shorthand for the \(n\)-vector \[ (Xb)_i = \sum_{j=1}^k X_{ij} b_j . \]
In Stan, matrix multiplication is *
.