Calculating the slope of a series of values

前端 未结 4 1979
滥情空心
滥情空心 2021-02-15 12:04

I have 2 arrays of equal length. The following function attempts to calculate the slope using these arrays. It returns the average of the slope between each points. For the foll

4条回答
  •  失恋的感觉
    2021-02-15 12:26

    You should be dividing by x_values.length - 1 . Number of slopes is pairwise.

    Edit : Wiki example in my comments shows how to calculate the alpha and beta which determines the slope of the linear regression line.

提交回复
热议问题