Description Usage Arguments Details Value 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 nonnegative least squares.
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"), and negative log residual
standard deviation ("tau") of the least squares regression. If not supplied, phi
is estimated via maximum likelihood by 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 |
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]
leastsquares(laplacian_inv, melip.Fst) #without 'phi': return MLE of phi
leastsquares(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.