Here two possibilities: one with the aligned
environment, nested in equation, ans using
\MoveEqLeftfrom
mathtools, the other uses
flalignand an *adhoc* alignment point. Both use the medium-size fractions (
\mfrac) from
nccmath`for the numerical fractions, as I think it looks better:
\documentclass{article}
\usepackage{nccmath}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\label{off-margin}
\begin{aligned}
\MoveEqLeft -\ell (\beta _{0},\boldsymbol{\beta }) + \lambda \|\boldsymbol{\beta }\|_{1} = \\
& \biggl[-\frac{1}{n}\biggl(\sum_{i = 1}^{n} (\beta _{0}x_{i0} + \mathbf{x}^T\boldsymbol{\beta })y_i-\log(1 + \exp(\beta _{0}x_{i0} + \mathbf{x}^T\boldsymbol{\beta }))\biggr)\biggr] \\
\text{where} &\phantom{ + } \boldsymbol{\beta } = (\beta _{1},\dots, \beta _{p})^{T}\text{ and } x_{i0} = 1 \text{ for all }i.
\end{aligned}
\end{equation}
Next, we need to show that the negative log-likelihood function is convex. By showing convexity it means that a local minimum exists which is the global minimum…
\begin{flalign}
\label{off-margin1}
-\ell (\beta _{0},\boldsymbol{\beta }) & + \lambda \|\boldsymbol{\beta }\|_{1} = \notag \\
&\phantom{ + } \biggl[-\mfrac{1}{n}\biggl(\sum_{i = 1}^{n} (\beta _{0}x_{i0} + \mathbf{x}^T\boldsymbol{\beta })y_i-\log(1 + \exp(\beta _{0}x_{i0} + \mathbf{x}^T\boldsymbol{\beta }))\biggr)\biggr] \\%
\text{where} &\phantom{ + } \boldsymbol{\beta } = (\beta _{1},\dots, \beta _{p})^{T}\text{ and } x_{i0} = 1 \text{ for all }i. \notag
\end{flalign}
\end{document}

align
, load packagemathtools
, split the equation after the=
sign and use\MoveEqLeft
for the first line.MoveEqLeft
because when I did it, the equation moved all to the left which is even worse now\documentclass
and ending\end{document}
. Although your question is essentially about breaking equation into multiple lines, it is helpful that you provide source code to save others the typing.multline
environment didn't work. But you saidmultiline
; that's entirely different.