Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Regression Nonlinearmodelfit problems' topicStudent Support Forum > General > Archives > "Regression Nonlinearmodelfit problems"

Help | Reply To Topic
Author Comment/Response
Emanuel
01/26/12 3:09pm

Hello!

I'm having problems doing regression analysis in Mathematica 8.

1. This code turns out zero for me:

NonlinearModelFit[{{0, 495}, {10, 529}, {20, 487}, {30, 450}, {40,
447}, {50, 408}, {60, 348}, {70, 380}, {80, 354}, {90, 341}, {100,
336}, {110, 286}, {120, 324}, {130, 269}, {140, 261}, {150,
254}, {160, 244}, {170, 220}, {180, 212}, {190, 194}, {200,
214}, {210, 192}, {220, 159}, {230, 180}, {240, 173}, {250,
172}, {260, 166}, {270, 156}, {280, 157}, {290, 144}, {300, 134}},
a E^(b x), {a, b}, x, MaxIterations -> 100000]

2. These codes turns out different (Or codes in general that I try to analyse) (They're the same except that the x values in the first code is half as big as the ones in the second code. So they should turn out the same but the value b in the first code should be exactly twice as large as the value b in the second code, which is not the case. And the value on a is different in the codes aswell.):

In: Normal[NonlinearModelFit[{{0, 77}, {0.5, 75}, {1, 74}, {1.5,
73.2}, {2, 72.4}, {2.5, 71.4}, {3, 70.6}, {3.5, 69.8}, {4,
68.9}, {4.5, 68.5}, {5, 67.5}, {5.5, 67}, {6, 66.2}, {6.5,
65.5}, {7, 64.9}, {7.5, 64.2}, {8, 63.7}, {8.5, 63}, {9,
62.6}, {9.5, 62.1}, {10, 61.5}, {10.5, 61}, {11, 60.3}, {11.5,
59.7}, {12, 59.1}, {12.5, 58.5}, {13, 58}, {13.5, 57.4}, {14,
56.9}, {14.5, 56.3}, {15, 55.8}, {15.5, 55.3}, {16, 54.85}, {16.5,
54.3}, {17, 53.9}, {17.5, 53.4}, {18, 53}, {18.5, 52.6}, {19,
52.2}, {19.5, 51.8}, {20, 51.4}, {20.5, 51}, {21, 50.7}, {21.5,
50.3}, {22, 49.9}, {22.5, 49.6}, {23, 49.25}, {23.5, 49}, {24,
48.6}, {24.5, 48.3}, {25, 48}, {25.5, 47.7}, {26, 47.4}, {26.5,
47.2}, {27, 46.9}, {27.5, 46.7}, {28, 46.4}, {28.5, 46.1}, {29,
45.9}, {29.5, 45.7}, {30, 45.4}}, a E^(b x), {a, b}, x,
MaxIterations -> 100000]]
Out: 74.0075 E^(-0.0176946 x)

In: Normal[NonlinearModelFit[{77, 75, 74, 73.2, 72.4, 71.4, 70.6, 69.8,
68.9, 68.5, 67.5, 67, 66.2, 65.5, 64.9, 64.2, 63.7, 63, 62.6, 62.1,
61.5, 61, 60.3, 59.7, 59.1, 58.5, 58, 57.4, 56.9, 56.3, 55.8,
55.3, 54.85, 54.3, 53.9, 53.4, 53, 52.6, 52.2, 51.8, 51.4, 51,
50.7, 50.3, 49.9, 49.6, 49.25, 49, 48.6, 48.3, 48, 47.7, 47.4,
47.2, 46.9, 46.7, 46.4, 46.1, 45.9, 45.7, 45.4}, a E^(b x), {a, b},
x, MaxIterations -> 100000]]
Out: 74.6652 E^(-0.00884732 x)

I gladly accept any help that I can get!
Thanks in advance!

URL: ,
Help | Reply To Topic