simple-statistics: [Help] Linear Regression examples
I know there’s an example on Linear Regression but that is done by including D3 libraries to draw the plots etc.
My requirement is to create simple plots/lines using linear regression on a mapbox project using the leafletjs API.
I don’t think there’s a need to include the D3 libraries et. all for this purpose. There must be an easier way out. All I need is to display a line on the map, which can be achieved by using Polylines. I’m just not sure how the values returned by the linearRegression() or linearRegressionLine() functions can be used for this purpose.
Any help would be much appreciated.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 22
Commits related to this issue
- Draw the linear regression line on the map Fixes the FIXME in the previous commit Thanks to @brylie : https://github.com/simple-statistics/simple-statistics/issues/149 — committed to tinvaan/NOC by tinvaan 8 years ago
- Draw the linear regression line on the map Fixes the FIXME in the previous commit Thanks to @brylie : https://github.com/simple-statistics/simple-statistics/issues/149 — committed to tinvaan/NOC by tinvaan 8 years ago
Cool. Neat project 😃
Does that seem to work as expected?
OK, here is my working code:
You can try it out by pasting it in the NPM simple-statistics package sandbox. Then, click Run and select Map coordinates list in the dropdown box next to the
Arrayoutput.