# undefined control sequence in latex

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.


To use \mathbb, you also need to add amssymb: 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:

Here is a polished version of your snippet:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb} % for \mathbb

\begin{document}

\subsection{Logistic Regression}

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

\end{document} • On the subject of polished looks: Are the parentheses needed in $(\mathbf{x}_i\in\mathbb{R}^d)$? I'm pretty sure they could/should be omitted.
– Mico
Jun 27, 2014 at 13:53
• @Mico I just put the exponent inside the bracket; it denotes a sequence of vectors, I guess. Jun 27, 2014 at 13:54
• I have to admit I've never seen it in text either. I've seen it is displayed math though, as a sort of comment on the variables Jun 27, 2014 at 14:06
• Thinking some more about the case at hand, it may be best to omit the subscript i from \mathbf{x} (I'm pretty sure we're just dealing with a d-element vector, rather than a sequence of vectors...) entirely and to write \exp(\boldsymbol{\beta}^{T}\mathbf{x}). After all, if we're going to use bold for one vector that shows up in an inner product, we might as well use it for both vectors...
– Mico
Jun 27, 2014 at 14:13
• @Mico In the formula \mathbf{x}_{i} is used and it is a d-dimensional vector. I would not enter into a debate about notation: every field is entitled having their own uses. Maybe coherence would require a boldface beta, usage might not. In any case, \boldsymbol is obsolete. Jun 27, 2014 at 14:19