聚集环境中的多个方程、导数

聚集环境中的多个方程、导数

我对使用 latex 输入数学方程式感到非常沮丧。现在我注意到错误“!LaTeX 错误:错误的数学环境分隔符。”和错误 with\gather。

 \documentclass{article}
 \usepackage{amsmath}
 \usepackage{mathtools}
 \begin{document}
 \begin{gather}
\intertext{The Household Problem:}
  V(k_e,k_s;s,z,q)=\max_{c_t,l_t,h_t,k_e^(t+1),k_s^(t+1)}\{U(c_t,l_t)+\beta 
  E\[V(k_e^(t+1),k_s^(t+1;s^(t+1),z^(t+1),q^(t+1))\] \\
\shortintertext{subject to}
\begin{split}
 c+k_e^(t+1)/q+k_s^(t+1)&=(1-\tau_k)[R_e(\lambda)hk_e+R_S(\lambda)k_s]\\
 &+(1-\tau_l)W(\lambda)l+(1-\delta_e(h))k_e/q+(1-\delta_s)k_s+T_(\lambda)\\
 & -A_s(k_s^(t+1),k_s)-A_e(k_e^(t+1)/q,k_e/q;\eta),
\end{split}
\intertext{and s^(t+1)=S(\delta)}
\intertext{Form a period t+1 value Lagrangian:}
\begin{split}
\mathcal{L} & =E_0\sum\limits_{t=0}^\infty \beta^t U(c_t,l_t)+\Lambda_t\{(1-
\tau_k^t)(r_e^t h k_e^t +r_s^tk_s^t) \\
 & +(1-\tau_l^t)W(\lambda)l+(1-\delta_e(h))k_e/q+(1-
 \delta_s)k_s+T_(\lambda)\\
 & -A_s(k_s^(t+1),k_s)-A_e(k_e^(t+1)/q,k_e/q;\eta)-c_t -k_e^(t+1)/q -
k_s^(t+1)\}\\
\end{split}
\intertext{First Order Conditions Of Household:}
\frac{\partial\mathcal{L}_(t+1)}{c_t} = \beta\theta\frac{1}{c_t}=\Lambda_t\\
\frac{\partial\mathcal{L}_(t+1)}{l_t} =\frac{\beta(1-\theta)}{l_t-
1}=\Lambda_t    
\tau_l^tw_t(\lambda)\\
\frac{\partial\mathcal{L}_(t+1)}{k_s^(t+1)} =2\phi_s k_s^t+1-2(k_s^t)^2-
k_s^t=0\\
\frac{\partial\mathcal{L}_(t+1)}{k_e^(t+1)} =2e^\eta\phi_tk_e^t+1-2\kappa_e 
k_e^t-k_e^tq=0\\
\frac{\partial\mathcal{L}_(t+1)}{h_t} =\r_e^t=\frac{1}{q(1-\tau_k^t)} 
bh^\omega-1\\
k_e^{t+1}=(1-\delta_s)k_s^t+i_s^t,\quad  0<\delta_s<1\\
\intertext{Dynamic Budget Constraints:}
\begin{split}
c_t &= k_e^{(t+1)}\frac{1}{q}+k_s^{(t+1)}+(1-\tau_k^t)(r_ehk_e+r_sk_s)+(1-
 \tau_l)wl \\
&\quad+ (1-\lambda_e(h))k_e/q+(1-\lambda_s)k_s+T(\lambda)\\
&\quad- A_s(k_s^{(t+1)},k_s)-A_e(k_e^{(t+1)}/q,k_e/q;\eta)
\end{split}
 \\Transversality\quad Condition
\intertext{First Order Conditions Of Firms:}
\shortintertext{F.O.C with respect to k_e:}r_e=\alpha_e z h^{(\alpha_e-1)} 
 k_e^{(\alpha_e-1)}k_s^{\alpha_s}l^{(1-\alpha_e-\alpha_s)}\\
 \shortintertext{F.O.C with respect to k_s:}r_s=\alpha_s z h^{(\alpha_e)} 
 k_e^{\alpha_e} k_s^{(\alpha_s-1)}l^{(1-\alpha_e-\alpha_s)}\\
 \shortintertext{F.O.C with respect to l:}w=(1-\alpha_e-\alpha_s)z 
  h^{\alpha_e}k_e^{\alpha_e}k_s^{\alpha_s}\\
  \shortintertext{F.O.C with respect to h:}r_e\widetilde{k_e}=\alpha_e z 
 h^{(\alpha_e-1)}k_e^{\alpha_e} k_s^{\alpha_s} l^{(1-\alpha_e-\alpha_s)}\\
  \ln{z_{(t+1)}}=(1 
 \rho_a)\ln{\overline{z}}+\rho_a\ln{z_t}+\varepsilon_{(a,t)}\\
  \intertext{Government:}
  \tau=\tau_k(r_e h k_e +r_s k_s)+\tau_e wl
   \end{gather}
   \end{document}

我花了大约一个小时,但还是没搞明白,所以来这里问问题。我真诚地感谢你的帮助!

答案1

在此处输入图片描述

您是如何输入这些代码的?几乎每一行都有 tex 错误,文本中嵌套的数学表达式周围存在虚假\]不匹配}和缺失。$

gather调试像或这样的大比对很困难align,因为错误是在最后报告的,但如果您一次添加一行表达式并按照报告的那样修复每个错误,您就不会陷入这样的境地。

 \documentclass{article}
 \usepackage{amsmath}
 \usepackage{mathtools}
 \begin{document}
 \begin{gather}
\intertext{The Household Problem:}
  V(k_e,k_s;s,z,q)=\max_{c_t,l_t,h_t,k_e^{t+1},k_s^{t+1}}
  U(c_t,l_t)+\beta 
  E[V(k_e^{t+1},k_s^(t+1;s^{t+1},z^{t+1},q^{t+1})]\\
\shortintertext{subject to}
\begin{split}
 c+k_e^{t+1}/q+k_s^{t+1}&=(1-\tau_k)[R_e(\lambda)hk_e+R_S(\lambda)k_s]\\
 &+(1-\tau_l)W(\lambda)l+(1-\delta_e(h))k_e/q+(1-\delta_s)k_s+T_{\lambda}\\
 & -A_s(k_s^{t+1},k_s)-A_e(k_e^{t+1}/q,k_e/q;\eta),
\end{split}\\
\intertext{and $s^{t+1}=S(\delta)$}
\intertext{Form a period $t+1$ value Lagrangian:}
\begin{split}
\mathcal{L} & =E_0\sum\limits_{t=0}^\infty \beta^t U(c_t,l_t)+\Lambda_t\{(1-
\tau_k^t)(r_e^t h k_e^t +r_s^tk_s^t) \\
 & +(1-\tau_l^t)W(\lambda)l+(1-\delta_e(h))k_e/q+(1-
 \delta_s)k_s+T_{\lambda}\\
 & -A_s(k_s^{t+1},k_s)-A_e(k_e^{t+1}/q,k_e/q;\eta)-c_t -k_e^{t+1}/q -
k_s^{t+1}\}\\
\end{split}\\
\intertext{First Order Conditions Of Household:}
\frac{\partial\mathcal{L}_{t+1}}{c_t} = \beta\theta\frac{1}{c_t}=\Lambda_t\\
\frac{\partial\mathcal{L}_{t+1}}{l_t} =\frac{\beta(1-\theta)}{l_t-
1}=\Lambda_t    
\tau_l^tw_t(\lambda)\\
\frac{\partial\mathcal{L}_{t+1}}{k_s^{t+1}} =2\phi_s k_s^t+1-2(k_s^t)^2-
k_s^t=0\\
\frac{\partial\mathcal{L}_{t+1}}{k_e^{t+1}} =2e^\eta\phi_tk_e^t+1-2\kappa_e 
k_e^t-k_e^tq=0\\
\frac{\partial\mathcal{L}_{t+1}}{h_t} =r_e^t=\frac{1}{q(1-\tau_k^t)} 
bh^\omega-1\\
k_e^{t+1}=(1-\delta_s)k_s^t+i_s^t,\quad  0<\delta_s<1\\
\intertext{Dynamic Budget Constraints:}
\begin{split}\\
c_t &= k_e^{(t+1)}\frac{1}{q}+k_s^{(t+1)}+(1-\tau_k^t)(r_ehk_e+r_sk_s)+(1-
 \tau_l)wl \\
&\quad+ (1-\lambda_e(h))k_e/q+(1-\lambda_s)k_s+T(\lambda)\\
&\quad- A_s(k_s^{(t+1)},k_s)-A_e(k_e^{(t+1)}/q,k_e/q;\eta)
\end{split}
\\Transversality\quad Condition
\intertext{First Order Conditions Of Firms:}
\shortintertext{F.O.C with respect to $k_e$:}
 r_e=\alpha_e z h^{(\alpha_e-1)} 
 k_e^{(\alpha_e-1)}k_s^{\alpha_s}l^{(1-\alpha_e-\alpha_s)}\\
 \shortintertext{F.O.C with respect to $k_s$:}
r_s=\alpha_s z h^{(\alpha_e)} 
 k_e^{\alpha_e} k_s^{(\alpha_s-1)}l^{(1-\alpha_e-\alpha_s)}\\
 \shortintertext{F.O.C with respect to l:}
w=(1-\alpha_e-\alpha_s)z 
  h^{\alpha_e}k_e^{\alpha_e}k_s^{\alpha_s}\\
  \shortintertext{F.O.C with respect to $h$:}
r_e\widetilde{k_e}=\alpha_e z 
 h^{(\alpha_e-1)}k_e^{\alpha_e} k_s^{\alpha_s} l^{(1-\alpha_e-\alpha_s)}\\
  \ln{z_{(t+1)}}=(1 
 \rho_a)\ln{\overline{z}}+\rho_a\ln{z_t}+\varepsilon_{(a,t)}\\
  \intertext{Government:}
  \tau=\tau_k(r_e h k_e +r_s k_s)+\tau_e wl\\
   \end{gather}
   \end{document}

答案2

我根本不会使用“互文”。

请注意指数应该是像^{t+1}而不是^(t+1)(下标类似)。也不\[是括号。

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

 \begin{document}

The Household Problem:
\begin{equation}
  V(k_e,k_s;s,z,q)=
  \max_{\substack{c_t,l_t,h_t,\\k_e^{t+1},k_s^{t+1}}}
  \{U(c_t,l_t)+\beta E[V(k_e^{t+1},k_s^{t+1};s^{t+1},z^{t+1},q^{t+1})]
\end{equation}
subject to
\begin{equation}
\begin{split}
 c+k_e^{t+1}/q+k_s^{t+1}&=(1-\tau_k)[R_e(\lambda)hk_e+R_S(\lambda)k_s]\\
 &+(1-\tau_l)W(\lambda)l+(1-\delta_e(h))k_e/q+(1-\delta_s)k_s+T(\lambda)\\
 & -A_s(k_s^{t+1},k_s)-A_e(k_e^{t+1}/q,k_e/q;\eta),\\
s^{t+1}&=S(\delta)
\end{split}
\end{equation}
Form a period $t+1$ value Lagrangian:
\begin{equation}
\begin{split}
\mathcal{L} & =E_0\sum\limits_{t=0}^\infty \beta^t U(c_t,l_t)+\Lambda_t\{(1-
\tau_k^t)(r_e^t h k_e^t +r_s^tk_s^t) \\
 & +(1-\tau_l^t)W(\lambda)l+(1-\delta_e(h))k_e/q+(1-
 \delta_s)k_s+T(\lambda)\\
 & -A_s(k_s^{t+1},k_s)-A_e(k_e^{t+1}/q,k_e/q;\eta)-c_t -k_e^{t+1}/q -
k_s^{t+1}
\end{split}
\end{equation}
First Order Conditions Of Household:
\begin{align}
\frac{\partial\mathcal{L}_{t+1}}{c_t} &= \beta\theta\frac{1}{c_t}=\Lambda_t\\
\frac{\partial\mathcal{L}_{t+1}}{l_t} &=\frac{\beta(1-\theta)}{l_t-1}=\Lambda_t    
  \tau_l^tw_t(\lambda)\\
\frac{\partial\mathcal{L}_{t+1}}{k_s^{t+1}} &=2\phi_s k_s^t+1-2(k_s^t)^2-
k_s^t=0\\
\frac{\partial\mathcal{L}_{t+1}}{k_e^{t+1}} &=2e^\eta\phi_tk_e^t+1-2\kappa_e 
k_e^t-k_e^tq=0\\
\frac{\partial\mathcal{L}_{t+1}}{h_t} &=r_e^t=\frac{1}{q(1-\tau_k^t)} 
bh^\omega-1\\
k_e^{t+1}&=(1-\delta_s)k_s^t+i_s^t,\quad  0<\delta_s<1
\end{align}
Dynamic Budget Constraints:
\begin{equation}
\begin{split}
c_t &= k_e^{(t+1)}\frac{1}{q}+k_s^{(t+1)}+(1-\tau_k^t)(r_ehk_e+r_sk_s)+(1-
 \tau_l)wl \\
&\quad+ (1-\lambda_e(h))k_e/q+(1-\lambda_s)k_s+T(\lambda)\\
&\quad- A_s(k_s^{(t+1)},k_s)-A_e(k_e^{(t+1)}/q,k_e/q;\eta)
\end{split}
\end{equation}
First Order Conditions Of Firms:
\begin{align}
r_e&=\alpha_e z h^{(\alpha_e-1)} 
  k_e^{(\alpha_e-1)}k_s^{\alpha_s}l^{(1-\alpha_e-\alpha_s)}
&&\text{(with respect to $k_e$)}\\
r_s&=\alpha_s z h^{(\alpha_e)} 
  k_e^{\alpha_e} k_s^{(\alpha_s-1)}l^{(1-\alpha_e-\alpha_s)}
&&\text{(with respect to $k_s$)}\\
w&=(1-\alpha_e-\alpha_s)z 
  h^{\alpha_e}k_e^{\alpha_e}k_s^{\alpha_s}
&&\text{(with respect to $l$)}\\
r_e\widetilde{k_e}&=\alpha_e z 
  h^{(\alpha_e-1)}k_e^{\alpha_e} k_s^{\alpha_s} l^{(1-\alpha_e-\alpha_s)}
&&\text{(with respect to $h$)}\\
\ln{z_{t+1}}&=(1-\rho_a)\ln{\overline{z}}+\rho_a\ln{z_t}+\varepsilon_{(a,t)}
\end{align}
Government:
\begin{equation}
\tau=\tau_k(r_e h k_e +r_s k_s)+\tau_e wl
\end{equation}

\end{document}

在此处输入图片描述

答案3

我只是尝试纠正前两个方程中的错误并改善它们的外观。在此我引入了新的环境\substack{...}并替换splitmultlined

\documentclass{article}
%\usepackage{amsmath}
\usepackage{mathtools}% also load amsmath

\begin{document}
\noindent
The Household Problem:
\begin{gather}
\begin{multlined}[0.8\linewidth]
V(k_e,k_s;s,z,q) = \max_{\substack{c_t,l_t,h_t,\\
                        k_e^{(t+1)},k_s^(t+1)}}
        \{U(c_t,l_t)\}          \\
        + \beta E\Bigl[V\bigl(k_e^{(t+1)},
                              k_s^{(t+1)};
                              s^{(t+1)},
                              z^{(t+1)},
                              q^{(t+1)}\bigr)\Bigr]
\end{multlined}
\shortintertext{subject to}
\begin{multlined}[0.8\linewidth]
c+k_e^{(t+1)}/q+k_s^{(t+1)}
    = (1-\tau_k)\bigl[R_e(\lambda)hk_e+R_S(\lambda)k_s\bigr]    \\
    +(1-\tau_l)W(\lambda)l+(1-\delta_e(h))k_e/q+(1-\delta_s)k_s+T_(\lambda)\\
    - A_s\bigl(k_s^{(t+1)},k_s)-A_e(k_e^{(t+1)}/q,k_e/q;\eta\bigr),
\end{multlined}
\intertext{and $s^{(t+1)}=S(\delta)$. Form a period $t+1$ value Lagrangian:}
\vdots
\end{gather}
\end{document}

所有剩余行都需要进行类似的错误清理。如果您对编写方程式的方法感兴趣,那么我把这个任务留给您了。

主要错误记录在大卫·卡莱尔回答。

在此处输入图片描述

相关内容