@@ -57,6 +57,28 @@ inline return_type_t<T_x, T_alpha, T_beta> multinomial_logit_glm_lpmf(
5757 std::forward<T_alpha>(alpha), std::forward<T_beta>(beta));
5858}
5959
60+ /* * \ingroup opencl
61+ * Returns the log PMF of the Generalized Linear Model (GLM)
62+ * with multinomial distribution and softmax (logit) link function.
63+ * This is an OpenCL overload of
64+ * `prim/prob/multinomial_logit_glm_lpmf.hpp`.
65+ * Alpha can be either a shared 1×K row vector or an N×K per-instance matrix.
66+ * @tparam T_y expression of the outcome count matrix (N×K kernel expression)
67+ * @tparam T_x expression of the design matrix (N×M kernel expression)
68+ * @tparam T_alpha expression of the intercept (1×K or N×K kernel expression)
69+ * @tparam T_beta expression of the weight matrix (M×K kernel expression)
70+ * @param y outcome count matrix. Each row is of length-K non-negative
71+ * integer counts for instance n
72+ * @param x design matrix (N×M) on OpenCL device
73+ * @param alpha intercept: 1×K broadcast row or N×K per-instance matrix
74+ * @param beta weight matrix (M×K) on OpenCL device
75+ * @return log sum of multinomial log PMFs over all N instances
76+ * @throw std::domain_error if any element of x or beta is infinite or NaN,
77+ * or if alpha contains `+inf` or NaN (`-inf` forces the corresponding softmax
78+ * probability to zero and is allowed)
79+ * @throw std::domain_error if any count in y is negative
80+ * @throw std::invalid_argument if container sizes mismatch
81+ */
6082template <bool propto = false , typename T_y, typename T_x, typename T_alpha,
6183 typename T_beta,
6284 require_all_prim_or_rev_kernel_expression_t <T_y, T_x, T_alpha,
0 commit comments