How to create normal distribution with positive integers in matlab with bell shape graph?

5 次查看(过去 30 天)
From the scripts below, the cracks were distributed randomly in the rock formation with dimensions of 200x200. The crack density is estimated from the scripts and the histograms of crack density and final crack lengths are plotted. My task is to distribute the cracks not randomly but probabilistically with normal distribution. I have edit the rand code in matlab to randn (which normally distributes the random numbers). Since in matlab normal distribution using positive and negative integers, the negative integers were eliminated with abs code which uses only absolute integers via converting negative integers to positive since I cannot have negative cracks.
t = 0.2 + 0.1.*randn(L,L);
r = abs(t);
z = r<porosity;
The 0.2 and 0.1 are referred as mean and standard deviation so I made them up in order to get bell shaped distribution. For normal distribution, the graph should be bell shaped but from the edited scripts I am getting half of the bell shape and it is not evenly distributed as it normally distributes. Is there any ways of getting normal distribution with bell shape?
  6 个评论
dpb
dpb 2017-4-5
编辑:dpb 2017-4-5
Typo, sorry...there's an 'f' missing--
ecdfhist % Emprical CDF Histogram function (Statistics Toolbox)
Regular old }hist| will work; if it doesn't show the tails, not large enough sample size or number of bins is probably the cause; increase both.
I gotta' meeting in town, gotta' run...
ADDENDUM
OK, am back...here's example of what was alluding to--
Three histograms of lognrnd, first two with 100 samples but default 10 then 20 bins (red/cyan outlines, respectively), then 1000 samples and 50 bins (white). The shape improves with resolution and number of samples altho is a long tail for even the lower; that's just what lognormal does. How much depends on the shape factor, of course.
Image Analyst
Image Analyst 2017-4-6
Can you post an image of your cracks to help us better visualize it? Also, do you have the Statistics and Machine Learning Toolbox? And, FYI, you might look at RANDRAW: http://www.mathworks.com/matlabcentral/fileexchange/7309-randraw

请先登录,再进行评论。

回答(1 个)

dpb
dpb 2017-4-4
编辑:dpb 2017-4-5
Gargle is your friend... :)
has a list of a half-dozen candidate distributions with references to previous validations of their appropriateness.
Suitability and use of different PDFs to characterize the
statistical variation of fracture geometrical parameters.
PDF Length Orientation Location
Normal No Yes No
Lognormal Yes No No
Exponential Yes No No
Power law Yes No No
Fisher No Yes No
Poisson No No Yes
These were in light of some Monte Carlo study methods; I've no idea if has any bearing to your problem but just from a "reasonableness" of physical characteristics I can see reasons for the choices above, particularly for throwing out the normal as a length distribution for the problems you have if nothing else.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by