| rv_mixture | R Documentation |
rv_mixture distribution in OOP way.
No fit allowed.
l_dist[list] List of distributions.
n_dist[integer] Numbers of distribution.
weights[vector] Weights of the distributions.
new()Create a new rv_mixture object.
rv_mixture$new(l_dist, weights = NULL)
l_dist[list] List of ROOPSD distributions.
weights[vector] Weights of the distributions. If NULL, 1 / length(l_dist) is used.
A new 'rv_mixture' object.
rvs()Generation sample from the histogram
rv_mixture$rvs(n)
n[integer] Number of samples drawn
A vector of samples
density()Density function
rv_mixture$density(x)
x[vector] Values to compute the density
density
logdensity()Log density function
rv_mixture$logdensity(x)
x[vector] Values to compute the log-density
the log density
cdf()Cumulative Distribution Function
rv_mixture$cdf(q)
q[vector] Quantiles to compute the CDF
cdf values
icdf()Inverse of Cumulative Distribution Function
rv_mixture$icdf(p)
p[vector] Probabilities to compute the CDF
icdf values
sf()Survival Function
rv_mixture$sf(q)
q[vector] Quantiles to compute the SF
sf values
isf()Inverse of Survival Function
rv_mixture$isf(p)
p[vector] Probabilities to compute the SF
isf values
clone()The objects of this class are cloneable with this method.
rv_mixture$clone(deep = FALSE)
deepWhether to make a deep clone.
## Define the mixture
l_dist = list( Exponential$new() , Normal$new( mean = 5 , sd = 1 ) )
weights = base::c( 0.2 , 0.8 )
rvX = rv_mixture$new( l_dist , weights )
## Draw samples
X = rvX$rvs( 1000 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.