Using indicators to represent variables in a distribution (Indicator Transform)
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I would like some help on how I can use indicators such as i1 - i6 to represent different ranges of variables in a distribution. The reason for this is my variables are continous and my hope is to use the indicator transform to make it categorical before I can then go on with my other coding (perturbation of the probabilities). For the indicator, I(u) = K if Z(u)<=zk for all K=0.0001,....,k K+1 if Z(u)>zk currently I have this code and will be happy for anyone to help me out; mu = 300.45; sigma = 120.5; N2 = 100; Tpf = randn(N2,1)*sigma + mu; Tpfmin= -10; %upper bound Tpfmax = 650;%lower bound h2 = 60; % bin width edges = Tpfmin:h2:Tpfmax;
% Plot histogram and distribution hist = histc(Tpf,edges); figure; bar(edges,hist,'histc'); grid on grid minor
% Overlay the distribution hold; f = @(z) N2*h2*normpdf(z,mu,sigma); fplot(f,[Tpfmin Tpfmax]);
% Put up legend. legend2 = sprintf('Tpf mean = %.3f', mean(mu)); legend(legend2);
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Data Distribution Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!