dist_fit: Fit a vector of variables to the best distribution

Description Usage Arguments Details See Also Examples

View source: R/dist_fit.R

Description

Automatically detect which distributions are appropriate to the data using Maximum Likelihood Estimation, then find the log likelihood and return the parameters of the best fitting distribution. For example, fit the degree distribution to see if a power law distribution best describes the data.

Usage

1
dist_fit(variable, only.best = TRUE)

Arguments

variable

A vector of values describing a graph theory metric of interest.

only.best

Return only the parameters for the best fitting distribution (default is TRUE) or all distributions (FALSE).

Details

First the function detects whether or not any negative values are present. If so, distributions that require all positive values are excluded. Next, the data are fit to the appropriate distributions and the log likelihood is used to select the best fitting model. This function was primarily designed for assessing whether or not the degree distribution or strength distribution of a graph follows the power law, but can also be used to fit distributions to other metrics (ie, eigenvector centrality, clustering coefficient, etc).

See Also

strength_distribution

Examples

1
2
3
4
5
6
7
**## Not run:**
k = degree(graph)
distr = dist_fit(k)

s = strength(graph)
distr = dist(s)
## End(**Not run**)

abnormally-distributed/rsfcNet documentation built on March 8, 2020, 5:32 p.m.