rv_ratio_histogram: rv_ratio_histogram

rv_ratio_histogramR Documentation

rv_ratio_histogram

Description

rv_ratio_histogram distribution in OOP way.

Details

Fit separatly P( X < x | X > 0 ) and P(X=0)

Public fields

rvXp

[ROOPSD::rv_histogram] Describes P(X < x | X > x0)

x0

[double] location of mass: P( X = x0 )

p0

[double] p0 = P( X = x0 )

Methods

Public methods


Method new()

Create a new rv_ratio_histogram object.

Usage
rv_ratio_histogram$new(...)
Arguments
...

If a param 'Y' and 'x0' is given, the fit method is called with '...'.

Returns

A new 'rv_ratio_histogram' object.


Method rvs()

Generation sample from the histogram

Usage
rv_ratio_histogram$rvs(n)
Arguments
n

[integer] Number of samples drawn

Returns

A vector of samples


Method cdf()

Cumulative Distribution Function

Usage
rv_ratio_histogram$cdf(q)
Arguments
q

[vector] Quantiles to compute the CDF

Returns

cdf values


Method icdf()

Inverse of Cumulative Distribution Function

Usage
rv_ratio_histogram$icdf(p)
Arguments
p

[vector] Probabilities to compute the CDF

Returns

icdf values


Method sf()

Survival Function

Usage
rv_ratio_histogram$sf(q)
Arguments
q

[vector] Quantiles to compute the SF

Returns

sf values


Method isf()

Inverse of Survival Function

Usage
rv_ratio_histogram$isf(p)
Arguments
p

[vector] Probabilities to compute the SF

Returns

isf values


Method fit()

Fit method for the histograms

Usage
rv_ratio_histogram$fit(Y, x0, bins = as.integer(100))
Arguments
Y

[vector] Dataset to infer the histogram

x0

[double] Location of mass point

bins

[vector or integer] bins values

Returns

'self'


Method clone()

The objects of this class are cloneable with this method.

Usage
rv_ratio_histogram$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

## Generate sample
X = numeric(10000)
X[1:2000] = 0
X[2001:10000] = stats::rexp( n = 8000 , rate = 1 )

## And fit it
rvX = rv_ratio_histogram$new()
rvX$fit( X , x0 = 0 )


ROOPSD documentation built on Sept. 11, 2023, 9:06 a.m.