Displaying 1 result from an estimated 1 matches for "currentbestvalue".
2002 Nov 25
3
Full enumeration, how can this be vectorized
...newRes) && newRes < res)
{
res = newRes
best.x <- x[i]
best.y <- y[j]
best.z <- z[k]
}
}
return (c(
best.x,
best.y,
best.z))
}
fun <- function(x, par, currentBestValue=Inf)
{
x = x[1]
y = x[2]
z = x[3]
TMax <- length(par)
result <- 0
for (myT in 1:TMax)
{
result <- result +
(
((x * z) / (y-1) * (1 - (z / (z + myT))^(y-1) ))
- par[myT]
)^2
# Allow for short-cut evaluation if running in complete enumeration mode...