Linear Regression With Dates

Most of the math libraries I use don’t support date values for linear regression. This was my work around.

1. Convert date / times to Unix time.

2. Take the earliest date and subtract that time value from all the other values.
3. Run linear regression using the modified Unix times.
4. Add the earliest time value back to each Unix time when stating results.