1

In the spatstat package, why doesn't the markvario function allow distances greater than 1/4 of the window length for variogram calculation?

markvario(X, correction = c("isotropic", "Ripley", "translate"), r = NULL, method = "density", ..., normalise=FALSE)

The argument r is a numeric vector. The values of the argument r at which the mark variogram gamma(r) should be evaluated.

The window length for the spruces dataset is 200m, but the variogram plot shows distances until 50m only, even specificating r to [0, 200].

plot(markvario(longleaf,r=seq(0,200, by=0.5))) marked variogram for spruces

1 Answers1

0

The function markvario returns an object of class fv (function values). It’s effectively a data.frame with additional attributes. One attribute tells the plot command (dispatched to plot.fv) the recommended plotting range. If you look at the bottom of the printed output you will see that r runs from 0 to 200 but the recommended range is 0 to 50. You override the default with the xlim argument:

library(spatstat)
rslt <- markvario(longleaf,r=seq(0,200, by=0.5))
rslt
#> Function value object (class 'fv')
#> for the function r -> gamma(r)
#> ...........................................................................
#>       Math.label               
#> r     r                        
#> theo  {gamma[]^{iid}}(r)       
#> trans {hat(gamma)[]^{trans}}(r)
#> iso   {hat(gamma)[]^{iso}}(r)  
#>       Description                                       
#> r     distance argument r                               
#> theo  theoretical value (independent marks) for gamma(r)
#> trans translation-corrected estimate of gamma(r)        
#> iso   Ripley isotropic correction estimate of gamma(r)  
#> ...........................................................................
#> Default plot formula:  .~r
#> where "." stands for 'iso', 'trans', 'theo'
#> Recommended range of argument r: [0, 50]
#> Available range of argument r: [0, 200]
#> Unit of length: 1 metre
plot(rslt, xlim = c(0, 200))

Ege Rubak
  • 4,347
  • 1
  • 10
  • 18
  • Good to hear. If you like, you can go ahead and accept the answer so it doesn't appear as unsolved for future readers. – Ege Rubak Aug 13 '19 at 20:19