changingn.randomday: simulates abundance data and calculates overlap for changing...

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

View source: R/changingn-randomday.R

Description

simulates abundance data and calculates overlap for changing sample sizes(crossing out days randomly)

Usage

1
2
3
4
changingn.randomday(numbersofdays = c(15, 40, 65, 85, 95, 100, 103),
  repeatings = 100, start.n = 1000, type = "beta", equal = FALSE,
  OLest = c("Weitzman", "Matusita", "Pianka", "Morisita", "Duration", "WMD",
  "Horn", "n"))

Arguments

numbersofdays

vector of numerics (whole numbers); determines how mucch days shall be excluded from datasets.

repeatings

numeric (whole numbers); Determines how often the whole procedure (data producing and calculation of the overlap) shall be repeated.

start.n

numeric (whole number); Determines the start sample size for creating the datasets. Will be passed as as 'n' argument to either BetaData() function (if type = 'beta') or to the NormData() function.

type

string; If set to beta the abundance data will bbe drawn from a beta distribution. If not beta this will be from a normal distribution.

equal

logical; if TRUE the same days (dates) will be crossed out from dataset, if FALSE there will be different days crossed out.

OLest

vector of strings; determines in which way(s) the overlap shall be determined, will be passed to OLE function.

Details

This function produces abundance data with the sample size :start.n. This data can be drawn either from a normal (sigma = 20) or a beta distribution (shape1 =1, shape2 =5 and a spread over 130 days), depending on the type argument. afterwards there is an Overlap estimation made for this data. Then the data will be modified by the randomday.crossout function, and the Overlap will be estimated again. If equal = TRUE the same days will be crossed out, if it is FALSE there will be different days crossed out for both datasets. The numbersofdays argument will determin which ddatapoints are to create, and so how many days there are to be crossed out. one dataset will be used for all numberofdays, and the days will be decreased further from an already altered dataset.This process will be repeated as many times as the reapeatings argument says. The Overlap will be determined in three different ways, with the kernel density estimatiion with fitted distributions and with 'normalization' done using the functions estdist, kernelest and normalize. A listt will be returned, that has 3 lists in it, one for the kernel ddensity estimation one for fitted distributions etc. This lists have a list stored in them for each stepsize. Those lists contain all the results of the estimations for the respective sample size and way the overlap was determined.

Value

a list. First index level determines the way of estimating the pdf so it has the three indexes: 'kernel', 'fitdistr' and 'normalize'. The second index-level is the number of crossed out days and the last the number of the repeating. In there are the results as returned by OLE function. To illustrate: list[[kernel]][[number of crossed out days]][[repeating]].

Author(s)

Florian Berger <florian_berger@ymail.com>

See Also

scale

Examples

1
changingn.randomday(numbersofdays=c(5,12), start.n = 500, repeatings = 2, type = 'normal', equal = TRUE)

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