Package 'pearson7'

Title: Maximum Likelihood Inference for the Pearson VII Distribution with Shape Parameter 3/2
Description: Supports maximum likelihood inference for the Pearson VII distribution with shape parameter 3/2 and free location and scale parameters. This distribution is relevant when estimating the velocity of processive motor proteins with random detachment.
Authors: John Hughes
Maintainer: John Hughes <[email protected]>
License: GPL (>= 2)
Version: 1.0-3
Built: 2025-01-07 03:27:44 UTC
Source: https://github.com/cran/pearson7

Help Index


Evaluate the density for the Pearson VII distribution with shape parameter 3/2.

Description

Evaluate the density for the Pearson VII distribution with shape parameter 3/2.

Usage

dpearson7(x, mu = 0, sigma = 1, log = FALSE)

Arguments

x

vector of quantiles.

mu

vector of means.

sigma

vector of scales.

log

logical; if TRUE, probabilities p are given as log(p).

Details

If mu is not specified, it assumes the default value of 0. If sigma is not specified, it assumes the default value of 1.

The Pearson VII distribution with location μ\mu, scale σ\sigma, and shape 3/2 has density

f(x)=1/(2σ)[1+{(xμ)/σ}2]3/2.f(x)=1/(2\sigma)[1+\{(x-\mu)/\sigma\}^2]^{-3/2}.

Value

the density.

References

Hughes, J., Shastry, S., Hancock, W. O., and Fricks, J. (2013) Estimating velocity for processive motor proteins with random detachment. Journal of Agricultural, Biological, and Environmental Statistics, in press.

Pearson, K. (1916) Mathematical contributions to the theory of evolution. xix. second supplement to a memoir on skew variation. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character, 216, 429–457.

See Also

ppearson7, qpearson7, rpearson7

Examples

curve(dpearson7(x), -5, 5, lwd = 2, n = 500, ylab = "f(x)")
curve(dnorm(x), lwd = 2, lty = 2, n = 500, add = TRUE)

Find the MLE for a sample from the Pearson VII distribution with shape parameter 3/2.

Description

Find the MLE for a sample from the Pearson VII distribution with shape parameter 3/2.

Usage

pearson7.fit(y, mu0 = median(y), sigma0 = sqrt(3) * median(abs(y -
  median(y))), tol = 1e-08)

Arguments

y

a vector of observations.

mu0

an initial value for μ\mu.

sigma0

an initial value for σ\sigma.

tol

the convergence tolerance.

Details

This function uses a Newton-Raphson algorithm to find the MLE. The starting values for μ\mu and σ\sigma are the sample median and 3\sqrt{3} times the sample MAD, respectively. See the reference for details.

Value

pearson7.fit returns an object of class “pearson7”, which is a list containing the following components.

theta.hat

the estimates of μ\mu and σ\sigma.

hessian

the Hessian matrix evaluated at theta.hat.

iterations

the number of iterations required to attain convergence.

value

the value of the log likelihood at theta.hat.

References

Hughes, J., Shastry, S., Hancock, W. O., and Fricks, J. (2013) Estimating velocity for processive motor proteins with random detachment. Journal of Agricultural, Biological, and Environmental Statistics, in press.

See Also

pearson7.objective

Examples

y = rpearson7(100, 100, 10)
fit = pearson7.fit(y)
fit
summary(fit)

Compute the negative log likelihood for a sample.

Description

Compute the negative log likelihood for a sample.

Usage

pearson7.objective(params, y)

Arguments

params

a vector of parameter values.

y

a vector of observations.

Details

This function computes the negative log likelihood for (μ,σ)(\mu,\sigma) given a sample. This function can be optimized using optim, but it is better to use pearson7.fit.

Value

the negative log likelihood.

See Also

dpearson7, pearson7.fit


Evaluate the distribution function for the Pearson VII distribution with shape parameter 3/2.

Description

Evaluate the distribution function for the Pearson VII distribution with shape parameter 3/2.

Usage

ppearson7(q, mu = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE)

Arguments

q

vector of quantiles.

mu

vector of means.

sigma

vector of scales.

lower.tail

logical; if TRUE (default), probabilities are P(Xx)P(X\le x), otherwise P(X>x)P(X>x).

log.p

logical; if TRUE, probabilities p are given as log(p).

Details

If mu is not specified, it assumes the default value of 0. If sigma is not specified, it assumes the default value of 1.

The Pearson VII distribution with location μ\mu, scale σ\sigma, and shape 3/2 has cdf

F(x)={1+(xμ)/σ2+(xμ)2}/2.F(x)=\{1+(x-\mu)/\sqrt{\sigma^2+(x-\mu)^2}\}/2.

Value

the probability.

References

Hughes, J., Shastry, S., Hancock, W. O., and Fricks, J. (2013) Estimating velocity for processive motor proteins with random detachment. Journal of Agricultural, Biological, and Environmental Statistics, in press.

See Also

dpearson7, qpearson7, rpearson7

Examples

curve(ppearson7(x), 0, 5, lwd = 2, ylim = c(0.8, 1), ylab = "F(x)")
curve(pnorm(x), lwd = 2, lty = 2, add = TRUE)

Evaluate the quantile function for the Pearson VII distribution with shape parameter 3/2.

Description

Evaluate the quantile function for the Pearson VII distribution with shape parameter 3/2.

Usage

qpearson7(p, mu = 0, sigma = 1, lower.tail = TRUE, log.p = FALSE)

Arguments

p

vector of probabilities.

mu

vector of means.

sigma

vector of scales.

lower.tail

logical; if TRUE (default), probabilities are P(Xx)P(X\le x), otherwise P(X>x)P(X>x).

log.p

logical; if TRUE, probabilities p are given as log(p).

Details

If mu is not specified, it assumes the default value of 0. If sigma is not specified, it assumes the default value of 1.

The Pearson VII distribution with location μ\mu, scale σ\sigma, and shape 3/2 has quantile function

F1(x)=μ+(σ/2)(2x1)/x(1x).F^{-1}(x)=\mu+(\sigma/2)(2x-1)/\sqrt{x(1-x)}.

Value

the quantile.

References

Hughes, J., Shastry, S., Hancock, W. O., and Fricks, J. (2013) Estimating velocity for processive motor proteins with random detachment. Journal of Agricultural, Biological, and Environmental Statistics, in press.

See Also

dpearson7, ppearson7, rpearson7

Examples

curve(qpearson7(x), 0, 1, lwd = 2, ylab = expression(F^{-1}*(x)))
curve(qnorm(x), lwd = 2, lty = 2, n = 500, add = TRUE)

Generate random deviates from a Pearson VII distribution with shape parameter 3/2.

Description

Generate random deviates from a Pearson VII distribution with shape parameter 3/2.

Usage

rpearson7(n, mu = 0, sigma = 1)

Arguments

n

number of observations.

mu

vector of means.

sigma

vector of scales.

Details

If mu is not specified, it assumes the default value of 0. If sigma is not specified, it assumes the default value of 1.

Value

random deviates.

References

Hughes, J., Shastry, S., Hancock, W. O., and Fricks, J. (2013) Estimating velocity for processive motor proteins with random detachment. Journal of Agricultural, Biological, and Environmental Statistics, in press.

Devroye, L. (1986) Non-Uniform Random Variate Generation. New York: Springer-Verlag.

See Also

dpearson7, ppearson7, qpearson7

Examples

y = rpearson7(1000)
hist(y, prob = TRUE, breaks = 100, col = "gray")
curve(dpearson7(x), lwd = 2, col = "blue", add = TRUE)

Print a summary of a Pearson VII fit.

Description

Print a summary of a Pearson VII fit.

Usage

## S3 method for class 'pearson7'
summary(object, alpha = 0.05, digits = 4, ...)

Arguments

object

an object of class “pearson7”, the result of a call to pearson7.fit.

alpha

the significance level used to compute the confidence intervals. The default is 0.05.

digits

the number of significant digits to display. The default is 4.

...

additional arguments.

Details

This function displays (1) a table of estimates, (2) the value of the log likelihood, and (3) the number of Newton-Raphson iterations. Each row of the table of estimates shows the parameter estimate and the approximate (1α)100%(1-\alpha)100\% confidence interval for the parameter.

See Also

pearson7.fit