0

I have a question: In R for Biexponential Model can I use a data that contains negatives ??? Because it gives me ERROR !!! Is it possible that the negative numbers be the reason for that Errors ?

My function for Biexponential in R is:

A1*exp(-exp(lrc1)*input)+A2*exp(-exp(lrc2)*input)

Where:

  • input - a numeric vector of values at which to evaluate the model.

  • A1 - a numeric parameter representing the multiplier of the first exponential.

  • lrc1 - a numeric parameter representing the natural logarithm of the rate constant of the first exponential.

  • A2 - a numeric parameter representing the multiplier of the second exponential.

  • lrc2 - a numeric parameter representing the natural logarithm of the rate constant of the second exponential.

Dmitriy
  • 5,525
  • 12
  • 25
  • 38
  • Can you please give example data that is causing an issue. Also, the error you are seeing would also be helpful. – steveb Jan 11 '16 at 19:55
  • input= 1.82554293 -1.15465570 1.92298028 -2.03517932 0.27720635 0.11260995 2.30357616 -1.26658578 -0.36235703 0.34116112 -1.64166322 -0.04066538 1.44557817 -0.17174340 -0.65744887 0.83922746 -0.79291094 0.16717272 -0.63189164 0.85783800 – User 9963571 Jan 11 '16 at 20:04
  • the input is the data that i have @steveb – User 9963571 Jan 11 '16 at 20:06
  • 'fm1 <- nls(SSbiexp(input, A1, lrc1, A2, lrc2), data = data.frame) Error in SSbiexp(input, A1, lrc1, A2, lrc2) : object 'lrc1' not found > fm1 <- nls(SSbiexp(input, A1, lrc1, A2, lrc2), data = input) Error in SSbiexp(input, A1, lrc1, A2, lrc2) : object 'lrc1' not found ' – User 9963571 Jan 11 '16 at 20:11
  • 1
    Your first issue is that `lrc1` is not defined. The other issue you may run into is that the exponentials will sometimes return `Inf`. – steveb Jan 11 '16 at 20:13
  • Ok, but what do you mean by 'Inf' ??? @steveb – User 9963571 Jan 11 '16 at 20:18
  • I mean infinity. If you type `1/0` in `R`, you will get `Inf` back (`-1/0` gives `-Inf`). `1/` will also give `Inf` – steveb Jan 11 '16 at 20:21
  • Ok, Thank you so much it was really helpful @steveb – User 9963571 Jan 11 '16 at 20:24

0 Answers0