AbstractDist | R Documentation |
Base class for OOP statistical distribution
This class is only used to be herited
ddist
[function] density function
pdist
[function] distribution function
qdist
[function] quantile function
rdist
[function] random generator function
ks.test
[ks.test] Goodness of fit with ks.test
fit_success
[bool] TRUE only if the fit is a success and is occurred
name
[string] name of the distribution
opt
[stats::optim result] Result of the MLE to find parameters
cov
[matrix] Covariance matrix of parameters, inverse of hessian
coef
[vector] Vector of coefficients
new()
Create a new AbstractDist object.
AbstractDist$new(ddist, pdist, qdist, rdist, name, has_gr_nlll)
ddist
[function] Density function, e.g. dnorm
pdist
[function] Distribution function, e.g. pnorm
qdist
[function] Quantile function, e.g. qnorm
rdist
[function] Random generator function, e.g. rnorm
name
[str] name of the distribution
has_gr_nlll
[bool] If the derived class has defined the gradient of the negative log-likelihood
A new 'AbstractDist' object.
rvs()
Generation sample from the histogram
AbstractDist$rvs(n)
n
[integer] Number of samples drawn
[vector] A vector of samples
density()
Density function
AbstractDist$density(x)
x
[vector] Values to compute the density
[vector] density
logdensity()
Log density function
AbstractDist$logdensity(x)
x
[vector] Values to compute the log-density
[vector] log of density
cdf()
Cumulative Distribution Function
AbstractDist$cdf(q)
q
[vector] Quantiles to compute the CDF
[vector] cdf values
sf()
Survival Function
AbstractDist$sf(q)
q
[vector] Quantiles to compute the SF
[vector] sf values
icdf()
Inverse of Cumulative Distribution Function
AbstractDist$icdf(p)
p
[vector] Probabilities to compute the CDF
[vector] icdf values
isf()
Inverse of Survival Function
AbstractDist$isf(p)
p
[vector] Probabilities to compute the SF
[vector] isf values
fit()
Fit method
AbstractDist$fit(Y, n_max_try = 100)
Y
[vector] Dataset to infer the histogram
n_max_try
[integer] Because the optim function can fails, the fit is retry n_try times.
'self'
qgradient()
Gradient of the quantile function
AbstractDist$qgradient(p, lower.tail = TRUE)
p
[vector] Probabilities
lower.tail
[bool] If CDF or SF.
[vector] gradient
qdeltaCI()
Confidence interval of the quantile function
AbstractDist$qdeltaCI(p, Rt = FALSE, alpha = 0.05)
p
[vector] Probabilities
Rt
[bool] if Probabilities or return times
alpha
[double] level of confidence interval
[list] Quantiles, and confidence interval
pdeltaCI()
Confidence interval of the CDF function
AbstractDist$pdeltaCI(x, Rt = FALSE, alpha = 0.05)
x
[vector] Quantiles
Rt
[bool] if Probabilities or return times
alpha
[double] level of confidence interval
[list] CDF, and confidence interval
diagnostic()
Diagnostic of the fitted law
AbstractDist$diagnostic(Y, alpha = 0.05)
Y
[vector] data to check
alpha
[double] level of confidence interval
[NULL]
clone()
The objects of this class are cloneable with this method.
AbstractDist$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.