function NegLL = siwrML(tspan,x0,params,data)
x0(2) = data(1)*params(4);
x0(1) = 1-x0(2);
[t,x] = ode45(@siwrODE,tspan,x0,[],params);
y = x(:,2)/params(4);
NegLL = (y)'*ones(length(y),1) - data'*log(y);  %Poisson ML
%NegLL = ((data - y)./(sqrt(data)))'*((data - y)./(sqrt(data))); %WLS
%NegLL = ((data - y))'*((data - y)); %OLS