# Complete examples are provided in the package tests
if (FALSE) {
# Create a simulation of a Brownian motion
b <- bm(U=2, N=5)
# Create a neighborhood function mapping a point in space-time
# to a list of ``neighboring points" in space-time
bm_nbhd <- function(object, time, unit) {
nbhd_list = list()
if(time > 1 && unit > 1){
nbhd_list = c(nbhd_list, list(c(unit-1, time-1)))
}
return(nbhd_list)
}
# Run ABFIR with specified number of Monte Carlo replicates and particles
# per replicate
abfird_bm <- abfir(b,
Nrep = 2,
Np=10,
nbhd = bm_nbhd,
Ninter = length(unit_names(b)))
# Get the likelihood estimate from ABFIR
logLik(abfird_bm)
}
Run the code above in your browser using DataLab