unuran.cont.new: Create a UNU.RAN continuous univariate distribution object

View source: R/unuran_cont.R

unuran.cont.newR Documentation

Create a UNU.RAN continuous univariate distribution object

Description

Create a new UNU.RAN object for a continuous univariate distribution. The interface might be changed in future releases. Do not use unnamed arguments!

[Advanced] – Continuous Distribution.

Usage

unuran.cont.new( cdf=NULL, pdf=NULL, dpdf=NULL, islog=FALSE,
                 lb=NA, ub=NA, mode=NA, center=NA, area=NA, name=NA)

Arguments

cdf

cumulative distribution function. (R function)

pdf

probability density function. (R function)

dpdf

derivative of the pdf. (R function)

islog

whether the given cdf and pdf are given by their logarithms (the dpdf is then the derivative of the logarithm). (boolean)

lb

lower bound of domain; use -Inf if unbounded from left. (numeric)

ub

upper bound of domain; use Inf if unbounded from right. (numeric)

mode

mode of distribution. (numeric)

center

typical point (“center”) of distribution. If not given the mode is used. (numeric)

area

area below pdf; used for computing normalization constants if required. (numeric)

name

name of distribution. (string)

Details

Creates an instance of class unuran.cont.

The user is responsible that the given informations are consistent. It depends on the chosen method which information must be given / are used.

Note

unuran.cont.new(...) is an alias for new("unuran.cont", ...).

Author(s)

Josef Leydold and Wolfgang H\"ormann unuran@statmath.wu.ac.at.

References

W. H\"ormann, J. Leydold, and G. Derflinger (2004): Automatic Nonuniform Random Variate Generation. Springer-Verlag, Berlin Heidelberg.

See Also

unuran.cont, unuran.new, unuran.

Examples

## Get a distribution object with given pdf, domain and mode
mypdf <- function (x) { exp(-x) }
distr <- unuran.cont.new(pdf=mypdf, islog=FALSE, lb=0, ub=Inf, mode=0)

## This object can now be used to create an generator object.
## 1. select a method using a Runuran function:
gen <- pinvd.new(distr, uresolution=1e-12)

## 2. directly use the UNU.RAN string API
gen <- unuran.new(distr, method="pinv; u_resolution=1e-12")


Runuran documentation built on Jan. 17, 2023, 5:17 p.m.