b:r_cookbook:probability
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
b:r_cookbook:probability [2025/09/17 08:19] – [Plotting a Density Function] hkimscil | b:r_cookbook:probability [2025/09/17 08:22] (current) – [Plotting a Density Function] hkimscil | ||
---|---|---|---|
Line 318: | Line 318: | ||
</ | </ | ||
- | [{{: | + | [{{: |
- | < | + | < |
- | > 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], | + | # We add initial and final segments, which drop down to the Y axis |
- | > region.y <- c( 0, region.y, | + | region.x <- c(region.x[1], |
- | > polygon(region.x, | + | region.y <- c( 0, region.y, |
+ | polygon(region.x, | ||
</ | </ | ||
- | + | [{{: | |
- | {{standard_normal_distribution_1-2.png|standard_normal_distribution}} | + | |
b/r_cookbook/probability.1758064779.txt.gz · Last modified: 2025/09/17 08:19 by hkimscil