Message Boards Message Boards

0
|
679 Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Does anybody have problems with the output of NonlinearModelFit with 14.1?

Posted 4 months ago

I do not get the usual model of which I can get the properties. I get instead a strange write up:

FittedModel[<|"Type" -> "Nonlinear", 
  "Model" -> {{ao -> 0.385554, a1 -> 1.75161, x1 -> 0.00034315, 
     a2 -> 7.04307, 
     x2 -> 0.0000666828}, {{x}, {ao + a1/(1 + x^2/x1^2) + a2/(
       1 + x^2/x2^2)}}}, "Weights" -> <|"ExampleWeights" -> 1|>, 
  "InputData" -> {{0.000036, 7.56014}, {0.0000600001, 
     6.01243}, {0.0001, 4.12235}, {0.000166667, 2.79906}, {0.00027778,
      1.83703}, {0.000462968, 1.12616}, {0.00077162, 
     0.740692}, {0.00128605, 0.518736}}, 
  "Localizer" -> 
   Function[Null, 
    Internal`LocalizedBlock[{a1, a2, ao, x, x1, x2}, #1], {HoldAll}], 
  "Options" -> {}|>]
POSTED BY: Stefano Vitale
6 Replies

I have the exact same problem. Not sure how to overcome it. Properties and options don't work either.

The problem was in the input from my side. My problem solved.

Posted 3 months ago

May you please tell us more. I have tried with various simulated data. the results that shows up in the weird output above is correct, but the output is of no use..

I have also run the same instruction in mathematica 14:0 and it works perfectly

Thanks

POSTED BY: Stefano Vitale

Sure. It is shameful to admit, but my hasty input led to the ridiculous error:

PolyNom = NonlinearModelFit[Data, {A0 + A1x + A2x^2 + A3*x^3 + A4x^4 + A5x^5 + A6x^6 + A7x^7 + A8x^8 + A9x^9 + A10*x^10 + A11x^11 + A12x^12 + A13x^13 + A14x^14 + A15x^15 + A16x^16 + A17x^17 + A18x^18 + A19x^19 + A20x^20}, {A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20}, x]

Here I used brackets "{}" in the formula part rather than only in the coefficient part of the Nonlinearmodelfit.

If this is not your case, I suggest you should try some Nonlinearmodelfit examples from wolfram help. If those examples work, than the problem is in your data or other input errors.

Posted 3 months ago

Thanks. My code is right and, as I said, works perfectly in Mathematica 14:0, so must be my 14.1 which is corrupted.

I'm waiting for an answer from wolfram support

Thanks anyway

POSTED BY: Stefano Vitale
Posted 3 months ago

Hi Viacheslav, I have solved the problem.

The reason was the one you have pointed to: in 14.0 you could enclose the fitting function between {}. In 14.1 you still can, but only if you have extra conditions. I'm attaching two screenshot that illustrate the question.

Thanks for you help

POSTED BY: Stefano Vitale
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract