Currently dualr stores scalar values and derivatives. For applications in multivariate statistics (e.g., matrix normal likelihoods, covariance estimation), it would be useful to support matrix-valued duals where both value and deriv slots hold matrices.
This would enable automatic differentiation through matrix operations like solve(), det(), chol(), and %*%.
Considerations:
- The
ANY slot typing already permits this in principle, but none of the arithmetic or math methods handle matrix operands
- Would need matrix chain rule implementations
- May require a separate
dual_matrix class for clean dispatch
Currently
dualrstores scalar values and derivatives. For applications in multivariate statistics (e.g., matrix normal likelihoods, covariance estimation), it would be useful to support matrix-valued duals where bothvalueandderivslots hold matrices.This would enable automatic differentiation through matrix operations like
solve(),det(),chol(), and%*%.Considerations:
ANYslot typing already permits this in principle, but none of the arithmetic or math methods handle matrix operandsdual_matrixclass for clean dispatch