给出的概率向量的参数曲线(p_1,p_2,p_3)
p_1 = 1/3 + (10/3)t,p_2 = 1/3 - (2/3)t,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}.
我想把它看作二维图,也就是单纯形平面上的曲线。有办法在matlab中做到这一点吗?有人能帮忙吗?
我用了3D图
ezplot3('1/3+10/3*t','1/3-2/3*t','1/3-8/3*t',-5,1/8)
但这并不能给我一个关于曲线的好主意。
发布于 2014-08-26 13:23:39
如果它是一条曲线的话,我会用MATLAB绘制它:
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);
据我所知,你有一句台词。常数(1/3)+向量(V)*标量(T)定义了一条直线。
https://stackoverflow.com/questions/25504662
复制相似问题