matrix-calculus

Compute matrix derivatives and differentials using the Magnus framework.

16|1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/aresbit/matrix-calculus --skill matrix-calculus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matrix-calculus
Source: https://github.com/aresbit/matrix-calculus/tree/main
Command: npx skills add https://github.com/aresbit/matrix-calculus --skill matrix-calculus

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Matrix calculus tutorials and references that help you understand and apply derivatives, differentials, and Hessians for matrix-valued functions in optimization, statistics, and econometrics.

Core Features & Use Cases

  • Comprehensive coverage of two pillars: the correct matrix derivative definition and the differential concept.
  • Six core tools: trace, linear/quadratic forms, Kronecker product, vec operator, commutation matrix, and duplication matrix.
  • Includes worked examples and guidance for both unconstrained and constrained optimization with matrices, plus practical applications in statistics and econometrics.

Quick Start

Apply the first differential to a simple matrix function and identify the gradient to obtain the optimizer.

Frequently Asked Questions about matrix-calculus

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compute matrix derivatives for optimization?

Matrix derivatives are computed using the Magnus framework, which defines the correct derivative and applies the differential concept to handle matrix-valued functions for optimization and sensitivity analysis.

What is the differential concept in matrix calculus?

The differential concept applies the first differential to a matrix function to identify the gradient, covering the trace, linear and quadratic forms, Kronecker product, and vec operator to obtain the optimizer.

How do I calculate Hessians and use the vec operator for econometrics?

Hessians and the vec operator are calculated using six core tools including the commutation matrix and duplication matrix, applying practical rules for unconstrained and constrained optimization in statistics and econometrics.

Does this cover constrained optimization with Kronecker products?

Yes, constrained optimization with Kronecker products is covered through worked examples and practical guidance, applying the differential and specific matrix rules to handle constraints effectively.

When do I need the commutation matrix and duplication matrix?

The commutation matrix and duplication matrix are needed when working with complex matrix transformations in optimization, serving as two of the six core tools for applying the correct matrix derivative definition.

What's the best way to start applying matrix calculus rules?

The best way to start is by applying the first differential to a simple matrix function and identifying the gradient to obtain the optimizer, using the comprehensive coverage of the Magnus framework rules.