function [change_point,smallest_sse]=find_change_point_using_sum_of_squares(input_data)

smallest_sse=sum((input_data-mean(input_data)).^2);
change_point=0;
for candidate_change_point=1:length(input_data)-1
    sse=sum((input_data(1:candidate_change_point)-mean(input_data(1:candidate_change_point))).^2)...
        +sum((input_data((candidate_change_point+1):end)-mean(input_data((candidate_change_point+1):end))).^2);
    if sse<smallest_sse
        smallest_sse=sse;
        change_point=candidate_change_point;
    end
end