# 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 ABF specified number of Monte Carlo replicates and particles per replicate
abfd_bm <- abf(b, Nrep=2, Np=10, nbhd=bm_nbhd)
# Get the likelihood estimate from ABF
logLik(abfd_bm)
}
Run the code above in your browser using DataLab