flimoptim_Julia | R Documentation |

Computes several parameter inferences with Julia optimizer and either IPNewton with or without Automatic Differentiation, Nelder-Mead or Brent method.

```
flimoptim_Julia(
ndraw,
data = NULL,
dsumstats = NULL,
simulatorQ = NULL,
julia_obj = NULL,
nsim = 10,
ninfer = 1,
lower = 0,
upper = 1,
Theta0 = (lower + upper)/2,
randomTheta0 = FALSE,
AD = TRUE,
method = "",
obj_threshold = Inf,
number_tries = 1,
maxit = 1000,
time_limit = NULL,
xtol = 0,
ftol = 0,
gtol = 1e-08,
reltol = sqrt(.Machine$double.eps),
abstol = .Machine$double.eps,
show_trace = FALSE,
store_trace = FALSE,
store_quantiles = FALSE,
par_names = NULL,
load_julia = FALSE
)
```

`ndraw` |
Integer. Number of random variables to draw for one simulation of the model. |

`data` |
1D array containing the observations. |

`dsumstats` |
Summary statistics to measure distance between simulations and data. String containing the script of the Julia function dsumstats(simulations, data). The name "dsumstats" is mandatory. |

`simulatorQ` |
Simulator of the stochastic process with fixed quantiles (see README). simulatorQ(Theta, quantiles). The name "simulatorQ" is mandatory. Theta is the parameter set for the simulations and quantiles are drawn in U(0,1). |

`julia_obj` |
Objective function to minimize. Default : is directly computed from dsumstats and simulatorQ. String containing the script of the Julia function julia_obj(Theta, quantiles). Warning : can be tricky to call data. The name "julia_obj" is mandatory. |

`nsim` |
Integer. Number of simulations to run for each step of the optimization algorithm. Computation time grows linearly with this number. Default to 10. |

`ninfer` |
Integer. Number of independent inferences to run. Default to 1. |

`lower` |
1D array. Lower bounds for parameters. Same length as upper. |

`upper` |
1D array. Upper bounds for parameters. Same length as lower. |

`Theta0` |
1D array. Initial values of the parameters. Default : mean(lower, upper). |

`randomTheta0` |
Boolean. If True, Theta0 is randomly drawn between lower and upper bounds. |

`AD` |
Boolean. Only in Julia mod, uses Automatic Differentiation with IPNewton method. Default to true. |

`method` |
String. Allows to choose the optimization method : "Brent", "IPNewton" or "NelderMead". Default : IPNewton. |

`obj_threshold` |
Float. Threshold score. If Final value of objective is bigger, relaunch the inference if number_tries is not reached. The purpose is to avoid local minima. Default to Inf (no threshold). |

`number_tries` |
Integer. Number of tries (inferences) for the objective value to reach a point lower than obj_threshold. Default to 1. |

`maxit` |
Integer. Max number of iterations during optimization. Default to 1000. |

`time_limit` |
Float. Time limit in second for each inference. Default to no limit. Not available for Brent method. |

`xtol` |
Float. With IPNewton method : xtol option in Optim.Options. Default to 0. |

`ftol` |
Float. With IPNewton method : ftol option in Optim.Options. Default to 0. |

`gtol` |
Float. With IPNewton method : gtol option in Optim.Options. Default to 1e-8. |

`reltol` |
Float. With Brent method : reltol of Optim.optimize. Default is sqrt(.Machine$double.eps), about 1e-8. |

`abstol` |
Float. With Brent method : abstol of Optim.optimize. Default is .Machine$double.eps, about 1e-16. |

`show_trace` |
Boolean. If true, shows standard trace. Default to false. |

`store_trace` |
Boolean. If true, stores standard trace as an array of strings. Default to false. Not available for R mod. |

`store_quantiles` |
Boolean. If true, stores every quantiles used for inference, to reproduce the results. Default to false. |

`par_names` |
vector of names for parameters. Default is "par1", ..., "parn". |

`load_julia` |
Boolean. If true, run julia_load. It can take few seconds. Default to False. |

Object of class flimo_result (list) converted from Julia object containing every information about convergence results.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.