Skip to content

Commit

Permalink
Reset state before refitting
Browse files Browse the repository at this point in the history
  • Loading branch information
simonster committed Feb 24, 2014
1 parent 9b90d18 commit 29eb273
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/glmfit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ function fit(m::GlmMod, y; wts=nothing, offset=nothing, args...)
r.y = isa(y, V) ? copy(y) : convert(V, y)
wts == nothing || (r.wts = isa(wts, V) ? copy(wts) : convert(V, wts))
offset == nothing || (r.offset = isa(offset, V) ? copy(offset) : convert(V, offset))
r.mu = mustart(r.d, r.y, r.wts)
linkfun!(r.l, r.eta, r.mu)
updatemu!(r, r.eta)
fill!(m.pp.beta0, zero(eltype(m.pp.beta0)))
m.fit = false
fit(m; args...)
end
Expand Down

0 comments on commit 29eb273

Please sign in to comment.