funInfoFun {qAnalyst} | R Documentation |
Function to estimate distribution quantities
Description
funInfoFun
receives a vector of data and a hyphotized distribution. It estimates hyphotized distribution parameters.
Anderson Darling statistics is provided, if desidered.
Usage
funInfoFun(x, fun, adStats = TRUE)
Arguments
x |
a vector of data |
fun |
name of function density. This name is processed internally by |
adStats |
boolean value to specify if Anderson Darling statistics shall be calculated. |
Details
funInfoFun
uses switchFun
to parse given fun argument into R internal distribution nomenclature. funInfoFun
calls MASS function fitdistr
to estimate parameters (via maximum likelihood). If required andersonDarlingFun
function is called to obtain goodnes of fit statistic and corresponding p-value.
The returned list contains items that are the corresponding distribution functions to obtain random numbers, quantiles and density.
Value
A list containing the following items:
densfun |
distribution name as specified by user |
theta |
named vector containing user specification |
theta |
named vector containing parameter specification |
qfun |
corresponding internal r function to obtain quantiles |
dfun |
corresponding internal r function to obtain density |
rfun |
corresponding internal r function to obtain random values |
pfun |
corresponding internal r function to obtain CDF |
Warning
funInfoFun
estimates parameters by maximum likelihood. Numerical MLE may not always converge. Warning message are thrown in such case.
Moreover, user shall check that x
vector values lie in the natural support of the distribution specified in fun
Note
funInfoFun
returns a vector of class "infoFun".
Author(s)
Giorgio Spedicato
References
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.
See Also
Examples
data(warpTiles)
infoX=funInfoFun(x=warpTiles$warping, fun="weibull")
str(infoX)