Error in df(X0) : argument “df1” is missing, with no default--tracing R code
问题 I have written two gradient descent functions and in the second one I just have the alpha parameter and the initial alpha is different. I receive a weird error and was unable to trace the reason for it. Here's the code: k=19000 rho.prime<-function(t,k) ifelse (abs(t)<=k,2*t,(2*k*sign(t))) dMMSE <- function(b,k=19000, y=farmland$farm, x=farmland$land){ n = length(y) a=0 d=0 for (i in 1:n) { a = a + rho.prime(y[i]-b[1]-b[2]*x[i],k) d = d + x[i]*rho.prime(y[i]-b[1]-b[2]*x[i],k) } a <- (-a/n) d <