[Tex/LaTex] undefined control sequence in latex

errorsmath-mode

I snippet of my code is presented here.I do not understand why I'm getting the error undefined control sequence.I have also included the package amsmath.

\subsection{Logistic Regression}
\noindent $p_i=P(y_i=1)$ and $(x_i\in\mathbb{R})^d$. The binary responses are modelled using the following formulation $$\log{{p_{i}}\over{1-p_{i}}}={{\beta}}^{T}{\bf x}_{i}\qquad\text{or}\qquadp_{i}={{\exp({{\beta}}^{T}{\bf x}_{i})}\over{1+\exp({{\beta}}^{T}{\bf x}_{i})}}$$ where $\beta\in\mathbb{R}^d$ are some unknown regression coefficients often estimated using maximum likelihood. 

Best Answer

To use \mathbb, you also need to add amssymb:

enter image description here

In this instance, there seems to be no need for \noindent (unless you modified your sectional headings from the default). Note that I've completely rewritten the mathematical expression:

  • Don't use $$...$$ for your math display; rather use \[...\]. See Why is \[\] preferable to $$$$?;

  • Don't use {<num>}\over{<denom>} for a fraction. Instead, use \frac{<num>}{<denom>};

  • Don't over-use braces; they could change the spacing of elements in the expression.