Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.4K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Fit function to data points

Posted 10 years ago

I am trying to fit one of the following exponential functions: Single function:

f(x) = A Exp{0.246914 (Bx + Cx + Dx Tan[(Ex)/Abs[x]] + Fx Tan[(Gx)/Abs[x]])} 
or

Piecewise function:

f(x) = H Exp{0.246914 (Jx + Kx * Tan[(Lx)/Abs[x]]} when x <= 6.01,
f(x) = M Exp{0.246914 (Nx + Px * Tan[(Qx)/Abs[x]]} when x  > 6.01

where A-Q are my parameters to estimate, to the following data points in the form of {x, y ± SD}:

Data = {{-25.0557, 46.2353 ± 3.6647}, {-20.0402, 19.8755 ± 1.3245}, {-14.9826, 8.81128 ± 0.70872}, {-10.0622, 4.55529 ± 0.42471}, {-6.99956, 5.07824 ± 0.48176}, {-5.9132, 4.10301 ± 0.65699}, {-5.46469, 2.86411}, {-4.95324, 2.24395}, {-4.50649, 2.24285},
{-3.99629, 2.50684}, {-3.42064, 1.62128}, {-2.97376, 1.53177}, {-2.46419, 2.23783},
{-2.01618, 1.35258}, {-1.56993, 1.70514}, {-0.994403, 0.907996}, {0.0269966, 0.728654},
{1.99718, 6.55914 ± 0.89086}, {4.03483, 9.82546 ± 1.37454}, {6.00577, 15.1255 ± 1.6745},
{7.98462, 14.8553 ±1.3447}, {9.00413, 16.0022 ± 1.7978}, {9.96008, 16.9724 ± 1.4276},
{10.9822, 16.2626 ± 1.7374}, {11.9967, 20.9461 ± 2.2539}, {14.9932, 23.149 ± 2.351},
{16.9673, 26.2387 ± 2.9613}, {19.8972, 30.3869 ± 4.2131}}

so, how can I get the best fit to these data points? Thank you for your help on this matter.

2 Replies

Jim, Sorry for the typos in my question as it was just for the clear presentation of the question. I got the fit using the piecewise function. Thanks.

Posted 10 years ago

Have you tried NonlinearModelFit? You'll also need to format your equations using square brackets rather than curly brackets and separate x from the coefficients with a space.

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