predict.gv {phylin} | R Documentation |
Predict method for 'gen.variogram' object with model.
Description
Predicts values based on a fitted gen.variogram model.
Usage
## S3 method for class 'gv'
predict(object, newdata, ...)
Arguments
object |
'gv' fitted model (see 'gen.variogram'). |
newdata |
Real distances matrix to predict genetic distance by the fitted model. |
... |
Further arguments to be passed. |
Value
Returns the matrix of predicted genetic distances.
Author(s)
Pedro Tarroso <ptarroso@cibio.up.pt>
See Also
Examples
data(vipers)
data(d.gen)
# create a grid of the sampled area for interpolation
grid <- expand.grid(x=seq(-10,10,0.5), y=seq(30, 50, 0.5))
# create a distance matrix between samples
r.dist <- dist(vipers[,1:2])
# fit a variogram with defaults (spherical model) and estimation of range
gv <- gen.variogram(r.dist, d.gen)
gv <- gv.model(gv)
all.dist <- as.matrix(dist(grid))
result <- predict(gv, all.dist)
[Package phylin version 2.0.2 Index]