Version: | 1.0-3 |
Date: | 2020-05-07 |
Title: | Maximum Likelihood Inference for the Pearson VII Distribution with Shape Parameter 3/2 |
Author: | John Hughes |
Maintainer: | John Hughes <drjphughesjr@gmail.com> |
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. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Collate: | 'pearson7.R' 'zzz.R' |
RoxygenNote: | 5.0.1 |
NeedsCompilation: | no |
Packaged: | 2020-05-07 17:20:31 UTC; jphughesjr |
Repository: | CRAN |
Date/Publication: | 2020-05-08 09:30:03 UTC |
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 |
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\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 |
sigma0 |
an initial value for |
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 \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 |
hessian |
the Hessian matrix evaluated at |
iterations |
the number of iterations required to attain convergence. |
value |
the value of the log likelihood at |
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
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
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 |
log.p |
logical; if |
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-\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 |
log.p |
logical; if |
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
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 “ |
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-\alpha)100\%
confidence interval for the parameter.