vmideal {vismeteor} | R Documentation |
Visual magnitude distribution of ideal distributed meteor magnitudes
Description
Density, distribution function, quantile function and random generation for the visual magnitude distribution of ideal distributed meteor magnitudes.
Usage
dvmideal(m, lm, psi, log = FALSE, perception.fun = NULL)
pvmideal(m, lm, psi, lower.tail = TRUE, log = FALSE, perception.fun = NULL)
qvmideal(p, lm, psi, lower.tail = TRUE, perception.fun = NULL)
rvmideal(n, lm, psi, perception.fun = NULL)
cvmideal(lm, psi, log = FALSE, perception.fun = NULL)
Arguments
m |
integer; visual meteor magnitude. |
lm |
numeric; limiting magnitude. |
psi |
numeric; the location parameter of a probability distribution. It is the only parameter of the distribution. |
log |
logical; if |
perception.fun |
function; perception probability function (optional). Default is vmperception. |
lower.tail |
logical; if |
p |
numeric; probability. |
n |
numeric; count of meteor magnitudes. |
Details
The density of an ideal magnitude distribution is
{\displaystyle f(m) = \frac{\mathrm{d}p}{\mathrm{d}m} = \frac{3}{2} \, \log(r) \sqrt{\frac{r^{3 \, \psi + 2 \, m}}{(r^\psi + r^m)^5}}}
where m
is the meteor magnitude, r = 10^{0.4} \approx 2.51189 \dots
is a constant and
\psi
is the only parameter of this magnitude distribution.
In visual meteor observation, it is common to estimate meteor magnitudes in integer values. Hence, this distribution is discrete and has the density
{\displaystyle P[M = m] \sim g(m) \, \int_{m-0.5}^{m+0.5} f(m) \, \, \mathrm{d}m} \, \mathrm{,}
where g(m)
is the perception probability.
This distribution is thus a product of the
perception probabilities and the
actual ideal distribution of the meteor magnitudes.
If the perception probabilities function perception.fun
is given,
it must have the signature function(M)
and must return the perception probabilities of
the difference M
between the limiting magnitude and the meteor magnitude.
If m >= 15.0
, the perception.fun
function should return the perception probability of 1.0
.
If log = TRUE
is given, the logarithm value of the perception probabilities
must be returned. perception.fun
is resolved using match.fun.
Value
dvmideal
gives the density, pvmideal
gives the distribution function,
qvmideal
gives the quantile function, and rvmideal
generates random deviates.
cvmideal
gives the partial convolution of the ideal meteor magnitude distribution
with the perception probabilities.
The length of the result is determined by n
for rvmideal
, and is the maximum
of the lengths of the numerical vector arguments for the other functions.
Since the distribution is discrete, qvmideal
and rvmideal
always return integer values.
qvmideal
can return NaN
value with a warning.
References
Richter, J. (2018) About the mass and magnitude distributions of meteor showers. WGN, Journal of the International Meteor Organization, vol. 46, no. 1, p. 34-38
See Also
Examples
N <- 100
psi <- 5.0
limmag <- 6.5
(m <- seq(6, -4))
# discrete density of `N` meteor magnitudes
(freq <- round(N * dvmideal(m, limmag, psi)))
# log likelihood function
lld <- function(psi) {
-sum(freq * dvmideal(m, limmag, psi, log=TRUE))
}
# maximum likelihood estimation (MLE) of psi
est <- optim(2, lld, method='Brent', lower=0, upper=8, hessian=TRUE)
# estimations
est$par # mean of psi
# generate random meteor magnitudes
m <- rvmideal(N, limmag, psi)
# log likelihood function
llr <- function(psi) {
-sum(dvmideal(m, limmag, psi, log=TRUE))
}
# maximum likelihood estimation (MLE) of psi
est <- optim(2, llr, method='Brent', lower=0, upper=8, hessian=TRUE)
# estimations
est$par # mean of psi
sqrt(1/est$hessian[1][1]) # standard deviation of psi
m <- seq(6, -4, -1)
p <- vismeteor::dvmideal(m, limmag, psi)
barplot(
p,
names.arg = m,
main = paste0('Density (psi = ', psi, ', limmag = ', limmag, ')'),
col = "blue",
xlab = 'm',
ylab = 'p',
border = "blue",
space = 0.5
)
axis(side = 2, at = pretty(p))
plot(
function(lm) vismeteor::cvmideal(lm, psi, log = TRUE),
-5, 10,
main = paste0(
'Partial convolution of the ideal meteor magnitude distribution\n',
'with the perception probabilities (psi = ', psi, ')'
),
col = "blue",
xlab = 'lm',
ylab = 'log(rate)'
)