Description Usage Arguments Details Value References See Also Examples
View source: R/generalized_wishart.R
A function of class measurement_model
that calculates likelihood,
gradient, hessian, and partial derivatives of nuisance parameters and the
Laplacian generalized inverse, using the generalized Wishart model described in
McCullagh (2009), Peterson et al (2019).
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 |
Number of genetic markers |
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 |
Unused |
validate |
Numerical validation via package |
The nuisance parameters are the scaling of the generalized inverse of the graph Laplacian ("tau"; can be zero) and a log scalar multiple of the identity matrix that is added to the generalized inverse ("sigma").
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 |
McCullagh P. 2009. Marginal likelihood for distance matrices. Statistica Sinica 19 Peterson et al. 2019. TODO
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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]
generalized_wishart(laplacian_inv, melip.Fst, nu = 1000, phi = c(0.1, -0.1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.