How to plot normal distribution of a 24x45x65 matrix - showing in parabola curve
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
Hey
i wanna plot a normal distribution, parabola form of a 24x45x65 matrix. the matrix means: 24 hours x 45 days x 63 customers, (last customer have more data then rest) the parabola plot is showing me like this: http://upload.wikimedia.org/wikipedia/commons/8/8c/Standard_deviation_diagram.svg i will include the data.
the diagram should be showing me how many percent of the data is more than the mean(right side) and how many is less than mean (left side) etc..
thanks for helping :D i love u guys
Accepted Answer
Star Strider
on 27 Apr 2014
Didn’t we do this in Normal Distribution - using 24x45x65 matrix. - How to do this?? I calculated three vectors for your data in this code. The median, the value for which half the data are above and half below (for each hour, which is what you requested previously) in the pmdn vector. In the second loop, the gtmen vector gives the number of data greater than the mean for each hour, and ltmen the number of data less than the mean for each hour, and pctgt gives the percent greater than the mean. The pmen vector is the mean for each hour:
load x_weekday
xwkd = x_weekday;
for k1 = 1:size(xwkd,1)
hrdata = xwkd(k1,:,:);
pmdn(k1) = median(hrdata(:)); % Median for each hour
end
for k1 = 1:size(xwkd,1)
hrdata = xwkd(k1,:,:);
hrvct = hrdata(:);
pmen(k1) = mean(hrvct); % Mean for each hour
gtmen(k1) = length(find(hrvct > pmen(k1))); % Number > Mean for each hour
ltmen(k1) = length(find(hrvct < pmen(k1))); % Number < Mean for each hour
pctgt(k1) = 100*gtmen(k1)/length(hrvct); % Percent greater than mean
end
7 Comments
because its not shown in parabola form..im requested to show it in parabola.. :(. if u can help me with this your the best :)..
thats why :p
Star Strider
on 27 Apr 2014
Edited: Star Strider
on 27 Apr 2014
If you want to see them as individual distributions, use the ribbon plot. Here is the additional code to produce it:
figure(5)
ribbon(Z)
xlabel('Hour')
ylabel('kWh')
zlabel(' Probability')
view(-160, 60)
grid on
This produces:

Put that code directly following figure(4) in the previous code that I referred to in my Answer. Please note that it is not a parabola but a normal distribution.
ok thank you m8..you are very good at this :D. but how come my data for 1 customer cannot be plotted in a parabola. like in standard deviation...showing X percentage at right side of curve and x on left..where mid is mean.. i used something called difitool. but cant really make it 100% functional
but thank you strider
you are a genius, i hope i will figure it out with help of someone :P
Star Strider
on 27 Apr 2014
Edited: Star Strider
on 27 Apr 2014
This plot is for all customers, but plotting the data for individual customers is easy enough, as we discussed in your other threads. I believe Customers are the third dimension of your array, so it is easy to choose one or a range of customers to plot.
It can’t be plotted as a parabola because it isn’t a parabola. By definition (and the Central Limit Theorem), standard errors are normally distributed, with the calculated mean and with the standard deviation of the distribution equal to the standard error, defined as:
stderr = std(x)/sqrt(length(x));
for any vector x. What I plotted here was the normal probability density given the data you posted and the analysis you requested. That the results were not as you expected them to be does not make them wrong.
awda
on 27 Apr 2014
hey
then how is it possible that in wikipedia and dozen other sites, they only talk about that parabola..and its simpler to understand that..than the 3D plot we have obtained..cuz i cannot talk much about this to be honest. maybe i havent got a hold of it..i searched net to find a similar of understanding of what it is showing and what am i getting out of it..no luck..
thank you again :D
Star Strider
on 27 Apr 2014
Edited: Star Strider
on 27 Apr 2014
My pleasure!
With respect to understanding the standard error and standard deviation, I again refer you to the Wikipedia article on it. Wikipedia explains Standard error of mean versus standard deviation clearly.
awda
on 4 May 2014
Hi star, can you take a look on this post please :)..i know you know how to. thanks alot man :) http://www.mathworks.com/matlabcentral/answers/128119-creating-a-axbxcxd-out-of-axb-matrix-using-reshape-code-included-little-help-needed#answer_135530
More Answers (0)
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Tags
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)