Unable to understand how FindFit function works.
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
ks = 0.01, 1, 2, 4, 6, 8, 10, 25, 50, 100, 200, 300, 400, 500, 600,
800, 1*^3, 2*^3, 4*^3, 5*^3, 10*^3, 15*^3, 20*^3, 30*^3, 40*^3,
70*^3, 1*^5, 1*^6, 1*^8, 1*^12;
aa1 = 3.14172, 3.15756, 3.17331, 3.2041, 3.23399, 3.26304, 3.29131,
3.48223, 3.74135, 4.13211, 4.66617, 5.04019, 5.3278, 5.56008,
5.75347, 6.05965, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314,
6.28314, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314,
6.28314, 6.28314;
aa2 = 9.42478, 9.42537, 9.42596, 9.42716, 9.42836, 9.42955, 9.43075,
9.43974, 9.45479, 9.48511, 9.54657, 9.60893, 9.67202, 9.73563,
9.79957, 9.92774, 10.0553, 10.6536, 11.5696, 11.9059, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663;
aa3 = 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.9037,
13.3636, 13.6161, 13.8784, 14.0112, 14.1813, 14.2487, 14.388,
14.4031, 14.4032;
p1 = ListLogLinearPlot[Table[ks[[i]], aa1[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
p2 = ListLogLinearPlot[Table[ks[[i]], aa2[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
p3 = ListLogLinearPlot[Table[ks[[i]], aa3[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
Show[p1, p2, p3, PlotRange -> All]
lst = N[Table[Log10[ks[[i]]], aa1, i, Length[ks]]]
model = a E^(b (x - c))/(E^(b (x - c)) + 1) + d
ff = FindFit[lst, model, a, b, c, d, x]
Plot[model /. ff, x, 0, 12, PlotRange -> 0, 12, 3, 6.5,
GridLines -> Automatic]
I have three sets of data aa1,aa2,aa3, I am trying to fit an equation for this data, data looks like a sigmoid function. So I have used a fit model which resembles the sigmoid function. Later I used the FindFit function to extract the unknown coefficients. when I plotted the fitted model I am getting a straight line. What mistake I am doing. same thing is happening for aa2 and aa3.
fitting
add a comment |Â
up vote
1
down vote
favorite
ks = 0.01, 1, 2, 4, 6, 8, 10, 25, 50, 100, 200, 300, 400, 500, 600,
800, 1*^3, 2*^3, 4*^3, 5*^3, 10*^3, 15*^3, 20*^3, 30*^3, 40*^3,
70*^3, 1*^5, 1*^6, 1*^8, 1*^12;
aa1 = 3.14172, 3.15756, 3.17331, 3.2041, 3.23399, 3.26304, 3.29131,
3.48223, 3.74135, 4.13211, 4.66617, 5.04019, 5.3278, 5.56008,
5.75347, 6.05965, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314,
6.28314, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314,
6.28314, 6.28314;
aa2 = 9.42478, 9.42537, 9.42596, 9.42716, 9.42836, 9.42955, 9.43075,
9.43974, 9.45479, 9.48511, 9.54657, 9.60893, 9.67202, 9.73563,
9.79957, 9.92774, 10.0553, 10.6536, 11.5696, 11.9059, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663;
aa3 = 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.9037,
13.3636, 13.6161, 13.8784, 14.0112, 14.1813, 14.2487, 14.388,
14.4031, 14.4032;
p1 = ListLogLinearPlot[Table[ks[[i]], aa1[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
p2 = ListLogLinearPlot[Table[ks[[i]], aa2[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
p3 = ListLogLinearPlot[Table[ks[[i]], aa3[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
Show[p1, p2, p3, PlotRange -> All]
lst = N[Table[Log10[ks[[i]]], aa1, i, Length[ks]]]
model = a E^(b (x - c))/(E^(b (x - c)) + 1) + d
ff = FindFit[lst, model, a, b, c, d, x]
Plot[model /. ff, x, 0, 12, PlotRange -> 0, 12, 3, 6.5,
GridLines -> Automatic]
I have three sets of data aa1,aa2,aa3, I am trying to fit an equation for this data, data looks like a sigmoid function. So I have used a fit model which resembles the sigmoid function. Later I used the FindFit function to extract the unknown coefficients. when I plotted the fitted model I am getting a straight line. What mistake I am doing. same thing is happening for aa2 and aa3.
fitting
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
ks = 0.01, 1, 2, 4, 6, 8, 10, 25, 50, 100, 200, 300, 400, 500, 600,
800, 1*^3, 2*^3, 4*^3, 5*^3, 10*^3, 15*^3, 20*^3, 30*^3, 40*^3,
70*^3, 1*^5, 1*^6, 1*^8, 1*^12;
aa1 = 3.14172, 3.15756, 3.17331, 3.2041, 3.23399, 3.26304, 3.29131,
3.48223, 3.74135, 4.13211, 4.66617, 5.04019, 5.3278, 5.56008,
5.75347, 6.05965, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314,
6.28314, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314,
6.28314, 6.28314;
aa2 = 9.42478, 9.42537, 9.42596, 9.42716, 9.42836, 9.42955, 9.43075,
9.43974, 9.45479, 9.48511, 9.54657, 9.60893, 9.67202, 9.73563,
9.79957, 9.92774, 10.0553, 10.6536, 11.5696, 11.9059, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663;
aa3 = 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.9037,
13.3636, 13.6161, 13.8784, 14.0112, 14.1813, 14.2487, 14.388,
14.4031, 14.4032;
p1 = ListLogLinearPlot[Table[ks[[i]], aa1[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
p2 = ListLogLinearPlot[Table[ks[[i]], aa2[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
p3 = ListLogLinearPlot[Table[ks[[i]], aa3[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
Show[p1, p2, p3, PlotRange -> All]
lst = N[Table[Log10[ks[[i]]], aa1, i, Length[ks]]]
model = a E^(b (x - c))/(E^(b (x - c)) + 1) + d
ff = FindFit[lst, model, a, b, c, d, x]
Plot[model /. ff, x, 0, 12, PlotRange -> 0, 12, 3, 6.5,
GridLines -> Automatic]
I have three sets of data aa1,aa2,aa3, I am trying to fit an equation for this data, data looks like a sigmoid function. So I have used a fit model which resembles the sigmoid function. Later I used the FindFit function to extract the unknown coefficients. when I plotted the fitted model I am getting a straight line. What mistake I am doing. same thing is happening for aa2 and aa3.
fitting
ks = 0.01, 1, 2, 4, 6, 8, 10, 25, 50, 100, 200, 300, 400, 500, 600,
800, 1*^3, 2*^3, 4*^3, 5*^3, 10*^3, 15*^3, 20*^3, 30*^3, 40*^3,
70*^3, 1*^5, 1*^6, 1*^8, 1*^12;
aa1 = 3.14172, 3.15756, 3.17331, 3.2041, 3.23399, 3.26304, 3.29131,
3.48223, 3.74135, 4.13211, 4.66617, 5.04019, 5.3278, 5.56008,
5.75347, 6.05965, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314,
6.28314, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314, 6.28314,
6.28314, 6.28314;
aa2 = 9.42478, 9.42537, 9.42596, 9.42716, 9.42836, 9.42955, 9.43075,
9.43974, 9.45479, 9.48511, 9.54657, 9.60893, 9.67202, 9.73563,
9.79957, 9.92774, 10.0553, 10.6536, 11.5696, 11.9059, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663;
aa3 = 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663,
12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.5663, 12.9037,
13.3636, 13.6161, 13.8784, 14.0112, 14.1813, 14.2487, 14.388,
14.4031, 14.4032;
p1 = ListLogLinearPlot[Table[ks[[i]], aa1[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
p2 = ListLogLinearPlot[Table[ks[[i]], aa2[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
p3 = ListLogLinearPlot[Table[ks[[i]], aa3[[i]], i, Length[ks]],
Joined -> True, PlotRange -> All];
Show[p1, p2, p3, PlotRange -> All]
lst = N[Table[Log10[ks[[i]]], aa1, i, Length[ks]]]
model = a E^(b (x - c))/(E^(b (x - c)) + 1) + d
ff = FindFit[lst, model, a, b, c, d, x]
Plot[model /. ff, x, 0, 12, PlotRange -> 0, 12, 3, 6.5,
GridLines -> Automatic]
I have three sets of data aa1,aa2,aa3, I am trying to fit an equation for this data, data looks like a sigmoid function. So I have used a fit model which resembles the sigmoid function. Later I used the FindFit function to extract the unknown coefficients. when I plotted the fitted model I am getting a straight line. What mistake I am doing. same thing is happening for aa2 and aa3.
fitting
fitting
asked 7 hours ago
vijay
1357
1357
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
4
down vote
accepted
In your definition of lst
, I believe you forgot to add the Part
specification on aa1
.
lst = N[Table[Log10[ks[[i]]], aa1[[i]], i, Length[ks]]]
or
lst = Thread@Log10[ks], aa1 // N
Which then yields the final plot
Extremely sorry, It's my mistake, I did not give attention to missing aa1[[i]]. Thanks for your time.
â vijay
6 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
In your definition of lst
, I believe you forgot to add the Part
specification on aa1
.
lst = N[Table[Log10[ks[[i]]], aa1[[i]], i, Length[ks]]]
or
lst = Thread@Log10[ks], aa1 // N
Which then yields the final plot
Extremely sorry, It's my mistake, I did not give attention to missing aa1[[i]]. Thanks for your time.
â vijay
6 hours ago
add a comment |Â
up vote
4
down vote
accepted
In your definition of lst
, I believe you forgot to add the Part
specification on aa1
.
lst = N[Table[Log10[ks[[i]]], aa1[[i]], i, Length[ks]]]
or
lst = Thread@Log10[ks], aa1 // N
Which then yields the final plot
Extremely sorry, It's my mistake, I did not give attention to missing aa1[[i]]. Thanks for your time.
â vijay
6 hours ago
add a comment |Â
up vote
4
down vote
accepted
up vote
4
down vote
accepted
In your definition of lst
, I believe you forgot to add the Part
specification on aa1
.
lst = N[Table[Log10[ks[[i]]], aa1[[i]], i, Length[ks]]]
or
lst = Thread@Log10[ks], aa1 // N
Which then yields the final plot
In your definition of lst
, I believe you forgot to add the Part
specification on aa1
.
lst = N[Table[Log10[ks[[i]]], aa1[[i]], i, Length[ks]]]
or
lst = Thread@Log10[ks], aa1 // N
Which then yields the final plot
edited 6 hours ago
answered 6 hours ago
That Gravity Guy
1,839514
1,839514
Extremely sorry, It's my mistake, I did not give attention to missing aa1[[i]]. Thanks for your time.
â vijay
6 hours ago
add a comment |Â
Extremely sorry, It's my mistake, I did not give attention to missing aa1[[i]]. Thanks for your time.
â vijay
6 hours ago
Extremely sorry, It's my mistake, I did not give attention to missing aa1[[i]]. Thanks for your time.
â vijay
6 hours ago
Extremely sorry, It's my mistake, I did not give attention to missing aa1[[i]]. Thanks for your time.
â vijay
6 hours ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f184263%2funable-to-understand-how-findfit-function-works%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password