what is derivative of $\exp(X\beta)$ w.r.t $\beta$ I am using the Denominator layout, i.e. $$\frac{\partial X\beta}{\partial \beta} = X^T,$$ where $X$ is $n\times p$ and $\beta$ is $p\times 1$.
What is the result of
$$\frac{\partial \exp(X\beta)}{\partial \beta} \text{ ?}$$
Since $\exp(X\beta)$ is $n\times1$ and $\beta$ is $p\times 1$, the derivative should be a $p\times n$ matrix. However, this is what I derived:
$$\frac{\partial \exp(X\beta)}{\partial \beta} = \frac{\partial X\beta}{\partial \beta}\frac{\partial \exp(X\beta)}{\partial X\beta} = X^T\exp(X\beta),$$
which is a $p\times1$. Where did I make a mistake?

For typing convenience, define the vectors
$$\eqalign{
y &= X\beta \quad&\implies\quad &dy = X\,d\beta \\
e &= \exp(y) \quad&\implies\quad &E = {\rm Diag}(e) \\
}$$
The differential of an elementwise function requires an elementwise/Hadamard product, which can be replaced by the standard product with a diagonal matrix.
$$\eqalign{
de &= e\odot dy = E\,dy \\
}$$
Substitute $dy\,$ to obtain
$$\eqalign{
de &= EX\,d\beta \\
\frac{\partial e}{\partial\beta} &= EX \\
}$$
Or in your preferred layout convention $\,X^TE^T$
$$\eqalign{
}$$
