I am expecting a linear relationship between difficulty and hash rate. If I generate a scatter plot between the two variables I can see a linear relationship, but also values that are not on the line (in red frame of figure). I tried to correlate this with protocol changes, but this was not successful. Why are this values of the line?
You can find the code to generate the plot in https://gist.github.com/Slebi/1e1e614dcccc7e04424da5126c80c0a6