You will have noticed that, in the example library, there is no code at all for the regression_analysis
module. This is deliberate.
Back in Chapter 6, Creating Your Own Rust Applications, one of the tasks was to create code that enabled you to perform a regression analysis based on formulae provided. The code created can now be firmly split into two parts:
- The equation for the straight line, y = mx + c
,
which will also give the intercepts on the x and y axis - The standard deviation and regression analysis
In this task, you are to take your code and put it into the mathslib
crate. This may not be as simple as it seems. The library will need to take:
- A filename for the file containing the data
- A vector containing either a
struct
ortuple
that holds the data
However, the problem doesn't lie in the data, but rather in the fact that, each time a calculation is made, the whole regression analysis has to be performed. For example, to calculate the standard...