Mathematica Asked on August 13, 2021
Consider the following data
data = {{2, -2.99380668585}, {4, -2.99413053462}, {6, -2.99439488497}, {8, -2.99467836024},
{10, -2.99491958936}, {12, -2.99519218472}, {14, -2.99538900867}, {16, -2.99562768004},
{18, -2.99584876062}, {20, -2.99601713877}, {22, -2.99619549077}, {24, -2.99637350562}}
I am trying to fit to this data the (displaced) real part of some powers of a complex number
fit = NonlinearModelFit[ data,
-a + [Rho] r^m Cos[m [Phi] + [Psi]], {a, [Rho], [Phi], [Psi], r},
m, MaxIterations -> 1000]
Even though the fit looks good
DiscretePlot[fit["BestFit"], {m, 2, 24, 2}, Epilog -> { Point[data]}]
I would like to know if the NonlinearModelFit::cvmit
error that NonlinearModelFit
shows can be removed by (somehow) improving the fit. I tried using some starting values, but I was unsuccessful.
I think there are few issues with what you're attempting to do:
Here is the issue with the parameter estimates:
fit = NonlinearModelFit[data, -a + ρ r^m Cos[m ϕ + ψ], {a, ρ, ϕ, ψ, r}, m,
MaxIterations -> 1000, Method -> "NMinimize"]
fit["ParameterTable"]
Here is the issue with the correlation matrix:
fit["CorrelationMatrix"] // MatrixForm
The model is just overparameterized given the available data. Note that if one rationalizes the data, only the P-value for $a$ remains statistically significant:
fit2 = NonlinearModelFit[Rationalize[data, 0], {-a + ρ r^m Cos[m ϕ + ψ]}, {a, ρ, ϕ, ψ, r}, m,
MaxIterations -> 1000, Method -> "NMinimize", WorkingPrecision -> 30];
fit2["ParameterTable"]
fit2["CorrelationMatrix"] // MatrixForm
Correct answer by JimB on August 13, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP