function best_offset=find_offset_for_y_equals_x

xx=[18.6667   15.4295   12.3522   24.0000   24.2857   16.0000]
yy=[12.0000    3.4998    6.8004   21.0000   18.2000   15.0000]

smallest_sse=1000;best_offset=0;
for offset=0:.001:30
    this_sse=sum(((xx-offset)-yy).^2);
    if this_sse<smallest_sse
        smallest_sse=this_sse;
        best_offset=offset;
    end
end