when we create a function why we use -(minus) in return, in R program see this example
f <- function(pars) {
L <- (n*log(pars[1]))+(n*pars[1]*log(T1))+(n*pars[1]*log(pars[2]))-
(n*log((T1^pars[1])-(pars[2]^pars[1])))- ((pars[1]+1)*sum(log(pars[2]+x)))
return(-L)
}
here why we use (-L) in return what if I use return (L)
The sourse of example Error in f(x, ...) : argument "x" is missing, with no default in nlm