Re: [R] Failure in predicting parameters

2021-03-14 Thread Luigi Marongiu
Hello, the negative data comes from the machine. Probably I should use raw data directly, although in the paper this requirement is not reported. The p$x was a typo. Now I corrected it and I got this error: ``` > rutledge_param <- function(p, x, y) ((p$M / (1 + exp(-1*(x-p$m)/p$s))) + p$B) > - y

Re: [R] Failure in predicting parameters

2021-03-14 Thread Bill Dunlap
> rutledge_param <- function(p, x, y) ((p$M / (1 + exp(-1*(p$x-p$m)/p$s))) + > p$B) - y Did you mean that p$x to be just x? As is, this returns numeric(0) for the p that nls.lm gives it because p$x is NULL and NULL-aNumber is numeric(). -Bill On Sun, Mar 14, 2021 at 9:46 AM Luigi Marongiu wro

Re: [R] Failure in predicting parameters

2021-03-14 Thread Bert Gunter
Do the negative values in your data make any sense? Note that if Fb must be >0, Fc must be also. But I have *not* examined your code/equations in detail, so feel free to ignore if this is irrelevant. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along

[R] Failure in predicting parameters

2021-03-14 Thread Luigi Marongiu
Hello, I would like to use the Rutledge equation (https://pubmed.ncbi.nlm.nih.gov/15601990/) to model PCR data. The equation is: Fc = Fmax / (1+exp(-(C-Chalf)/k)) + Fb I defined the equation and another that subtracts the values from the expectations. I used minpack.lm to get the parameters, but I