Description Usage Arguments Details Value References See Also Examples
A function of class measurement_model
that calculates likelihood,
gradient, hessian, and partial derivatives of nuisance parameters and the
Laplacian generalized inverse, using the "maximum likelihood population
effects" model of Clarke et al (2002) with a non-negative slope
between genetic and resistance distance.
1 2 3 4 5 6 7 8 9 10 11 |
E |
A submatrix of the generalized inverse of the graph Laplacian (e.g. a covariance matrix) |
S |
A matrix of observed genetic distances |
phi |
Nuisance parameters (see details) |
nu |
Unused |
gradient |
Compute gradient of negative loglikelihood with regard to |
hessian |
Compute Hessian matrix of negative loglikelihood with regard to |
partial |
Compute second partial derivatives of negative loglikelihood with regard to |
nonnegative |
Force slope to be nonnegative? |
validate |
Numerical validation via package |
The nuisance parameters phi
are the intercept ("alpha"), slope ("beta"), negative log residual
deviation ("tau"), and logit-transformed correlation parameter ("rho") of the MLPE regression. If not supplied, phi
is
is estimated via maximum likelihood using package corMLPE
(github.com/nspope/corMLPE) and nlme::gls
.
TODO: formula
A list containing:
covariance |
rows/columns of the generalized inverse of the graph Laplacian for a subset of target vertices |
objective |
(if |
fitted |
((if |
boundary |
(if |
gradient |
(if |
hessian |
(if |
gradient_E |
(if |
partial_E |
(if |
partial_S |
(if |
jacobian_E |
(if |
jacobian_S |
(if |
Clarke et al. TODO
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(raster)
data(melip)
covariates <- raster::stack(list(altitude=melip.altitude, forestcover=melip.forestcover))
surface <- conductance_surface(covariates, melip.coords, directions = 8)
# inverse of graph Laplacian at null model (IBD)
laplacian_inv <- radish_distance(theta = matrix(0, 1, 2),
formula = ~forestcover + altitude,
data = surface,
radish::loglinear_conductance,
covariance = TRUE)$covariance[,,1]
mlpe(laplacian_inv, melip.Fst) #without 'phi': return MLE of phi
mlpe(laplacian_inv, melip.Fst, phi = c(0., 0.5, -0.1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.