1

I'm trying to write something like:

equation picture

I'm not sure how to get the equations to stack with y hat on one side.

Adi Tolia
  • 47
  • 3
  • Welcome to TeX.SE. Please clarify your objective. Are you looking to typeset just the material in black, or are you also looking to typeset the underbrace and the label "prob."? – Mico May 06 '23 at 02:01
  • @Mico thanks for the welcome! I was just trying to get the equation, not the bracket with prob underneath. I'm mainly wondering how to achieve the big bracket next to the equals sign. Sorry for any confusion! – Adi Tolia May 06 '23 at 02:05
  • Why not read some documentation such as lshort first?@AdiTolia – Stephen May 06 '23 at 02:33

1 Answers1

2

I found a solution to this using cases:

\documentclass{article} % or some other suitable document class
\usepackage{amsmath} % for 'cases' environment
\begin{document}
\[
   \hat{y} = \begin{cases}
               1 & \text{ if } \sigma (\beta_0 + \beta_1 x) > \frac{1}{2} \\
               0 & \text{ if } \sigma (\beta_0 + \beta_1 x) \leq \frac{1}{2}
             \end{cases}
\]
\end{document}
Adi Tolia
  • 47
  • 3
  • 1
    I've added instructions -- such as entering and exiting math mode, and loading the amsmath package -- to make your code fragment minimally compilable. Feel free to revert. – Mico May 06 '23 at 04:44
  • @Celdor updated code to add the \. – Adi Tolia May 07 '23 at 00:13