1
$\begingroup$

I have a set of data as:

data = {{0, 0.046}, {40, 0.111}, {80, 0.291}, {120, 0.808}, {160, 1.742}, {200, 3.319}, {240, 5.017}, {280, 5.503}, {320, 5.897}}

With Standard deviations as:

sd = {0.003, 0.012, 0.023, 0.056, 0.083, 0.216, 0.526, 0.366, 0.313}

Then I fit the data by taking inverse variances as weights:

data2 = data;
data2[[All, 2]] = Log[data2[[All, 2]]];
nlm2 = NonlinearModelFit[data2, Log[a/(1 + E^(-k (t - t0)))], {{a, 1}, {t0, 50}, {k, 0.1}}, t, Weights -> 1/sd^2];
nlm2["ParameterConfidenceIntervalTable"]

But it returns an error: "NonlinearModelFit::sszero: The step size in the search has become less than the tolerance prescribed by the PrecisionGoal option, but the gradient is larger than the tolerance specified by the AccuracyGoal option. There is a possibility that the method has stalled at a point that is not a local minimum."

How can I fix this?

$\endgroup$

1 Answer 1

1
$\begingroup$

Your estimate of k is bad. With k=1 you get:

data2 = data;
data2[[All, 2]] = Log[data2[[All, 2]]];
nlm2 = NonlinearModelFit[data2, Log[a/(1 + E^(-k (t - t0)))], {{a, 1}, {t0, 50}, {k, 1}}, t, Weights -> 1/sd^2];
nlm2["ParameterConfidenceIntervalTable"]

Plot[nlm2[t], {t, 0, 330}, Epilog -> Point[data2]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.