| Author |
Comment/Response |
Thibault
|
04/17/12 2:14pm
Hi all,
I used FindFit and Do in the same time to find the differents parameteres of my equation.
n=10000;R=50;d=1000;
ndist=Random[NormalDistribution[1,5]];
j = 1; h = {};
Do[
fit = FindFit[data,
a + (1 - b) z + s*ndist, {a, b, s}, z,
MaxIterations -> 10000000];
AppendTo[h, fit], {j, 1, n - d - 1 - R}]
But now I need to save the different value of ndist in a list because I need to use these differents values after.
So I tried with this but it doesn't work and I don't know how I can do it.
ndist = NormalDistribution[1, 5];
distribution =
Table[Random[ndist], {i, 1, IntegerPart[(n - d)/R] - 1}];
j = 1; h = {};
Do[
fit = FindFit[data,
a + (1 - b) z + S*distribution[[j]], {a, b, S}, z,
MaxIterations -> 10000000];
AppendTo[h, fit], {j, 1, n - d - 1 - R}]
And I have this error message:
Part::partw: Part 48 of {-0.203652,<<...>>,-1.81265} does not exist. >>
FindFit::fitm: Unable to solve for the fit parameters; the design matrix is nonrectangular, non-numerical, or could not be inverted. >>
If someone can help me, I use mathematica 8 and I hope that all is clear.
Thanks for your answers
URL: , |
|