One way to create this function in MATLAB is by defining it as an anonymous function with the inputs $\rho$, $\kappa$, $\theta$, and $\sigma$, and the constants $b_{it}$, $p_k$, $c_{ik}$, $\lambda_i$, and $\tau_{ik}$.
Here's an example code snippet:
main.m579 chars14 lines
Note that you may need to adjust this code depending on the specific form of $p_k$ and the values of the constants.
gistlibby LogSnag