Stan Math Library
5.0.0
Automatic Differentiation
|
return_type_t< T_theta, T_lam > stan::math::log_mix | ( | const T_theta & | theta, |
const T_lam & | lambda | ||
) |
Return the log mixture density with specified mixing proportions and log densities.
\[ \frac{\partial }{\partial p_x} \log\left(\exp^{\log\left(p_1\right)+d_1}+\cdot\cdot\cdot+ \exp^{\log\left(p_n\right)+d_n}\right) =\frac{e^{d_x}}{e^{d_1}p_1+\cdot\cdot\cdot+e^{d_m}p_m} \]
\[ \frac{\partial }{\partial d_x} \log\left(\exp^{\log\left(p_1\right)+d_1}+\cdot\cdot\cdot+ \exp^{\log\left(p_n\right)+d_n}\right) =\frac{e^{d_x}p_x}{e^{d_1}p_1+\cdot\cdot\cdot+e^{d_m}p_m} \]
T_theta | Type of theta. This can be a scalar, std vector or row/column vector. |
T_lam | Type of lambda. This can be a scalar, std vector or row/column vector. |
theta | std/row/col vector of mixing proportions in [0, 1]. |
lambda | std/row/col vector of log densities. |
Definition at line 77 of file log_mix.hpp.