gSulpizio / isotherm-fitting

MIT License
1 stars 1 forks source link

`pop` and `shift` #10

Open kjappelbaum opened 3 years ago

kjappelbaum commented 3 years ago

why do you make the intermediate objects?

https://github.com/gSulpizio/isotherm-analysis/blob/1013b45d10287ad30288894708536716ff55f85d/src/getParams.ts#L14-L28

gSulpizio commented 3 years ago

To avoid changing the original data object I guess? how would you proceed? My other idea was to do a recurring algorithm with for example a range to consider and reducing that range, would that be better?

kjappelbaum commented 3 years ago

quite easy to read would be slicing, but this has usually a low efficiency. But i do not know how it compares to your implementation where you make two copies. Maybe just try it in jsbench. But anyhow, you would not need to copy two times?

gSulpizio commented 3 years ago

So basically, we evaluate the linear regression once without the first point and once without the last point. we take the linear regression with the smallest r2 and do it all over again. So we need to cut them to make a linear regression to compare both linear regression. Is there a better way?