NJKlappstein / hmmSSF

R package to fit state-switching step selection functions (HMM-SSFs) with covariate-dependent transition probabilities
3 stars 0 forks source link

Change documentation of maxit on the hmmSSF function #3

Closed AurelienNicosiaULaval closed 3 months ago

AurelienNicosiaULaval commented 4 months ago

Hi,

We have tried to implement a short-run long-run function with the hmmSSF function in order to quickly test multiple initial parameters (short run), pick the best one, and then run a long run. Our goal is to avoid issues with algorithm convergence based on the specific choice of initial parameters.

To achieve this, we used the maxit option in the hmmSSF function. Based on the function's help, it seems we can simply set, for example, maxit = 100 for a maximum of 100 iterations. However, doing so hmmSSF(..., maxit = 100) results in the following error:

Error in hmmSSF(ssf_formula = ssf_formula, n_states = n_states, data = data, : unused argument (maxit = 100)

In the hmmSSF function code, we can see:

function (ssf_formula, tpm_formula = ~1, n_states, data, ssf_par0,
tpm_par0 = NULL, optim_opts = list(trace = 0, maxit = 50000),
method = "Nelder-Mead")

Using the following code,hmmSSF(..., optim_opts = list(maxit = 100)), works correctly.

It would be great if you could update the documentation of the hmmSSF function to clarify that the input should be optim_opts as a list with trace and maxit.

Thanks a lot!

NJKlappstein commented 3 months ago

Hi Aurélien,

Thanks for pointing this out! I have updated the documentation in the following commit: 4502546

Hope that helps, Natasha