nplr терпит неудачу, непонятно почему - PullRequest
0 голосов
/ 10 сентября 2018

Я пытался запустить функцию nplr:

require(nplr)

b<- data.frame("Conc" = c(0.03125, 0.046875, 0.0625, 0.09375, 0.1875),"BKA" =c(1.89970905356837, 98.2543214102345, 98.0660619544754, 98.1858634263221, 98.0489474584974))

nplr(x = b$Conc, y = b$BKA)

, который завершился ошибкой

Testing pars...
The 3-parameters model showed better performance
Error in nplr(x = b$Conc, y = b$BKA) : 
nplr failed and returned constant fitted values.
        Your data may not be appropriate for such model. 
In addition: Warning message:
In nlm(f = .sce, p = .initPars(x, y, 5), x = x, yobs 
= y, .weight,  :
  NA/Inf replaced by maximum positive value

У кого-нибудь есть идеи, почему он дает эту ошибку?

1 Ответ

0 голосов
/ 10 сентября 2018

Поскольку nplr ожидает, что значения ответа будут в диапазоне от 0 до 1, вы можете изменить масштаб значения y, разделив на 100, и ошибка исчезнет, ​​например ::

require(nplr)
require(dplyr)

b<- data.frame("Conc" = c(0.03125, 0.046875, 0.0625, 0.09375, 0.1875),"BKA" =c(1.89970905356837, 98.2543214102345, 98.0660619544754, 98.1858634263221, 98.0489474584974))

b <- 
    b %>% 
    mutate(BKA = BKA/100)

nplr(x = b$Conc, y = b$BKA)
...