We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentd8c0117 commitb799769Copy full SHA for b799769
R/optim_nm.R
@@ -104,7 +104,7 @@ optim_nm <- function(fun, k = 0, start, maximum = FALSE, trace = FALSE, alpha =
104
trace_array<- rbind(trace_array, c(counter+1,simplex[1],simplex[1,-1]))# writing trace for visulaization
105
}
106
107
-R<-M+alpha* (M-simplex[k+1, c(2:(k+1))])# Reflection
+R<-as.numeric(M+alpha* (M-simplex[k+1, c(2:(k+1))]))# Reflection
108
Ry<- fun(R)
109
110
if (Ry>simplex[k,1]) {# case 1: Reflection or Expension (correct direction)
@@ -167,7 +167,7 @@ optim_nm <- function(fun, k = 0, start, maximum = FALSE, trace = FALSE, alpha =
167
kparam<-param[-(k+1)]# extracting the k best vertices from simplex
168
M<-kparam# calculating the mean of the k best points
169
170
-
+
171
End<- sqrt(sum((simplex[,1]- fun(M))^2)/ (k+1))# determine the exit out of the loop if a certain accuracy is reache
172
counter<-0
173
optimization.Rproj
@@ -18,3 +18,4 @@ StripTrailingWhitespace: Yes
18
BuildType: Package
19
PackageUseDevtools: Yes
20
PackageInstallArgs: --no-multiarch --with-keep.source
21
+PackageRoxygenize: rd,collate,namespace