diff --git a/man/dbs.Rd b/man/dbs.Rd index f054bc0..84d9286 100644 --- a/man/dbs.Rd +++ b/man/dbs.Rd @@ -60,14 +60,14 @@ qrbs( p, N, S, lower.tail = TRUE, log.p = FALSE ) The Broken-stick distribution was proposed as a model for the expected abundance of elements in a collection: - n(i) = N/S (sum(from k=i to S) 1/k) + \deqn{n(i) = \frac{N}{S} \sum_{k=i}^S 1/k}{n(i) = N/S (sum(from k=i to S) 1/k)} where n(i) is the abundance in the i-th most abundant element (MacArthur 1960, May 1975). Hence the probability (or expected proportion of occurrences) in the i-th element is - p(i) = n(i)/N = n(i) = (sum(from k=i to S) 1/k) / S + \deqn{p(i) = \frac{n(i)}{S} = S^{-1}\sum_{k=i}^S 1/k}{p(i) = n(i)/N = (sum(from k=i to S) 1/k) / S} \code{[dpq]rbs} stands for "rank-abundance Broken-stick" and return probabilities and quantiles based on the expression above, for p(i). @@ -78,7 +78,7 @@ qrbs( p, N, S, lower.tail = TRUE, log.p = FALSE ) The probability density for a given abundance value in the Broken-stick model is given by - p(x) = (1 - x/N)^(S-2) (S - 1)/N + \deqn{p(x) = \frac{S-1}{N} \left( 1 - \frac{x}{N} \right)^{S-2}}{p(x) = (1 - x/N)^(S-2) (S - 1)/N} Where x is the abundance of a given element in the collection (May 1975). \code{[dpq]bs} return probabilities and quantiles according to the diff --git a/man/dgs.Rd b/man/dgs.Rd index 025873c..e11a76c 100644 --- a/man/dgs.Rd +++ b/man/dgs.Rd @@ -52,12 +52,12 @@ qgs( p, k, S, lower.tail = TRUE, log.p = FALSE ) proportion of occurrences) of the i-th most abundant element in a collection: - p(i) = C * k * (1-k)^(i-1) + \deqn{p(i) = C k (1-k)^{i-1}}{p(i) = C * k * (1-k)^(i-1)} where C is a normalization constant which makes the summation of p(i) over S equals to one: - C = 1/(1 - (1-k)^S) + \deqn{C = \frac{1}{1 - (1-k)^S}}{C = 1/(1 - (1-k)^S)} where S is the number of species in the sample. diff --git a/man/dls.Rd b/man/dls.Rd index 630d2d2..015d5ba 100644 --- a/man/dls.Rd +++ b/man/dls.Rd @@ -46,18 +46,18 @@ qls(p, N, alpha, lower.tail = TRUE, log.p = FALSE) was originally proposed by Fisher (1943) to relate the expected number of species in a sample from a biological community to the sample size as: - S = alpha * log(1 + N/alpha) +% \deqn{S = \alpha \log \left( 1 + \frac{N}{\alpha} \right)}{S = alpha * log(1 + N/alpha)} Where alpha is the single parameter of the log-series distribution, often used as a diversity index. From this relation follows that the expected number of species with x individuals in the sample is - S(x) = alpha*X^x/x + \deqn{S(x) = \alpha \, \frac{X^x}{x}}{S(x) = alpha*X^x/x} Where X is a function of alpha and N, that tends to one as the sample size N increases: - X = N / (alpha+ N) + \deqn{X = \frac{N}{\alpha + N}}{X = N / (alpha+ N)} The density function used here is derived by Alonso et al. (2008, supplementary material). In ecology, this density distribution gives @@ -67,7 +67,7 @@ qls(p, N, alpha, lower.tail = TRUE, log.p = FALSE) random variables that follow a log-series distribution. Thus, a random sample of a log-series is also a log-series distribution. - Hence, a log-series distribution is a model for species + Therefore, a log-series distribution is a model for species abundances distributions (SAD) under the assumptions that (a) species abundances in the community are independent identically distributed log-series variables, (b) sampling is a Poisson process, (c) @@ -126,4 +126,4 @@ all.equal(pls(10,N=1000,alpha=50), sum(dls(1:10,N=1000,alpha=50))) # should be T ## qls is the inverse of pls all.equal(qls(CDF,N=100,alpha=5), x) # should be TRUE - } +} diff --git a/man/dman.Rd b/man/dman.Rd index 2e7ed7e..3dca18b 100644 --- a/man/dman.Rd +++ b/man/dman.Rd @@ -50,7 +50,7 @@ qmand( p, N, s, v, lower.tail = TRUE, log.p = FALSE) of a given element from a set of \code{N} elements. This probability is inversely proportional to a power \code{s} of the rank of the frequency of the element in the set. The density function is - p(x) = ((x+v)^(-s)) / sum(((1:N)+v)^(-s)) + \deqn{p(x) = \frac{(x+v)^{-s}}{\sum_{i=1}^N (i+v)^{-s}}}{p(x) = ((x+v)^(-s)) / sum(((1:N)+v)^(-s))} Since p(x) is proportional to a power of \code{x}, the Zipf-Mandelbrodt distribution is a power distribution. The Zipf distribution is a special case when diff --git a/man/dmzsm.Rd b/man/dmzsm.Rd index f0cd926..8e28f62 100644 --- a/man/dmzsm.Rd +++ b/man/dmzsm.Rd @@ -59,12 +59,12 @@ pmzsm(q, J, theta, lower.tail=TRUE, log.p=FALSE) Alonso and McKane (2004) proposed an approximation for the density function for a large Poisson sample (J>100): - p(x) = N(x)/(sum(from 1 to S) N(x)) + \deqn{p(x) = \frac{N(x)}{\sum_1^S N(x)}}{p(x) = N(x)/(sum(from 1 to S) N(x))} where S is the number of populations in the sample, and N(x) is the expected number of sampled populations of size x : - N(x) = theta/x (1 - x/J)^(theta -1) + \deqn{N(x) = \frac{\theta}{x (1 - x/J)^{\theta -1}}}{N(x) = theta/x (1 - x/J)^(theta -1)} Therefore, the mZSM is a model for species diff --git a/man/dpareto.Rd b/man/dpareto.Rd index a89a6d3..503f6cf 100644 --- a/man/dpareto.Rd +++ b/man/dpareto.Rd @@ -54,15 +54,13 @@ values \code{NaN}, with a warning. \details{ The Pareto distribution is a continuous power-law density distribution -with \code{scale} and \code{shape} parameters with the form: +with \code{scale} (a) and \code{shape} (b) parameters with the form: -f(x) = shape * scale^shape / x^(shape+1) +\deqn{f(x) = \frac{b a^b} {x^{b+1}}}{f(x) = shape * scale^shape / x^(shape+1)} For all x >= scale, and -f(x) = 0 - -otherwise. +f(x) = 0 otherwise. The shape parameter is known as Pareto's index or tail index, and increases the decay of f(x). This distribution was originally used to diff --git a/man/dpoilog.Rd b/man/dpoilog.Rd index 1339797..96a0c46 100644 --- a/man/dpoilog.Rd +++ b/man/dpoilog.Rd @@ -46,10 +46,12 @@ qpoilog( p, mu, sig, S = 30, lower.tail = TRUE, log.p = FALSE) where its single parameter lambda is a random variable with lognormal distribution. The density function is - p(x) = (exp(x*mu + x^2*sig/2)*(2*pi*sig)^(-1/2))/x! * g(y) + \deqn{p(x) = \frac{e^{x \mu + x^2 \sigma/2} (2 \pi \sigma)^{-1/2}}{x!} + \, g(y)}{p(x) = (exp(x*mu + x^2*sig/2)*(2*pi*sig)^(-1/2))/x! * g(y)} - where g(y) = - int_-infty^infty exp(-exp(y))*exp(((-y-mu-x*sig)^2)/(2*sig)) dy + where + \deqn{g(y) = \int_{-\infty}^\infty \, e^{-e^y} \frac{e^{(-y-\mu-x + \sigma)^2}}{2 \sigma} \, dy}{g(y) = int_-infty^infty exp(-exp(y))*exp(((-y-mu-x*sig)^2)/(2*sig)) dy} (Bulmer 1974 eq.5). For x = 0, 1, 2, ... . diff --git a/man/dpoix.Rd b/man/dpoix.Rd index c1496f1..ebe4769 100755 --- a/man/dpoix.Rd +++ b/man/dpoix.Rd @@ -33,8 +33,8 @@ dpoix(x, frac, rate, log=FALSE) \details{ A compound Poisson-exponential distribution is a Poisson probability distribution where its single parameter lambda, is frac*n, at which n - is a random variable with exponential distribution. Thus, the expected value and variance are E[X] = - Var[X] = frac*n . The density function is + is a random variable with exponential distribution. Thus, the expected + value and variance are E[X] = Var[X] = frac*n . The density function is p(y) = rate*frac^y / (frac + rate)^(y+1) diff --git a/man/dpower.Rd b/man/dpower.Rd index df20dfc..571e07e 100644 --- a/man/dpower.Rd +++ b/man/dpower.Rd @@ -46,10 +46,10 @@ qpower( p, s, lower.tail= TRUE, log.p=FALSE) The power density is a discrete probability distribution defined for integer x > 0: - p(x) = x^(-s) / zeta (s) + \deqn{p(x) = \frac{x^{-s}}{\zeta (s)}}{p(x) = x^(-s) / zeta (s)} Hence p(x) is proportional to a - negative power of 'x', given by the 's' exponent. The Riemann's zeta + negative power of 'x', given by the 's' exponent. The Riemann's \eqn{\zeta}{zeta} function is the integration constant. The power distribution can be used as a species abundance distribution (sad) model, which diff --git a/man/dzipf.Rd b/man/dzipf.Rd index 0b37b24..dca8732 100644 --- a/man/dzipf.Rd +++ b/man/dzipf.Rd @@ -49,7 +49,7 @@ qzipf( p, N, s, lower.tail = TRUE, log.p = FALSE) law, this probability is inversely proportional to a power \code{s} of the frequency rank of the element in the set. The density function is - p(x) = (x^(-s)) / sum((1:N)^(-s)) + \deqn{p(x) = \frac{x^{-s}}{\sum_{i=1}^N i^{-s}}}{p(x) = ((x+v)^(-s)) / sum(((1:N)+v)^(-s))} Since p(x) is proportional to a power of \code{x}, the Zipf distribution is a power distribution. The Zeta distribution is a special case at the limit diff --git a/man/trueLL.Rd b/man/trueLL.Rd index e99d352..b88ba23 100644 --- a/man/trueLL.Rd +++ b/man/trueLL.Rd @@ -6,7 +6,7 @@ \alias{trueLL,fitsad,ANY,missing,missing,numeric-method} \alias{trueLL,numeric,character,list,ANY,numeric-method} -\title{True likelihood for continuous variables}} +\title{True likelihood for continuous variables} \description{ Calculates the correct likelihood for independent observations of a diff --git a/vignettes/sads_intro.Rnw b/vignettes/sads_intro.Rnw index cca8f34..ea3a6e4 100644 --- a/vignettes/sads_intro.Rnw +++ b/vignettes/sads_intro.Rnw @@ -17,7 +17,7 @@ \newcommand{\R}{{\sf R}} \newcommand{\code}[1]{\texttt{#1}} \SweaveOpts{eval=TRUE, keep.source=TRUE, echo=TRUE} -\VignetteIndexEntry{Introduction to sads} +%\VignetteIndexEntry{Introduction to sads} \begin{document}