How can I fit a lower tail distribution for the lower 25% of the data?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Pawan Kumar
el 9 de Feb. de 2022
Respondida: Pawan Kumar
el 10 de Feb. de 2022
I have an array of nearly 1000 data. I want to fit a normal distribution on the lower tail for the lower 25% data. How can i do that?
0 comentarios
Respuesta aceptada
Abolfazl Chaman Motlagh
el 9 de Feb. de 2022
Hi. here's a quick example:
%X = zeros(1000,1); % Create data
X = normrnd(2,1.5,1000,1);
X_sort = sort(X); % sort data by their values
X_first_quarter = X_sort(1:ceil(0.25*numel(X))); % select lower 25 percent
Prob_dist = fitdist(X_first_quarter,'Normal'); % fit normal distribution
figure; hold on;
histogram(X_first_quarter,'Normalization','pdf');
histogram(X,'Normalization','pdf','FaceAlpha',0.2);
x_values = -5:0.05:5;
y_values = pdf(Prob_dist,x_values);
plot(x_values,y_values,'LineWidth',3,'Color','r')
legend('probability density function of first quarteer','probability density function of all data','fitted normal distribution')
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Descriptive Statistics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!