corrcoef - plotregression (which algorithm plotregression use)
22 views (last 30 days)
I want to ask which algorithm does the plotregression use for calculating the R value?
"the R value spotted out above the window after we run the plotregression function (in ANN,or etc..)."
- Is it the R value that is calculated with the function R = corrcoef(X) ? or with a different function.
Lucas García on 2 Sep 2012
plotregression actually uses the regression function (also from Neural Network Toolbox) to compute the R value.
However, note that results are almost identical to corrcoef's output.
net = newff(simplefitInputs,simplefitTargets,10);
[net,tr] = train(net,simplefitInputs,simplefitTargets);
simplefitOutputs = sim(net,simplefitInputs);
R value in plotregression is computed this way:
[r,m,b] = regression(simplefitTargets,simplefitOutputs);
c = corrcoef(simplefitTargets,simplefitOutputs);
Values should be almost identical. In my test:
norm(c(1,2) - r)