% We want to find the quadratic regression of the curves
% Jonathan Buie
% 11/4/2014
letter = 5;

figure;
for i = 1:15
    if letter == 3
        Ninit(letter,i) = 1; % to account for letter G
    end
    if i > length(RD)
        plot(errorxsub_initial(letter,i),entropyxsub_initial(letter,i),'xb',...
            'Marker',markers{16-i},'MarkerSize',100/sqrt(Ninit(letter,i)));hold on;
    else
        plot(errorxsub_initial(letter,i),entropyxsub_initial(letter,i),'xr',...
            'Marker',markers{i},'MarkerSize',100/sqrt(Ninit(letter,i)));hold on;
    end;
end
l=legend('Alina','Angela','Edward','Latisha','Laura','Norene',...
    'Shauna','Teddy','Tony','Anton','Bob','Carly','Evan',...
    'Joanna','Miguel');
set(l,'Location','EastOutside', 'FontSize',12);
%%
pRD = polyfit(errorxsub_initial(letter,1:length(RD)),...
    entropyxsub_initial(letter,1:length(RD)),2)
x1 = 0:0.001:(max(errorxsub_initial(letter,1:length(RD)))+.1);
y1 = polyval(pRD,x1);
hold on
plot(x1,y1,'b')
pRC = polyfit(errorxsub_initial(letter,(length(RD)+1):end),...
    entropyxsub_initial(letter,(length(RD)+1):end),2)
x2 = 0:0.001:(max(errorxsub_initial(letter,1:length(RD)))+.1);
y2 = polyval(pRC,x2);
hold on
plot(x2,y2,'r')