powered by
rv_histogram distribution in OOP way.
min
[double] min value for the estimation
max
[double] max value for the estimation
tol
[double] numerical tolerance
rv_histogram$new()
rv_histogram$rvs()
rv_histogram$density()
rv_histogram$logdensity()
rv_histogram$cdf()
rv_histogram$icdf()
rv_histogram$sf()
rv_histogram$isf()
rv_histogram$fit()
rv_histogram$clone()
new()
Create a new rv_histogram object.
rv_histogram$new(...)
...
If a param `Y` is given, the fit method is called with `...`.
A new `rv_histogram` object.
rvs()
Generation sample from the histogram
rv_histogram$rvs(n)
n
[integer] Number of samples drawn
A vector of samples
density()
Density function
rv_histogram$density(x)
x
[vector] Values to compute the density
density
logdensity()
Log density function
rv_histogram$logdensity(x)
[vector] Values to compute the log-density
the log density
cdf()
Cumulative Distribution Function
rv_histogram$cdf(q)
q
[vector] Quantiles to compute the CDF
cdf values
icdf()
Inverse of Cumulative Distribution Function
rv_histogram$icdf(p)
p
[vector] Probabilities to compute the CDF
icdf values
sf()
Survival Function
rv_histogram$sf(q)
[vector] Quantiles to compute the SF
sf values
isf()
Inverse of Survival Function
rv_histogram$isf(p)
[vector] Probabilities to compute the SF
isf values
fit()
Fit method for the histograms
rv_histogram$fit(Y, bins = as.integer(1000))
Y
[vector] Dataset to infer the histogram
bins
[vector or integer] bins values
`self`
clone()
The objects of this class are cloneable with this method.
rv_histogram$clone(deep = FALSE)
deep
Whether to make a deep clone.
Use quantile to fit the histogram
## Generate sample X = numeric(10000) X[1:5000] = stats::rnorm( n = 5000 , mean = 2 , sd = 1 ) X[5000:10000] = stats::rexp( n = 5000 , rate = 1 ) ## And fit it rvX = rv_histogram$new() rvX$fit(X)
Run the code above in your browser using DataLab