testYaps: Test YAPS core functionality

View source: R/testYaps.R

testYapsR Documentation

Test YAPS core functionality

Description

Run testYaps() to check that the core functions of YAPS is working correctly. Output should be a random simulated (black) and estimated (red) track.

Usage

testYaps(
  silent = TRUE,
  pingType = "sbi",
  est_ss = TRUE,
  opt_fun = "nlminb",
  opt_controls = list(),
  return_yaps = FALSE,
  tmb_smartsearch = TRUE
)

Arguments

silent

Logical whether to print output to the console

pingType

Type of transmitter to simulate - either stable burst interval ('sbi'), random burst interval ('rbi') or random burst interval but where the random sequence is known a priori

est_ss

Logical whether to test using ss_data_what = 'est' (est_ss = TRUE) or ss_data_what = 'data' (est_ss = FALSE)

opt_fun

Which optimization function to use. Default is opt_fun = 'nlminb' - alternative is opt_fun = 'nloptr' (experimental!). If using nloptr, opt_controls must be specified.

opt_controls

List of controls passed to optimization function. For instances, tolerances such as x.tol=1E-8.
If opt_fun = 'nloptr', opt_controls must be a list formatted appropriately. For instance:
opt_controls <- list( algorithm="NLOPT_LD_AUGLAG", xtol_abs=1e-12, maxeval=2E+4, print_level = 1, local_opts= list(algorithm="NLOPT_LD_AUGLAG_EQ", xtol_rel=1e-4) ).
See ?nloptr and the NLopt site https://nlopt.readthedocs.io/en/latest/ for more info. Some algorithms in nloptr require bounded parameters - this is not currently implemented.

return_yaps

Logical whether to return the fitted yaps model. Default=FALSE.

tmb_smartsearch

Logical whether to use the TMB smartsearch in the inner optimizer (see ?TMB::MakeADFun for info). Default and original implementation is TRUE. However, there seems to be an issue with recent versions of Matrix that requires tmb_smartsearch=FALSE.

Value

If return_yaps == TRUE, the fitted yaps object. See ?runYaps for further info.

Examples


#' # To test  basic functionality of yaps using simulated data
testYaps()
# # # Three pingTypes are availabe: 
# # #	fixed burst interval (testYaps(pingType='sbi')), 
# # # 	random burst interval with UNKNOWN burst interval sequence('testYaps(pingType='rbi')), 
# # # 	random burst interval with KNOWN burst interval sequence (testYaps(pingType='pbi'))


baktoft/yaps documentation built on Nov. 12, 2023, 2:30 p.m.