Last data update: 2014.03.03

R: Fits all distributions
fitalldistributionsR Documentation

Fits all distributions

Description

Fits all distributions, returns an object of a special class. Prints nicely to show the statistic of the fit, and which one is the 'best fit'.

Usage

fitalldistributions(angles, fitmethod = "loglik", 
distributions = c('twoparbeta', 'ellipsoid', 'rotatedell', 'planophile', 
'erectophile', 'plagiophile', 'extremophile', 'spherical', 'uniform'), ...)

Arguments

angles

Vector of angles (0 - 90 degrees)

fitmethod

'loglik' or 'chisq'.

distributions

By default, all implemented distributions.

...

Further parameters to ftheta (none as of now).

Details

In most cases, the two-parameter beta distribution provides the best fit, because of greater flexibility.

Value

Object of class angledistlist, which has print and plot methods.

Author(s)

Remko Duursma

References

Wang W.M., Li Z.L. & Su H.B. (2007). Comparison of leaf angle distribution functions: Effects on extinction coefficient and fraction of sunlit foliage. Agricultural and Forest Meteorology, 143, 106-122.

See Also

fitdistribution

Examples


# Built-in example data
data(eteret)

# Fit all built-in distributions:
fit1 <- fitalldistributions(eteret)
fit1

# Plot one of the fitted distributions:
plot(fit1$allfits$planophile)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LeafAngle)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LeafAngle/fitalldistributions.Rd_%03d_medium.png", width=480, height=480)
> ### Name: fitalldistributions
> ### Title: Fits all distributions
> ### Aliases: fitalldistributions
> ### Keywords: misc
> 
> ### ** Examples
> 
> 
> # Built-in example data
> data(eteret)
> 
> # Fit all built-in distributions:
> fit1 <- fitalldistributions(eteret)
> fit1
  distribution       AIC  bestfit
1   twoparbeta  7965.684 best fit
2    ellipsoid  7973.202         
3   rotatedell  8146.001         
4   planophile  7975.312         
5  erectophile 12181.856         
6  plagiophile 10145.147         
7 extremophile 10048.758         
8    spherical  8123.015         
9      uniform  8675.633         
> 
> # Plot one of the fitted distributions:
> plot(fit1$allfits$planophile)
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>