Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have loaded the amsmath package. I am not able to get the mass function of a negative binomial distribution. The code is:

\begin{equation*}

f(count_{i,t}|\lambda_{i,t},\theta_i) = 
{\Gamma(\lambda_{i,t} + count_{i,t})/{\Gamma(\lambda_{i,t})\Gamma(count_{i,t}+1)}}{(\theta_i/{1+\theta_i})}^count_{i,t} {(1/{1+\theta_i})}^\lamba_{i,t}

\end{equation*}

The error is:

[14] [15] [16] [17]
! Undefined control sequence.
l.380 ...})}^count_{i,t} {(1/{1+\theta_i})}^\lamba
                                                  _{i,t}

This is how I want the equation to look like Thanks in advance!

share|improve this question
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  karlkoeller Nov 23 '13 at 8:48
6  
You have \lamba instead of \lambda. –  Przemysław Scherwentke Nov 23 '13 at 8:48
3  
And you cannot have empty lines in an equation. –  Torbjørn T. Nov 23 '13 at 8:53
1  
You may also be missing curly braces, { and }, around the final count_{i,t} expression, which looks like it should be placed in a superscript (exponent) position. Incidentally, even after you've made the changes made in these comments, the equation is not going to look anything like the image you've posted since you're using inline-fraction expressions rather than \frac. –  Mico Nov 23 '13 at 9:25

1 Answer 1

\documentclass{article}
\usepackage{amsmath}

\begin{document}
This is your equation corrected:
\begin{equation*}
f(\mathrm{count}_{i,t}\mid\lambda_{i,t},\theta_i) = {\Gamma(\lambda_{i,t} + \mathrm{count}_{i,t})/{\Gamma(\lambda_{i,t})\Gamma(\mathrm{count}_{i,t}+1)}}{(\theta_i/{1+\theta_i})}^{\mathrm{count}_{i,t}}{(1/{1+\theta_i})}^{\lambda_{i,t}}
\end{equation*}
This is the equation from the image you've posted:
\begin{equation*}
f(y_{it}\mid\lambda_{it},\theta_i) = \frac{\Gamma(\lambda_{it} + y_{it})}{\Gamma(\lambda_{it})\Gamma(y_{it}+1)}\left(\frac{\theta_i}{1+\theta_i}\right)^{y_{it}}\left(\frac{1}{1+\theta_i}\right)^{\lambda_{it}}
\end{equation*}
\end{document}
share|improve this answer
2  
I would also change | to \mid : doing so will create better spacing around the symbol. –  Mico Nov 23 '13 at 16:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.