How do I create a pair of matrices approximating a convex hull of a set of points in 2-space?

조회 수: 1 (최근 30일)
I am trying to approximate the convex hull of payoffs for a 2x2 normal form game. The inputs would be the four points defining the payoffs at each of the four pure strategy outcomes, plus a factor k that would define the increments (and matrix sizes) of the approximating Row and Column player payoffs of the convex hull of payoffs. (So if k=10, the outputs would be a pair of 11x11 matrices UR and UC where UR has the convex hull payoffs for Row at 1/10 increments and UC has the convex hull of payoffs for Column at 10 point increments.)
My motivating problem is I'm trying to analyze an discretized approximation of a 2-playey bargaining problem that's constructed by creating the convex hull of payoffs for a 2x2 coordination game.
  댓글 수: 8
Matt J
Matt J 2014년 6월 10일
편집: Matt J 2014년 6월 10일
It is also possible that the mapping is nonlinear. For example, there is no linear/affine mapping that satisfies
(0,0) maps to (0,0)
(0,1) maps to (0,1)
(1,0) maps to (1,0)
(1,1) maps to (2,2)

댓글을 달려면 로그인하십시오.

답변 (2개)

José-Luis
José-Luis 2014년 6월 10일
편집: José-Luis 2014년 6월 10일
Assuming linear mapping:
Not the most efficient thing out there, but it serves as a proof of concept. The important thing is that your vertices must be ordered either clockwise or counterclockwise:
%You need to provide ordered vertices either clockwise or counterclockwise
unit_square = [0,0;...
0,1;...
1,1;...
1,0];
mapped_poly = [2,1;...
7,3;...
4,10;...
1,2];
unit_square = [unit_square;unit_square(1,:)];
mapped_poly = [mapped_poly;mapped_poly(1,:)];
patch(unit_square(:,1),unit_square(:,2),'r','FaceAlpha',0.5);
hold on;
patch(mapped_poly(:,1),mapped_poly(:,2),'g','FaceAlpha',0.5);
point_to_project = rand(1,2);
x = point_to_project(1);
y = point_to_project(2);
plot(x,y,'ks');
bottom_position = mapped_poly(1,:) + x .* (mapped_poly(2,:) - mapped_poly(1,:));
right_position = mapped_poly(2,:) + y .* (mapped_poly(3,:) - mapped_poly(2,:));
top_position = mapped_poly(3,:) + (1 - x) .* (mapped_poly(4,:) - mapped_poly(3,:));
left_position = mapped_poly(4,:) + (1 - y) .* (mapped_poly(1,:) - mapped_poly(4,:));
%fit linear polynomial
p1 = polyfit([bottom_position(1) top_position(1)] ,[bottom_position(2) top_position(2)],1);
p2 = polyfit([left_position(1) right_position(1)] ,[left_position(2) right_position(2)],1);
%calculate intersection
x_intersect = fzero(@(x) polyval(p1-p2,x),3);
y_intersect = polyval(p1,x_intersect);
plot(x_intersect,y_intersect,'ks');

Matt J
Matt J 2014년 6월 10일
편집: Matt J 2014년 6월 10일
If the mapping is a known linear/affine one, u=A*x+b, then you can do
T=[A,b;[0 0 1]];
[x,y]=ndgrid(linspace(0,1,10));
pre=[x(:),y(:)].';
pre(end+1,:)=1;
u=T*pre;
ux=u(1,:);
uy=u(2,:);
scatter(ux,uy)

카테고리

Help CenterFile Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by