get.density.function: Get a function that calculates the density for the...

get.density.functionR Documentation

Get a function that calculates the density for the distribution

Description

A convenience function that packages up a call to calculate.density on this distribution into its own stand-alone function (which could be passed along as an argument to other functions)

Usage

get.density.function(dist, default.log = T, n.sim = 1000)

Arguments

dist

An object of class Distribution or a subclass

default.log

Whether the returned function should calculate the density on the log scale (by default, the returned function can have a log parameter set explicitly)

n.sim

If the values are to be calculated by random sample generation, how many random samples to generate

Value

A function that takes two arguments. The first, mandatory, is 'x' - the values of the parameters at which to calculate the density. May be either a vector, if the density at a single point is desired, or a matrix where each row represents one point and each column represents a variable in the distribution The second, optional, is 'log' - whether to calculate the density on the log scale. By default, log is set to default.log


tfojo1/distributions documentation built on July 27, 2024, 3:29 p.m.