在概率单纯形上绘制曲线 [英] Plotting a curve on probability simplex
问题描述
我想绘制由给出的概率向量的参数曲线(p_1,p_2,p_3)
I would like plot the parametric curve (p_1,p_2,p_3) of probability vectors given by
p_1 = 1/3 +(10/3)t,p_2 = 1/3-(2/3)t,p_3 = 1/3-(8/3)t
p_1 = 1/3 + (10/3)t, p_2 = 1/3 - (2/3)t, and p_3 = 1/3 - (8/3)t
使得p_1,p_2,p_3> = 0(注意方程已经满足p_1 + p_2 + p_3 = 1)的概率为单纯形{{p_1,p_2,p_3):p_1,p_2,p_3> = 0并且p_1 + p_2 + p_3 = 1}.
such that p_1, p_2, p_3 >= 0 (note that the equations already satisfy p_1 + p_2 + p_3 = 1) on the probability simplex {(p_1,p_2,p_3) : p_1, p_2, p_3 >= 0 and p_1 + p_2 + p_3 = 1}.
我希望将其视为2D图,即单纯形平面中的曲线.有没有办法在Matlab中做到这一点?有人可以帮忙吗?
I would like to see this as a 2D plot, i.e., a curve in the simplex plane. Is there a way to do this in matlab? Can someone help?
我使用了3D图
ezplot3('1/3 + 10/3 * t','1/3-2/3 * t','1/3-8/3 * t',[-5,1/8])
ezplot3('1/3+10/3*t','1/3-2/3*t','1/3-8/3*t',[-5,1/8])
但这并不能给我关于曲线的好主意.
But this doesn't give me a good idea about the curve.
推荐答案
如果这是一条曲线,这就是我在MATLAB中的绘制方式:
This is how I would plot it in MATLAB, if it were a curve :
clf, clc, clear all
%% First lets draw a 2-simplex (three vertices).
line_width = 2;
k=2; %2-simplex
simplex_vertices = eye(k+1);
%% for plotting
figure(1), clf,
simp_vert = [simplex_vertices, simplex_vertices(:,1)];
plot3(simp_vert(1,:),simp_vert(2,:),simp_vert(3,:));
hold on
%% Now let s generate t within some range
t = -0.1:0.001:0.1;
x1 = (1/3) + (10/3).*t;
x2 = (1/3) - (2/3)*t;
x3 = (1/3) - (8/3)*t;
%check: sum(x) is equal to 1
%% Plotting
plot3(x1, x2, x3, 'go', 'LineWidth',line_width);
据我了解,虽然您有一行..constant(1/3)+ vector(v)* scalar(t)定义了一行.
As I understand it, you have a line though.. constant(1/3) + vector(v)*scalar(t) defines a line.
这篇关于在概率单纯形上绘制曲线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!