Shifting Bivariate Distribution to a New Center

3 visualizaciones (últimos 30 días)
Thomas Rodriguez
Thomas Rodriguez el 9 de Abr. de 2022
Comentada: Torsten el 10 de Abr. de 2022
Hello,
I need help shifting the center of a bivariate distribution. Using MATLAB's example,
mu = [0 0];
Sigma = [0.25 0.3; 0.3 1];
x1 = -3:0.2:3;
x2 = -3:0.2:3;
[X1,X2] = meshgrid(x1,x2);
X = [X1(:) X2(:)];
y = mvnpdf(X,mu,Sigma);
y = reshape(y,length(x2),length(x1));
figure(1)
surf(x1,x2,y)
% caxis([min(y(:))-0.5*range(y(:)),max(y(:))])
% axis([-3 3 -3 3 0 0.4])
xlabel('x1')
ylabel('x2')
zlabel('Probability Density')
I would like to shift this distribution to a new center of (2,2). As of now, it's centered at (0,0).
I know that this could be done during the plotting of the distribution. But I would like to shift the entire distribution utilizing the same x1 and x2 arrays.

Respuesta aceptada

Torsten
Torsten el 9 de Abr. de 2022
mu = [2 2];
instead of
mu = [0 0];
  2 comentarios
Thomas Rodriguez
Thomas Rodriguez el 9 de Abr. de 2022
Is there a way to shift the distribution without chaning mu? Or is this the only possibility?
Torsten
Torsten el 10 de Abr. de 2022
The center is the mean - so this is the only possibility.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by