Ask for help about the initializing p and y


Simon
10-25-2006, 04:04 PM
Hi,
I am a newer of Downhill Simplex method and I have a question about the initializing p and y. That is:
funk(x,y,z,b)=f1(x,y,z,b) b>0
funk(x,y,z,b)=f2(x,y,z,b) b<0
where x,y,z are variables, b is parameter known, f1,f2 are different functions known. How can I initializing p and y. There are three variables, which means that p must be 4*3 matrix. Maybe I can guess x,y,z at first, but there is only one row in p, and also one y can be got. How can I get the p(1:4, 1:3) and y(1:4)? It is best to show me an example. Thank you very much.

David Buchan
10-27-2006, 12:48 PM
Hi Simon,

I have not done pure downhill simplex - I used simulated annealing - but I believe the initialization is the same.

It seems to me you have a four dimensional problem (x,y,z, and b). So, your simplex would actually have five vertices. There should be one more vertex than the number of dimensions. You can see this by considering a two dimensional case (x,y) and then drawing a simplex, which must be a triangle (3 vertices).

Anyway, that tells me your matrix of vertex coordinates p should be p(5,4) i.e., p(vertex index, coordinate index), where p is the value of the coordinate.

Then you'd loop through your vertices, with an inner loop through your coordinates to set the initial coordinate values...

some pseudo code:

do loop vert=1 to 5 !Loop through your vertices
do loop coord=1 to 4 !Loop through your coordinates
p(vert,coord)=any value within your solution space*
end do
end do

*Make sure you each vertex has a UNIQUE set of coordinates, otherwise, you've got degeneracy, and I'm not sure how well the routine will handle that.

Then you need to initialize the value of the cost function y at each vertex (one value associated with each vertex). It has dimension 5, since you have five vertices...

some pseudo code:

do loop vert=1 to 5 !Loop through your vertices
y(vert)=funk(p) ! Find value of function at vertex
end do

How's that sound?

Dave Buchan
Toronto