B
B
bpGusar2018-12-11 10:35:23
JavaScript
bpGusar, 2018-12-11 10:35:23

How to find linear regression?

I have an array of objects like

const arr = [
{x: 20.849203669054898, y: 20.849203669054898}
{x: 31.784082508100216, y: 31.784082508100216}
{x: 45.66296718842696, y: 45.66296718842696}
{x: 45.99942499885912, y: 45.99942499885912}
{x: 48.01817186145211, y: 48.01817186145211}
{x: 59.205394058321545, y: 59.205394058321545}
{x: 62.065285446994935, y: 62.065285446994935}
{x: 82.50509743074888, y: 82.50509743074888}
{x: 83.76681421986947, y: 83.76681421986947}
{x: 85.36498881942225, y: 85.36498881942225}
{x: 86.54259115593483, y: 86.54259115593483}
]

These are the coordinates of the points. How to find a linear regression based on this data?
The output needs data of the same type as the original array, that is, with x and y.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2018-12-11
@Rsa97

For example, the least squares method
135014a027ac5c369323c40f14b65ec075e03f37

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question