Learn R Programming

spMC (version 0.2.2)

mlen: 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 = FALSE)

Arguments

Value

A numeric vector containing the mean length for each observed category.

Rdversion

1.1

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$.

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.

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

which.lines

Examples

Run this code
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)

# Equivalently
gl <- getlen(ACM$MAT5, ACM[, 1:3], loc.id, direction, zero.allowed = TRUE)
ml1 <- tapply(gl$length, gl$categories, mean)

Run the code above in your browser using DataLab