I am trying to fit a generalized linear model using Julia's GLM package. The fitting algorithm is failing because the max number of iterations, set by default to 30, is being exceeded. Examination of the source reveals that this parameter is stored as a named argument (maxIter
) to the fit
function, which is called at the end of the glm
function if the dofit
named argument to glm
is true
(which it is by default). So I should be able to adjust the max iterations by setting dofit
to false
, creating my glm, then calling fit
manually on it with an altered maxIter
:
myGlm = glm(formula, dataframe, Poisson(), dofit=false)
fit(myGlm, maxIter=50)
But the first line of this code fails with the error message:
no method glm(Array{Any,1},Expr,DataFrame,Poisson,LogLink)
When I look at the function signatures for glm
in the source (glmfit.jl) or with help(glm)
, it's true that this signature isn't listed. But why is this the signature for my function call? Are named arguments automatically moved as an array to the beginning of the argument list, and do they need to be supported explicitly? The source in the context of This section of the Julia manual suggests my call should work.