Displaying 6 results from an estimated 6 matches for "eval_f".
Did you mean:
eval_f0
2013 Feb 15
1
minimizing a numerical integration
...ot
working. I got an error: 'y' is missing
library('nloptr')
library('pracma')
f <- function(x,y) {#here i should put the commands representing my function
return( )
}
#constraint function
eval_g0 <- function(x) {
return( )
}
# objective function
eval_f0 <- function(x) {
romberg(f, 0.5, 0.5001)}
ARL1 <- nloptr( x0=c(0.653),
eval_f=eval_f0,
lb = c(0),
ub = c(6),
eval_g_ineq = eval_g0,
opts = list("algorithm"="NLOPT_LN_COBYLA", "maxeval&q...
2013 Jan 03
0
help with NLOPTR
...h=0.15
Cg=6240
Cs=2820
A= 100
D=0.0001
greekp=0.43
K=100000
##### Species Parameters##########
b1=0.38
p1=16654
v1 = 0.28
N1=6000
g1=1
delta1=1
b2=0.4
p2=2797
v2 = 0.31
N2=10000
g2=1
delta2=1
####################################### Objective function
############################################
eval_f = function (x) {
return(-1 * ( ( (1-alphah) *log(F) ) + ( alphah* (
(x[1]*(((N1/A)*(g1^greekp)*(x[3]^b1))+((1-exp(-2*D*v1*N1))*x[4])))
+ (x[2]*(((N2/A)*(g2^greekp)*(x[3]^b2))+((1-exp(-2*D*v2*N2))*x[4])
)) ) ) ) )
}
############################### Objective function gradient
###########...
2013 Feb 18
2
error: Error in if (is.na(f0$objective)) { : argument is of length zero
...2])*z_i1)/x[2])
H1[i1,j1]<-pnorm(up1,mean=5,sd=1)-pnorm(down1,mean=5,sd=1)}
}
K1<-solve(I1-H1)
one1 <- matrix(1,nrow=t1,ncol=1)
u1 <- matrix(0,nrow=m1,ncol=1)
y1<-c(u1, 1, u1)
z1<-t(y1)
ARLV1<-K1%*%one1
ARLV21<-t(ARLV1)
return( abs((ARLV21%*%y1)-500)-1)
}
eval_f0 <- function(x) romberg(function(s) f(x, s), 0, 6)
of <- nloptr( x0=c(0.653,0.09),
eval_f=eval_f0,
lb = c(0,0),
ub = c(6,1),
eval_g_ineq = eval_g0,
opts = list("algorithm"="NLOPT_LN_COBYLA", &q...
2013 Feb 27
0
A program running for a too long time
...mean=0,sd=1)-pnorm(down,mean=0,sd=1)}
}
K<-solve(I-H)
one <- matrix(1,nrow=t,ncol=1)
u <- matrix(0,nrow=m,ncol=1)
y<-c(u, 1, u)
z<-t(y)
ARLV<-K%*%one
ARLV2<-t(ARLV)
return(ARLV2%*%y)
}
# constraint function
eval_g0 <- function(x) abs(f(x,0)-500)-1
#objective function
eval_f0 <- function(x) romberg(function(y) ((1+y*y)*f(x,y)/6),0,6, tol =
.Machine$double.eps^(2/3))$value
obj <- nloptr( x0=c(0.653,0.09),
eval_f=eval_f0,
lb = c(0,0),
ub = c(6,1),
eval_g_ineq = eval_g0,
opts = list(&qu...
2025 Apr 30
1
Estimating regression with constraints in model coefficients
...- function(beta) sum_constraint(beta, C = 2) # example >C
> > >
>
> > > > > > > > # Run optimization
> > > > > > > > res <- nloptr(
> > > > > > > > x0 = rep(0, ncol(X)),
> > > > > > > > eval_f = objective,
> > > > > > > > lb = lower_bounds,
> > > > > > > > ub = upper_bounds,
> > > > > > > > eval_g_eq = eq_constraint,
> > > > > > > > opts = list(algorithm = "NLOPT_LD_SLSQP", xtol_rel...
2025 May 04
0
Estimating regression with constraints in model coefficients - Follow-up on Constrained Ordinal Model — Optimized via COBYLA
...aint(beta, C = 2) # example >C
>
> > > > > > > > > > # Run optimization
> > > > > > > > > > res <- nloptr(
> > > > > > > > > > x0 = rep(0, ncol(X)),
> > > > > > > > > > eval_f = objective,
> > > > > > > > > > lb = lower_bounds,
> > > > > > > > > > ub = upper_bounds,
> > > > > > > > > > eval_g_eq = eq_constraint,
> > > > > > > > > > opts = list(algorithm...