How to create normal distribution with positive integers in matlab with bell shape graph?
    10 views (last 30 days)
  
       Show older comments
    
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 Comments
  dpb
      
      
 on 5 Apr 2017
				
      Edited: dpb
      
      
 on 5 Apr 2017
  
			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
      
      
 on 6 Apr 2017
				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
Answers (1)
  dpb
      
      
 on 4 Apr 2017
        
      Edited: dpb
      
      
 on 5 Apr 2017
  
      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.
0 Comments
See Also
Categories
				Find more on Logical in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

