Displaying 3 results from an estimated 3 matches for "objectivefunct".
2011 May 11
1
Problem with constrained optimization with maxBFGS
Dear all,
I need to maximize the v:
v= D' W D
D is a column vector ( n , 1)
W is a given matrix (n, n)
subject to:
sum D= 1
(BTW, n is less than 300)
I´ve tried to use maxBFGS, as follows:
#####################################
objectiveFunction<-function(x)
{
return(t(D)%*%W%*%D)
}
Amat<-diag(nrow(D))
Amat<-rbind((rep(-1, nrow(D))), Amat)
bvec<-matrix( c(0), nrow(D)+1, 1)
bvec[1,1]<-c(1)
startValues=rep(1/nrow(D),nrow(D)) #Istart value is homogeneous distribution
res <<- maxBFGS(objectiveFunction, start=startVal...
2008 Apr 26
1
How to use the optim function if the length of the objective function is greater than 1?
Hi,
Please help me out with this.Im a new user of R.
Thanks
[[alternative HTML version deleted]]
2007 Feb 14
0
environment confusion
...nd
Enter a frame number, or 0 to exit
1: profile(m0f, skiperrs = FALSE)
2: profile(m0f, skiperrs = FALSE)
3: .local(fitted, ...)
4: onestep(step)
5: eval.parent(call, 2)
6: eval(expr, p)
7: eval(expr, envir, enclos)
8: mle2(minuslogl = function (lmu = NULL, ltheta = NULL)
9: optim(start, objectivefunction, method = method, hessian = TRUE, ...)
10: function (par)
11: fn(par, ...)
12: do.call("minuslogl", args, envir = environment(minuslogl))
13: minuslogl(ltheta = 2.30970721353114, lmu = -2.18543734742826)
14: lapply(arglist1, eval, envir = data, enclos = sys.frame(sys.nframe()))
15: is....