Skip to content

Commit

Permalink
Merge pull request #63 from davidanthoff/fix-garchfit
Browse files Browse the repository at this point in the history
Fix garchFit error
  • Loading branch information
andreasnoack committed Jul 22, 2016
2 parents 906bf81 + dd6b66c commit 136ea7e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions REQUIRE
Expand Up @@ -3,3 +3,4 @@ Distributions
StatsBase
TimeSeries 0.5.11
Optim
NLopt
2 changes: 1 addition & 1 deletion src/GARCH.jl
Expand Up @@ -101,7 +101,7 @@ function garchFit(data::Vector)
lower_bounds!(opt,[1e-10, 0.0, 0.0])
upper_bounds!(opt,[1; 0.3; 0.99])
min_objective!(opt, garchLike)
(minf,minx,ret) = Optim.optimize(opt, [1e-5, 0.09, 0.89])
(minf,minx,ret) = NLopt.optimize(opt, [1e-5, 0.09, 0.89])
converged = minx[1]>0 && all(minx[2:3].>=0) && sum(minx[2:3])<1.0
H = cdHessian(minx,x->garchLLH(rets,x))
cvar = -inv(H)
Expand Down
1 change: 1 addition & 0 deletions src/TimeModels.jl
Expand Up @@ -5,6 +5,7 @@ using Distributions
using StatsBase
using TimeSeries
using Optim
using NLopt

import Base: show

Expand Down

0 comments on commit 136ea7e

Please sign in to comment.