search for: log_arg

Displaying 2 results from an estimated 2 matches for "log_arg".

2019 Feb 04
2
nlminb with constraints failing on some platforms
...2 : n ) { +?????????????? result <- result + log( (x[i] - x[i-1])^2 + 0.01 ) + (x[1] - 1.0)^2 +?????? } +?????? result + } > g??? <- function(x) { +?????? result <- rep(0.0, n) +?????? for( i in 2 : n ) { +?????????????? result[1]?? <- result[1] + 2.0 * (x[1] - 1.0) +?????????????? log_arg???? <- ( x[i] - x[i-1] )^2 + 0.01 +?????????????? log_arg_i?? <- 2.0 * (x[i] - x[i-1]) +?????????????? result[i]?? <- result[i]?? + log_arg_i / log_arg +?????????????? result[i-1] <- result[i-1] - log_arg_i / log_arg +?????? } +?????? result + } > xstart <- rep(0.0, n) > opt?...
2019 Jan 28
8
nlminb with constraints failing on some platforms
I've noticed unstable behavior of nlminb on some Linux systems. The problem can be reproduced by compiling R-3.5.2 using gcc-8.2 and running the following snippet: f <- function(x) sum( log(diff(x)^2+.01) + (x[1]-1)^2 ) opt <- nlminb(rep(0, 10), f, lower=-1, upper=3) xhat <- rep(1, 10) abs( opt$objective - f(xhat) ) < 1e-4 ## Must be TRUE The example works perfectly when