Rather than use the R code provided in `mrds`, one can also use the binary
of `MCDS.exe`, to reproduce the results given by Distance for Windows. There
is no guarantee that one approach is "better" than the other, but `mrds`
will select the model with the better likelihood and provide answers to
this. By default (once `MCDS.exe` is available) both `MCDS.exe` and R will
be used to obtain detection function parameter estimates. To select only
to use the `MCDS.exe` optimizer set control=list(optimizer='MCDS')
or only use the R optimizer set control=list(optimizer='R')
.
The following code can be used to download `MCDS.exe` from the distance
sampling website:
download.file("http://distancesampling.org/R/MCDS.exe", paste0(system.file(package="mrds"),"/MCDS.exe"), mode = "wb")
The MCDS binary will be installed to the main directory of your your local R
mrds library. Alternatively, you can copy the `MCDS.exe` from your local
Distance for Windows installation if you prefer. The location of your local
mrds library main directory can be found by running the following in R:
system.file("MCDS.exe", package="mrds")
.
This has been tentatively tested on a mac but should currently be considered largely experimental.
One can still use MCDS.exe even if you are running a mac computer. To do this one will need to install `wine` a Windows emulator. It is important to use a version of `wine` which can run 32-bit programs.
The package will attempt to work out which `wine` binary to use (and detect if it is installed), but this doesn't always work. In this case, the location of the `wine` binary can be specified in the `control` `list` provided to `ddf` using the `winebin` element or supply the `winebin` argument to the `ds` function. For example, if `wine` is installed at `/usr/bin/local/wine` you can set `control$winebin` to that location to use that binary.
On macOS, this can be achieved using the `homebrew` package management
system and installing the `wine-crossover` package. You may need to change
the control$winebin
to be `wine`, `wine64` or `wine32on64`,
depending on your system's setup. This package tries to work out what to
do, but likely doesn't handle all corner cases. Currently this is untested
on Mac M1 systems.
Once this feature is enabled (see below) using `ddf` will always run both
its built-in R optimizer and `MCDS.exe`. To disable this behaviour remove
the `MCDS.exe` binary file. You can find it by running the following in R:
system.file("MCDS.exe", package="mrds")
.
David L Miller and Jonah McArthur
Please see our examples pages for further information: https://examples.distancesampling.org/
If you are running a non-Windows operating system, you can follow the instructions below to have `MCDS.exe` run using `wine`.