4
When I use the command
n0 <- nls(Y~expo.der(x, A, B, C), data=dados_Indice, start=start, na.omit(NA), trace = TRUE)
expo.der is the name of the created function that defines the formula used in regression, changed to MM
MM <- deriv3(~(A*x/(B+x))+C,c("A", "B", "C"),function(x, A, B, C) NULL)
About the start values I’m using
(A)0.9707976, (B)14.50896 e (C) 0.02920242
As previously requested the output for > dput(head(data_Indice, 20)) is
structure(list(Y = c(0.504968267320704, 0.580320008623638, 0.591987263077176,
0.507128952150783, 0.471443542762971, 0.487690808524229, 0.550025947056627,
0.517020993324232, 0.649271477040753, 0.543409645706519, 0.476085216626585,
0.420887866612052, 0.587785676649722, 0.546330880659742, 0.598972408502253,
0.60582105500102, 0.537834815210853, 0.535468008413421, 0.532758019489451,
0.471561274553937), x = c(20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20)), .Names = c("Y",
"x"), row.names = c(NA, 20L), class = "data.frame")
the algorithm returns an error by exceeding the maximum number of iterations. Looking at some alternatives, the recommended solution was to include the command nls.control
as an attribute of the method nls
, the result, therefore, was the command below
n0 <- nls(Y~MM(x, A, B, C), data=dados_Indice, start=start, control=nls.control(maxiter = 200, tol = 1e-05, minFactor = (1/2)^30), trace = TRUE, na.omit(NA))
However, after these changes, executing the above command returns the following error:
Error in match.arg(algorithm) : 'arg' must be NULL or a character vector
Why is this error shown? And what can I do to bypass it by running the function nls
, according to the established control?
na.omit(NA)
does not make much sense, omit the only value passed to the function, seehelp("na.omit")
. 2) Without a data set it is difficult to say why the error, please edit the question with the output ofdput(head(dados_Indice, 20))
and the values ofstart
. 3) In which package can we find the functionexpo.der
? If it does not come from an external package, once again edit the question with your code, please.– Rui Barradas