![]() ![]() ![]() QuadEstOut = Application.LinEst(nAvg, Application.Power(nP2, Array(1, 2)), True, False) ![]() LinEstOut(i) = Application.LinEst(nAvg, nP2, 1, 0) 'linest returns a slope' Dim lin() As Variant 'linear regression'ĭim quad() As Variant 'polynomial regression'ĭim RMSE1 As Single 'RMSE of linear regression'ĭim RMSE2 As Single 'RMSE of quadratc regression'ĭim nAvg() As Variant 'Avg values being looked at in current loop'ĭim nP2() As Variant 'P2 values being looked at in current loop' I have yet to find success doing this.Īvg & P2 are the variables for the input data. I know that linest is supposed to return the coefficients of a linear/quadratic regression, so I tried just creating a y=mx+b in my code to generate the arrays I want. Simple enough right? The problem is when I use the linest function, I'm not getting the results I was hoping for (a 2d array containing the x values in the first column and the y values in the second column), and instead I'm receiving "Error 2015". I'm trying to generate a linear and quadratic regression of some data I have using vba. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |