estdist: Fits a Distribution to abundance data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/estdist.R

Description

Fits a beta and a truncated normal distribution to the abundance data.

Usage

1
2
estdist(data, StartAndEnd = NULL, returnonlyfunction = TRUE,
  forcedistrtype = NULL, CheckData = TRUE)

Arguments

data

data-frame; This is the data the distributions shall be fitted for. It must have two columns, one wih date-objects one with numeric values.

StartAndEnd

vector; In this vector shall be two date-objects, defining the range, in which the distributions shall be fitted. As default the first and last dates in the data data-frame will be selected.

returnonlyfunction

logical; If TRUE, the function will return only the Function-Object of the Results, if FALSE it will return a list with the function, distibution parameters and the used start and enddates. Default is TRUE.

forcedistrtype

string; Can either be 'normal' for the truncated normal distribution or 'beta' for beta distribution. This will force the function to only consider one of those distributions for the calculation.

CheckData

logical; If TRUE the function will check the data input whether it fits the requirements using the CheckData function. If FALSE it will process without, which might result in wrong results so to use the default value (TRUE) is strongly recommended.

Details

This function will estimate a probability density function for given time range, it takes abundance data as input. There will be a truncated normal distribution and a beta distribution fitted and their loglikelihood will be compared, and the best fitting distribution will be returned, along with its parameters and the start and end date. This function uses the 'truncnorm','stats' and the 'MASS' Package.

Value

a list with 5 levels: $func = fitted distribution as function object, $estimationmethod = 'fitted distribution', $distributiontype = name of the distribution used to create the func level, $startpoint = selected startpoint, $endpoint = selected endpoint.

Author(s)

Florian Berger <florian_berger@ymail.com>

See Also

scale

Examples

1
2
3
4
5
a     <- c(1:10)
dates <- as.Date(a, origin = '2017-01-01')
count <- c(1,1,3,4,6,9,5,4,2,1)
dat   <- data.frame(dates, count)
estdist(dat, returnonlyfunction = FALSE)

biometry/phenologicalOverlap documentation built on May 21, 2019, 2:31 a.m.