make.prerun.object: combines data, calibration and sets up priors

Description Usage Arguments Value Author(s) Examples

View source: R/data_preparation.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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 get.tags.data.

Grid

Spatial grid created by make.grid.

start

release location (lat, lon).

end

end of the track location. Will use start by default. Use NA in case of unknown end point.

Calibration

Calibration object created by make.calibration.

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 make.calibration run be used?

Value

Object to be uses in the run.particle.filter

Author(s)

Eldar Rakhimberdiev

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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)

FLightR documentation built on July 6, 2021, 5:08 p.m.