乳胶中缺少$插入错误

乳胶中缺少$插入错误

你好,我正在准备我的演讲,但我的乳胶代码有问题。

我确定我正在使用“amsmath”包。

我尝试修复这个问题,但仍然有很多错误。

\begin{frame}{ZIP regression models with covariates}
    \begin{itemize}
        \item Regression-type models can adjust for covariate effects and assess relationships between key predictors and the response
        \item Covariates enter ZIP regression model at both the Bernoulli zero-inflation and Poison count stages\\
        $\rar$ 2 sets of parameters corresponding to p and $\lambda$\\
        ~~~~~~~~ \(\begin{cases}
            \(\lambda\) : loglinear model \(\rar log(\frac{p}{1-p}) = \textbf{X_1\alpha} = \alpha_0 + \alpha_1X_{11} + \alpha_2X_{12} + \dots + \alpha_mX_{1m}\)\\
            p : logit model \(\rar log(\lambda) = \textbf{X_2\beta} = \beta_0 + \beta_1X_{21} + \beta_2X_{22} + \dots + \beta_lX_{2l}\)
            \end{cases}\)
       \vspace{0.2cm}
        \item \(\boldsymbol{X_1} = (1, X_{11}, X_{12}, \dots, X_{1m})\) : covariate vector included in the zero stage\\
       \(\boldsymbol{X_2} = (1, X_{21}, X_{22}, \dots, X_{2l})\) : covariate vector included in the Poisson stage
        \item \(\boldsymbol{\alpha} = (\alpha_0, \alpha_1, \dots, \alpha_m)^{T}, \boldsymbol{\beta} = (\beta_0, \beta_1, \dots, \beta_l)^{T}\)\\
      $\rar$ corresponding coefficient vectors
    \end{itemize}
\end{frame}

有什么不对?

答案1

    \usepackage{amsmath}
\begin{document}
\begin{frame}{Zip model}
\begin{itemize}
    \item Probability mass function of Y

    $$*Pr(Y = y\mid\lambda, p) = 
           \begin{cases} 
             p + (1 - p)e^{-\lambda}, & \text{if $y = 0$}\\
             (1 - p)\frac{e^{-\lambda}\lambda^{y}}{y!}, & \text{if $y > 0$}
           \end{cases} $$
    \item $$\begin{aligned}E(Y) =& (1 - p)\lambda \\
    *Var(Y) =& \lambda(1 - p)(1 + p\lambda)\end{aligned}$$
\end{itemize}
\end{frame}
\end{document}

您可以$$...$$替换$...$

在此处输入图片描述 第二段文字我觉得我发现了问题

  \item $\boldsymbol{X_1} = (1, X_{11}, X_{12}, \dots, X_{1m})$ : covariate vector included in the zero stage\\
   $\boldsymbol{X_2} = (1, X_{21}, X_{22}, \dots, X_{2l})$: covariate vector included in the Poisson stage
    \item $\boldsymbol{\alpha} = (\alpha_0, \alpha_1, \dots, \alpha_m)^{T}, \boldsymbol{\beta} = (\beta_0, \beta_1, \dots, \beta_l)^{T}$\\

和 :

$$\begin{cases}
       \lambda : \text{loglinear model}\   \log(\frac{p}{1-p}) = \textbf{$X_{1\alpha}$} = \alpha_0 + \alpha_{1X}_{11} + \alpha_{2X}_{12} + \dots + \alpha_{mX}_{1m} \\
        p : \text{logit model} \  \log(\lambda) = \textbf{$X_{2\beta}$} = \beta_0 + \beta_{1X}_{21} + \beta_{2X}_{22} + \dots + \beta_{lX}_{2l}
        \end{cases}$$

我没有得到\itembcs 我没有使用它的包

答案2

在此处输入图片描述

\documentclass{beamer}

\usepackage{amsmath}
\begin{document}
\begin{frame}{ZIP model}
\begin{itemize}
    \item Probability mass function of Y
    \(*Pr(Y = y\mid\lambda, p) = 
           \begin{cases} 
             p + (1 - p)e^{-\lambda}, & \text{if y = 0}\\
             (1 - p)\frac{e^{-\lambda}\lambda^{y}}{y!}, & \text{if y} > 0
           \end{cases} \)
    \item \(\begin{aligned}E(Y) =& (1 - p)\lambda \\
    *Var(Y) =& \lambda(1 - p)(1 + p\lambda)\end{aligned}\)
\end{itemize}
\end{frame}

\end{document}

相关内容