Nonlinear regression with R

Asked

Viewed 96 times

0

I have the following data sets:

x1 <- c(0.00113, 0.00123, 0.00125, 0.0013, 0.00136, 0.0014, 0.00146,
        0.00151,0.00158,0.00163,0.00166)
x2 <- c(0.99887, 0.899, 0.79823, 0.6942, 0.59889, 0.49958, 0.39972, 
       0.29933,0.19983,0.0997,0)
x3 <- c(0,0.09977, 0.20051, 0.3045, 0.39975, 0.49902, 0.59883, 0.69916, 
        0.79859,0.89867,0.99834)
x4 <- c(-6.785538, -6.700741, -6.684612, -6.645391, -6.600271, -6.571283, -6.529319, 
      -6.495646,-6.450330,-6.419175,-6.400938)

I have the following fixed parameters:

R  <- 8.314
Tm <- 510.15
H  <- 17.7

I need to adjust the following model with 7 parameters:

NRTL <- x4~(H/R)*((1/Tm)-(1/293.15))-(((t21*exp(-a*t21)*x2)+(t31*exp(-a*t31)*x3))/((x1+(exp(-a*t21)*x2)+(exp(-a*t31)*x3)))+(x1/((x1+(exp(-a*t21)*x2)+(exp(-a*t31)*x3)))*(((-x2*t21*exp(-a*t21))-(x3*t31*exp(t31)))/(x1+(exp(-a*t21)*x2)+(exp(-a*t31)*x3)))+(((x2*exp(-a*t12))/((exp(-a*t12)*x1)+x2+(exp(-a*t32)*x3)))*(t12-(((x1*t21*exp(-a*t21))+(x3*t32*exp(-a*t32)))/((exp(-a*t12)*x1)+x2+(exp(-a*t32)*x3))))+((x3*exp(-a*t13))/((exp(-a*t13)*x1)+(exp(-a*t23)*x2)+x3))*(t13-(((x1*t13*exp(-a*t13))+(x2*t23*exp(-a*t23)/((exp(-a*t13)*x1)+(exp(-a*t23)*x2)+x3))))))))

Could someone help with the code in the R? I’m not being able to perform non-linear regression because I’m not getting reasonable values for initial parameter estimates.

Note: the parameters are as follows::

a   t12  t13  t21  t23  t31  t32
  • Finding good initial values is not a trivial process even for equations with few relations between parameters. If you understand English, or have someone who can help you with your language, I suggest you post your question on Cross Validated, the SE website for questions related to statistical methodology (the OS is specific for programming). Detail what your data is and what is the meaning of your formula and its parameters and include the tags nonlinear-regression and r

  • Thank you. I’ll take your advice!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.