function J = ec_disc_lst(p0,tdata,pdata)
% Least Squares fit to Malthusian Growth
N = length(tdata);
p = p0(1);
pop = [p];
err = [pdata(1) - p];
for i = 2:N  % Malthusian iteration
    p = p*(1+p0(2));
    pop = [pop,p];
    err = [err, pdata(i) - p];
end
J = err*err'; % Sum of square errors
end

