User Tools

Site Tools


b:r_cookbook:probability

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
b:r_cookbook:probability [2020/05/01 22:05] – [pnorm, qnorm] hkimscilb:r_cookbook:probability [2025/09/17 08:22] (current) – [Plotting a Density Function] hkimscil
Line 309: Line 309:
 </code> </code>
  
-{{dnorm_x.png|Normal distribution plot}}+[{{:b:r_cookbook:pasted:20250917-081835.png|Normal distribution plot}}]
  
 <code>> x <- seq(from=-3, to=+3, length.out=100) <code>> x <- seq(from=-3, to=+3, length.out=100)
Line 318: Line 318:
 </code> </code>
  
-{{standard_normal_distribution.png|standard_normal_distribution}}+[{{:b:r_cookbook:pasted:20250917-081929.png|standard_normal_distribution}}]
  
-<code># The body of the polygon follows the density curve where 1 <= z <= 2 +<code>  
-region.x <- x[1 <= x & x <= 2] +# The body of the polygon follows the density curve where 1 <= z <= 2 
-region.y <- y[1 <= x & x <= 2] +region.x <- x[1 <= x & x <= 2] 
- +region.y <- y[1 <= x & x <= 2] 
-# We add initial and final segments, which drop down to the Y axis +     
-region.x <- c(region.x[1], region.x, tail(region.x,1)) +# We add initial and final segments, which drop down to the Y axis 
-region.y <- c(          0, region.y,                0) +region.x <- c(region.x[1], region.x, tail(region.x,1)) 
-polygon(region.x, region.y, density=-1, col="red")+region.y <- c(          0, region.y,                0) 
 +polygon(region.x, region.y, density=-1, col="red")
 </code> </code>
- +[{{:b:r_cookbook:pasted:20250917-082138.png|standard_normal_distribution}}]
-{{standard_normal_distribution_1-2.png|standard_normal_distribution}}+
  
b/r_cookbook/probability.1588338357.txt.gz · Last modified: 2020/05/01 22:05 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki