The confidence interval is obtained by using command such as “NonlinearRegress”. In my problem, I need to fit data1 with function f(k1, p1, k3, p3), and fit data2 with function f(k2, p2, k3, p3), finally get (k1, p1, k2, p2, k3, p3) with their confidence intervals…but if I use “NonlinearRegress”, I can only fit one data at a time, for example
NonlinearRegress[data1, f(k1, p1, k3, p3)]
or
NonlinearRegress[data2, f(k2, p2, k3, p3)]
… then, k3 and p3 are not unique.
So how to fit two data with two functions that share some same parameters, and then get confidence intervals?
Thanks!!
You must be using a very old version of Mathematica:
As of Version 7.0, NonlinearRegress has been superseded by
NonlinearModelFit and is part of the built-in Wolfram Language kernel.
What version are you using? Also your example doesn’t match the syntax for NonlinearRegress. Including a minimal working example would be helpful.
The following will work for NonlinearModelFit (and possibly for NonlinearRegress). Combine the two datasets and include a new column identifying the dataset and then use the Boole statement: