Beta.gfx.poly.pdf: Coordinate Generation for Marking an Area Under the Curve for...

View source: R/betafunctions.R

Beta.gfx.poly.pdfR Documentation

Coordinate Generation for Marking an Area Under the Curve for the Beta Probability Density Distribution.

Description

Plotting tool, producing a two-column matrix with values of y corresponding to locations on x. Useful for shading areas under the curve when tracing the line for the Beta probability density functions.

Usage

Beta.gfx.poly.pdf(from, to, by, alpha, beta, l = 0, u = 1)

Arguments

from

The point of the x-axis from where to start producing y-density values.

to

The point of the x-axis to where y-density values are to be produced.

by

The resolution (or spacing) at which to produce y-density values.

alpha

The alpha (first) shape-parameter value for the Standard Beta probability density distribution.

beta

The beta (second) shape-parameter for the Standard Beta probability density distribution.

l

The lower-bound location parameter of the Beta distribution.

u

The upper-bound location parameter of the Beta distribution.

Value

A two-column matrix with density-values of y to plot against corresponding location values of x.

Examples

# To box in an area under a four-parameter Beta distribution with location
# parameters l = .25 and u = .75, and shape parameters alpha = 5 and
# rbeta = 3, from 0.4 to 0.6:
plot(NULL, xlim = c(0, 1), ylim = c(0, 7))
coords <- Beta.gfx.poly.pdf(from = 0.4, to = 0.6, by = 0.001, alpha = 5,
beta = 3, l = 0.25, u = 0.75)
polygon(coords)

hthaa/betafunctions documentation built on March 10, 2024, 7:20 p.m.