I have a nonlinear model and I use the command NonlinaerModelFit, for example I have a model with three parameters and one of them, isnt a valid parameter statistically, my question is, how can I make zero this parameter? without remake all program
You’ve got to make some changes in the code but certainly not remaking the whole program.
Here’s a two-variable example from the documentation:
SeedRandom[12345];
data = Flatten[Table[{x, y, Exp[.3 x - .7 y] + RandomReal[{-1, 1}]}, {x, 5}, {y, 5}], 1]
NonlinearModelFit[data, Exp[a x + b y], {a, b}, {x, y}]
To remove the effect of y you can just modify the NonlinearModelFit statement by removing y and its associated parameters from the function but leave in y in the variable list:
NonlinearModelFit[data, Exp[a x], {a, b}, {x, y}]
It would be even better if you removed the associated parameter from the parameter list but that is not necessary (although the result will have - in this case - b -> 1).
Thanks, I was confused because in another software, it was enought put the non-valid paramter = 0, but you have reazon your solution is good, thank you.
“…because in another software…” Mathematica is different. So is any other software.