The MASM Forum

Projects => ObjAsm => Topic started by: Biterider on July 31, 2022, 08:56:44 PM

Title: Simple Linear Regression
Post by: Biterider on July 31, 2022, 08:56:44 PM
Hi
Inspired by this thread How to Benchmark Code Execution Times (http://masm32.com/board/index.php?topic=10099.0), I have the algorithm to calculate the Simple Linear Regression (https://%20en.wikipedia.org/wiki/Simple_linear_regression) (SLR). The idea behind this is to split the algorithm into 2 parts. The former is independent of the data and can be pre-computed and the latter part processes the actual data. In this way, some processing time can be saved for changeable data, but the number of which does not change.

Additionally, I coded the algorithm for calculating the variance and the Mean Squared Error (https://en.wikipedia.org/wiki/Mean_squared_error) (MSE), which can be a byproduct of the SLR, to calculate the Coefficient of Determination (https://en.wikipedia.org/wiki/Coefficient_of_determination)) R2.

Attached are the routines (64 bit only for QWORD data) and included in the ObjMem library (32 bit and 64 bit for DWORD, QWORD, REAL4 and REAL8 data) :cool:

Biterider
Title: Re: Simple Linear Regression
Post by: HSE on August 01, 2022, 05:27:44 AM
Very Interesting  :thumbsup:

When writing the BenchmarkUEFI test, I lost an hour with the method of invariants, but failed  :biggrin: Congratulations!!