[#BloombergLP-bdlsta-LineFit-fitIfValid] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlsta.adoc[bdlsta]::xref:BloombergLP/bdlsta/LineFit.adoc[LineFit]::fitIfValid :relfileprefix: ../../../ :mrdocs: Calculate line fit coefficients `Y = Alpha + Beta * X`, and populate the specified `alpha` (intercept) and `beta` (slope). Return 0 on success, and non‐zero otherwise. The computations is unsuccessful if `2 > count` or all X's are identical. == Synopsis Declared in `<bdlsta_linefit.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int fitIfValid( double* alpha, double* beta) const; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#