Hi everyone, How can I calculate R^2 for the actual data and the normal fit distribution? The problem I am having is my normal fit cdf values are on a scale of 0 to 1, and I would like to scale this so that is matches the scale of the actual data (0 to 2310). Because in the third to last step I must find the difference between the actual and normal predicted data.
Table = readtable("practice3.xlsx");
actual_values = Table.values;
actual_values = sort(actual_values)
actual_values =
50
80
350
370
450
700
1060
1100
2000
2310
normalfit = fitdist(actual_values,'Normal');
cdf_normal = cdf('Normal', actual_values, normalfit.mu, normalfit.sigma);
plot(actual_values,cdf_normal)
predicted_values = cdf_normal
predicted_values =
0.1530
0.1623
0.2616
0.2701
0.3051
0.4251
0.6078
0.6274
0.9307
0.9699
SSR = sum(predicted_values - actual_values).^2;
TSS = sum(((actual_values - mean(actual_values)).^2));