latex-econ-model について
経済学者向けのLaTeXモデリング・組版スキルで、経済モデルの形式化や理論パートの構成を支援します。効用最大化、均衡条件、動的計画法、ゲーム理論を扱います。
主な機能
- 01経済学の標準的な記法
- 02モデルの環境と制約の構成
- 03均衡条件と解の記述
- 04最適化問題と数式の組版
- 05学術的な組版慣例への準拠
活用シーン
- 01論文の理論パートの執筆
- 02経済モデルの形式化
- 03数式を含む講義ノートの作成
- 04最適化問題と均衡条件の組版
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ meleantonio/ awesome-econ-ai-stuff --skill latex-econ-modelインストール後、Claude Code で/latex-econ-modelを入力して読み込まれたか確認します。
同梱ファイルindex.md
詳細
LaTeX 経済モデル作成者
目的
このスキルは、経済学者が適切な数学的表記、一貫した書式、学術的な慣習に従って、経済モデルを LaTeX で作成・組版するのに役立ちます。効用最大化、均衡条件、動的計画法、ゲーム理論モデルを扱います。
使用するタイミング
- 論文の理論セクションを執筆するとき
- 経済モデルを形式化するとき
- 数式を含む講義ノートを作成するとき
- 最適化問題や均衡条件を組版するとき
手順
ステップ 1:モデルの種類を把握する
ユーザーに次の質問をします。
- どの種類のモデルですか?(静学的最適化、動的計画法、ゲーム理論、一般均衡)
- エージェントの種類は何ですか?(消費者、企業、政府など)
- どのような制約がありますか?
- 証明も含めますか、それとも設定のみですか?
ステップ 2:標準的な表記法を使用する
経済学の慣習に従います。
- 効用:$U$、$u$、または $v$
- 生産:$F$、$f$、または $Y$
- 価格:$p$、$w$、$r$
- 数量:$q$、$x$、$y$
- 時間の添字:$t$、$t+1$
- パラメーターにはギリシャ文字:$\alpha$、$\beta$、$\gamma$、$\delta$
ステップ 3:モデルを構成する
次のように整理します。
- 環境 - エージェント、財、時間範囲
- 選好/技術 - 効用関数、生産関数
- 制約 - 予算、資源、インセンティブ適合性
- 均衡概念 - 定義と条件
- 解 - 一階条件、閉形式解
出力例
\documentclass{article}
\usepackage{amsmath, amssymb, amsthm}
\usepackage{mathtools}
% Theorem environments
\newtheorem{definition}{Definition}
\newtheorem{proposition}{Proposition}
\newtheorem{lemma}{Lemma}
% Custom commands for economics
\newcommand{\E}{\mathbb{E}} % Expectation
\newcommand{\R}{\mathbb{R}} % Real numbers
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} % Partial derivative
\begin{document}
\section{A Simple Consumer Problem}
\subsection{Environment}
Consider a consumer who lives for two periods, $t \in \{1, 2\}$. The consumer has preferences over consumption $c_t$ represented by the utility function:
%
\begin{equation}
U(c_1, c_2) = u(c_1) + \beta u(c_2)
\end{equation}
%
where $\beta \in (0,1)$ is the discount factor and $u(\cdot)$ is strictly increasing and strictly concave.
\subsection{Constraints}
The consumer earns income $y_1$ in period 1 and $y_2$ in period 2. She can save at gross interest rate $R = 1 + r$. The budget constraints are:
%
\begin{align}
c_1 + s &= y_1 \label{eq:bc1}\\
c_2 &= y_2 + Rs \label{eq:bc2}
\end{align}
%
where $s$ denotes savings. Combining \eqref{eq:bc1} and \eqref{eq:bc2} yields the intertemporal budget constraint:
%
\begin{equation}
c_1 + \frac{c_2}{R} = y_1 + \frac{y_2}{R} \equiv W
\end{equation}
\subsection{Optimization Problem}
The consumer solves:
%
\begin{equation}
\max_{c_1, c_2} \quad u(c_1) + \beta u(c_2)
\quad \text{s.t.} \quad c_1 + \frac{c_2}{R} = W
\end{equation}
\subsection{Solution}
The Lagrangian is:
%
\begin{equation}
\mathcal{L} = u(c_1) + \beta u(c_2) + \lambda\left(W - c_1 - \frac{c_2}{R}\right)
\end{equation}
First-order conditions:
%
\begin{align}
\pd{\mathcal{L}}{c_1} &= u'(c_1) - \lambda = 0 \\
\pd{\mathcal{L}}{c_2} &= \beta u'(c_2) - \frac{\lambda}{R} = 0
\end{align}
Combining these yields the \textbf{Euler equation}:
%
\begin{equation}
\boxed{u'(c_1) = \beta R \cdot u'(c_2)}
\end{equation}
\begin{proposition}[Consumption Smoothing]
If $\beta R = 1$, then $c_1^* = c_2^*$ (perfect consumption smoothing).
\end{proposition}
\begin{proof}
When $\beta R = 1$, the Euler equation becomes $u'(c_1) = u'(c_2)$. Since $u$ is strictly concave, $u'$ is strictly decreasing, which implies $c_1 = c_2$.
\end{proof}
%====================================
\section{A Firm's Dynamic Problem}
%====================================
Consider a firm that maximizes the present value of profits:
%
\begin{equation}
\max_{\{k_{t+1}, n_t\}_{t=0}^{\infty}} \sum_{t=0}^{\infty} \beta^t \left[ F(k_t, n_t) - w_t n_t - I_t \right]
\end{equation}
%
subject to the capital accumulation equation:
%
\begin{equation}
k_{t+1} = (1 - \delta) k_t + I_t
\end{equation}
The Bellman equation is:
%
\begin{equation}
V(k) = \max_{k', n} \left\{ F(k, n) - wn - k' + (1-\delta)k + \beta V(k') \right\}
\end{equation}
\end{document}
含める LaTeX パッケージ
% Essential packages for economics papers
\usepackage{amsmath} % Enhanced math environments
\usepackage{amssymb} % Mathematical symbols
\usepackage{amsthm} % Theorem environments
\usepackage{mathtools} % Extensions to amsmath
\usepackage{bm} % Bold math symbols
\usepackage{dsfont} % \mathds for indicator functions
便利なカスタムコマンド
% Expectation and probability
\newcommand{\E}{\mathbb{E}}
\newcommand{\Var}{\text{Var}}
\newcommand{\Cov}{\text{Cov}}
\newcommand{\Prob}{\mathbb{P}}
% Indicator function
\newcommand{\ind}{\mathds{1}}
% Partial derivatives
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}}
% Argmax/argmin
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
% Blackboard bold
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
ベストプラクティス
- 複数行の数式には
align環境を使用します - 重要な数式には
\label{}でラベルを付け、\eqref{}で参照します - 数式内の単語には
\text{}を使用します(裸のテキストは使いません) - 重要な結果は
\boxed{}で囲みます - 繰り返し使う表記にはカスタムコマンドを定義します
- 添字の慣習(時間には $t$、個人には $i$)を統一します
よくある落とし穴
- ❌ 乗算に
*を使う(\cdotまたは暗黙の乗算を使います) - ❌ 括弧のサイズを自動調整する
\left(と\right)を忘れる - ❌ 論文内で表記が一貫していない
- ❌ 数式の
=の位置を揃えていない - ❌ 適切な環境の代わりに
$$ ... $$を使う
参考資料
- AMS-LaTeX ユーザーガイド
- LaTeX の短くない入門書
- Mathpix - 手書きの数式を LaTeX に変換
変更履歴
v1.0.0
- 消費者、企業、ゲーム理論のテンプレートを含む初回リリース
コメント
Markdown 対応