What is an example of a hidden variable model that meets the bound of Bell's inequality?

The best possible local realist imitation (red) for the quantum correlation of two spins in the singlet state (blue), insisting on perfect anti-correlation at 0°, perfect correlation at 180°.

Just for my own understanding and learning of math, let's pretend that indeed the experimental data was the red curve rather than the blue curve. Then following the same article, we would be able to model this using a local realist model:

$${\displaystyle C_{h}(a,b)=E(A(\mathbf {a} ,\lambda )B(\mathbf {b} ,\lambda ))=\int _{\Lambda }A(\mathbf {a} ,\lambda )B(\mathbf {b} ,\lambda )p(\lambda )d\lambda .}$$

What choices of $$A(\mathbf {a} ,\lambda )$$, $$B(\mathbf {b} ,\lambda )$$, and $$p(\lambda )$$ would yield the red curve?

• There are examples of hidden variables that produce results matching the blue line. For example Coherent photons could have an oscillating variable added to them and you would produce the blue line. Mathematically matching cos2theta Commented Jan 12, 2022 at 16:37

Assuming $$\mathbf {a}, \mathbf{b} \in \mathbb{R}^2$$, with $$\alpha, \beta$$ being the corresponding angles, the following model yields the red graph: $$\begin{array}{l} \lambda \sim{\rm{Uniform}}\left[ {0,2\pi } \right] \to \mathop P\left( \lambda \right) = \frac{1}{{2\pi }} \\ A(\mathbf {a} ,\lambda ) = {\mathop{\rm sgn}} \cos (\alpha - \lambda) \\ B(\mathbf {b} ,\lambda ) = -{\mathop{\rm sgn}} \cos (\beta - \lambda) \end{array}$$