make.prerun.object {FLightR} | R Documentation |
combines data, calibration and sets up priors
Description
This function is one step before run.particle.filter
. It combines data, calibration, spatial extent and movement priors and estimates spatial likelihoods that used later in the particle filter.
Usage
make.prerun.object(
Proc.data,
Grid,
start,
end = start,
Calibration,
threads = -1,
Decision = 0.05,
Direction = 0,
Kappa = 0,
M.mean = 300,
M.sd = 500,
likelihood.correction = TRUE
)
Arguments
Proc.data |
Processed data object created by |
Grid |
Spatial grid created by |
start |
release location (lat, lon). |
end |
end of the track location. Will use |
Calibration |
Calibration object created by |
threads |
number of parallel threads to use. default is -1, which means FLightR will use all available threads except 1. Value 1 will force sequential evaluation |
Decision |
prior for migration probability values from 0 to 1 are allowed |
Direction |
Direction prior for direction of migration (in degrees) with 0 pointing to the North |
Kappa |
concentration parameter for vonMises distribution, 0 means uniform or even distribution. Will set some prior for direction for all the track, so is not recommended to be changed |
M.mean |
Prior for mean distance travelled between consecutive twilights, km |
M.sd |
Prior for sd of distance travelled between consecutive twilights, the higher the value is the wider is the the distribution |
likelihood.correction |
Should likelihood correction estimated during |
Value
Object to be uses in the run.particle.filter
Author(s)
Eldar Rakhimberdiev
Examples
File<-system.file("extdata", "Godwit_TAGS_format.csv", package = "FLightR")
# to run example fast we will cut the real data file by 2013 Aug 20
Proc.data<-get.tags.data(File, end.date=as.POSIXct('2013-07-02', tz='GMT'))
Calibration.periods<-data.frame(
calibration.start=NA,
calibration.stop=as.POSIXct("2013-08-20", tz='GMT'),
lon=5.43, lat=52.93)
#use c() also for the geographic coordinates, if you have more than one calibration location
# (e. g., lon=c(5.43, 6.00), lat=c(52.93,52.94))
print(Calibration.periods)
# NB Below likelihood.correction is set to FALSE for fast run!
# Leave it as default TRUE for real examples
Calibration<-make.calibration(Proc.data, Calibration.periods, likelihood.correction=FALSE)
Grid<-make.grid(left=0, bottom=50, right=10, top=56,
distance.from.land.allowed.to.use=c(-Inf, Inf),
distance.from.land.allowed.to.stay=c(-Inf, Inf))
all.in<-make.prerun.object(Proc.data, Grid, start=c(5.43, 52.93),
Calibration=Calibration, threads=2)