hw7q2: Homework 7 Question 2 Distribution

Description Usage Arguments Details Value Note See Also Examples

Description

These functions provide information about the Homework 7 Question 2 distribution. dhw7q2 gives the density, phw7q2 gives the distribution function, qhw7q2 gives the quantile function, and rhw7q2 generates random deviates.

Usage

1
2
3
4
5
6
7
dhw7q2(x, log = FALSE)

phw7q2(q, lower.tail = TRUE, log.p = FALSE)

qhw7q2(p, lower.tail = TRUE, log.p = FALSE)

rhw7q2(n)

Arguments

x, q

vector of quantiles

log, log.p

logical; if TRUE, probabilities p are given as log(p)

lower.tail

logical; if TRUE (default), probabilites are P[X ≤ x] otherwise, P[X > x]

p

vector of probabilites

n

number of observations. If length(n) > 1, the length is taken to be the number required

Details

This distribution has density

f(x) = 6x(1-x)

for 0 < x < 1

Value

dhw7q2 gives the density, phw7q2 gives the distribution function, qhw7q2 gives the quantile function, and rhw7q2 generates random deviates. The length of the result is determined by n for rnorm, and is the maximum of the lengths of the numerical arguments for the other functions. The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

Note

The characteristics of output from pseudo-random number generators (such as precision and periodicity) vary widely. See .Random.seed for more information on R's random number generation algorithms.

See Also

Uniform

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## density function
plot(dhw7q2(x = seq(0, 1, 0.0001)))

## distribution function
plot(phw7q2(q = seq(0, 1, 0.0001)))

## quantile function
qhw7q2(p = 0)
qhw7q2(p = 0, lower.tail = FALSE)
qhw7q2(p = seq(0, 1, 0.25))
plot(qhw7q2(p = seq(0, 1, 0.001)))

## random deviates
rhw7q2(n = 10)

schuelkem/samplr documentation built on May 6, 2019, 7:19 a.m.