Calculating the slope of a series of values

前端 未结 4 1756
名媛妹妹
名媛妹妹 2021-02-15 11:32

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:20

    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.

提交回复
热议问题