mlen {spMC} | R Documentation |
Mean Length Estimation for Embedded Markov Chain
Description
The function estimates the mean length for a d
-D spatial embedded Markov chain for a specified direction \phi
.
Usage
mlen(data, coords, loc.id, direction, mle = "avg")
Arguments
data |
a categorical data vector of length |
coords |
an |
loc.id |
a vector of |
direction |
a |
mle |
a character value. If |
Details
The mean length is the total length occupied by the k
-th category divided by the number of its embedded occurrences along lines in the direction \phi
. More robust methods are implemented, such as the trimmed mean and the trimmed median.
If the stratum lengths are censored, the maximum likelihood approach is more appropriate than the arithmetic mean. In this case, the stratum lengths are assumed to be independent realizations from a log-normal random variable. The quantity to maximize is
L(\mu_1, \ldots, \mu_K, \sigma_1, \ldots, \sigma_K) = \prod_{i = 1}^m \prod_{k = 1}^K \left[ \int_{l_i}^{l_i+u_i} \frac{1}{x \sigma_k \sqrt{2}} \exp \left\lbrace - \frac{(\log x - \mu_k)^2}{2 \sigma_k^2} \right\rbrace \right]^{z_{k, i}} \mbox{d}x,
where \boldsymbol{\mu} = (\mu_1, \ldots, \mu_K)^\top
and \boldsymbol{\sigma} = (\sigma_1, \ldots, \sigma_K)^\top
are vectors of parameters, l_i
is the observed stratum length, u_i
denotes the upper bound of the censor and z_{k, i}
denotes a dummy variable which assumes value 1 if and only if the i
-th stratum is referred to the k
-th category.
Value
A numeric vector containing the mean length for each observed category.
Author(s)
Luca Sartore drwolf85@gmail.com
References
Carle, S. F., Fogg, G. E. (1997) Modelling Spatial Variability with One and Multidimensional Continuous-Lag Markov Chains. Mathematical Geology, 29(7), 891-918.
Sartore, L. (2010) Geostatistical models for 3-D data. M.Phil. thesis, Ca' Foscari University of Venice.
See Also
Examples
data(ACM)
direction <- c(0,0,1)
# Compute the appartaining directional line for each location
loc.id <- which_lines(ACM[, 1:3], direction)
# Estimate the mean lengths for each observed category
ml <- mlen(ACM$MAT5, ACM[, 1:3], loc.id, direction, mle = "avg")
# Equivalently
gl <- getlen(ACM$MAT5, ACM[, 1:3], loc.id, direction, zero.allowed = TRUE)
ml1 <- tapply(gl$length, gl$categories, mean)