Learn R Programming

estimators (version 0.7.3)

Dirichlet-class: Dirichlet Distribution S4 Class

Description

Dirichlet Distribution S4 Class

Arguments

Value

An object of class Dirichlet.

Slots

shape

numeric. The parameter vector.

Examples

Run this code
# Classic R Stats Format
ddirich(c(0.3, 0.7), shape = c(2, 3))
set.seed(1)
rdirich(10, shape = c(2, 3))

# S4 Distribution Class
library(distr)
D <- Dirichlet(shape = c(2, 3))
d(D)(c(0.3, 0.7))
set.seed(1)
r(D)(10)

Run the code above in your browser using DataLab