Select a subset of the observation points at least tol m far apart as representative of the emphneighbourhood. Assign the earliest times observed in the neighbourhood to them.

filter_earliest_neigh(x)

Arguments

x

sr_obs object.

Value

Another sr_obs object with a subset of the points and the earliest times observed in the neighbourhood of each.

Details

Note that the neighbouring distance must be expressed in m, even when the coordinates are geographical.

This function reproduces the operation for all the Monte Carlo replicates if any.

For the original dataset, the neighbouring tolerance parameter is the mean value of the interval specified in its uq.

Examples

d <- data.frame(lon = runif(30), lat = runif(30), date = 1:30) ## Use between 10 and 20 % of data diameter as neighbouring ## tolerance. The main result will use exactly 15% while the ## \code{mc} replicates will use random Gaussian values from ## that interval (at 99.9%) sruq <- sr_uq(10, 0, 1, neigh_tol = c(-10, -20)) sro <- sr_obs(d, "date", uq = sruq)
#> #> Attaching package: ‘purrr’
#> The following object is masked from ‘package:testthat’: #> #> is_null
srf <- filter_earliest_neigh(sro)
#> This is INLA_19.05.19 built 2019-05-20 10:34:51 UTC. #> See www.r-inla.org/contact-us for how to get help. #> To enable PARDISO sparse library; see inla.pardiso()