Displaying 3 results from an estimated 3 matches for "eval_g0".
Did you mean:
eval_f0
2013 Feb 15
1
minimizing a numerical integration
...such that the integration over y is minimum. Here is my code, it is not
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 = li...
2013 Feb 18
2
error: Error in if (is.na(f0$objective)) { : argument is of length zero
...delta-(1-x[2])*z_i)/x[2]))-s
H[i,j]<-pnorm(up,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)/3)
}
# constraint function
eval_g0 <- function(x) {m1<-100
t1<-2*m1+1
H1<-matrix(data=NA,nrow=t1,ncol=t1)
I1<-diag(t1)
delta1<-2*x[1]/t1
z1<--x[1]+.5*delta1
range11<-t1
for (i1 in 1:range11){
z_i1=-x[1]+(i1-.5)*delta1
for (j1 in 1:range11){
up1<-((-x[1]+j1*delta1-(1-x[2])*z_i1)/x[2])...
2013 Feb 27
0
A program running for a too long time
...1)*delta-(1-x[2])*z_i)/x[2]))-y
H[i,j]<-pnorm(up,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),...