Skip to content

Instantly share code, notes, and snippets.

View matthieugomez's full-sized avatar

Matthieu Gomez matthieugomez

View GitHub Profile
87 ./client.jl:464; _start()
87 ./client.jl:312; exec_options(::Base.JLOptions)
87 ./client.jl:374; run_main_repl(::Bool, ::Bool, ::Bo...
87 ./essentials.jl:789; invokelatest
87 ./essentials.jl:790; #invokelatest#1
87 ./client.jl:390; (::getfield(Base, Symbol("##737#...
87 ...1.2/REPL/src/REPL.jl:201; run_repl(::REPL.AbstractREPL, :...
87 ....2/REPL/src/REPL.jl:1038; run_frontend(::REPL.LineEditRE...
39 ...EPL/src/LineEdit.jl:2301; run_interface(::REPL.Terminals...
2 ...PL/src/LineEdit.jl:2383; prompt!(::REPL.Terminals.Text...
┌ Warning: The profile data buffer is full; profiling probably terminated
│ before your program finished. To profile for longer runs, call
│ `Profile.init()` with a larger buffer and/or larger delay.
└ @ Profile /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.2/Profile/src/Profile.jl:312
1 ./abstractdict.jl:588; (::getfield(REPL, Symbol("##26#27...
32 ./client.jl:464; _start()
32 ./client.jl:312; exec_options(::Base.JLOptions)
32 ./client.jl:374; run_main_repl(::Bool, ::Bool, ::Bo...
32 ./essentials.jl:789; invokelatest
32 ./essentials.jl:790; #invokelatest#1
# State Space
n = length(x)
# Initialize Model
m = Model(solver = IpoptSolver(max_iter = iterations, constr_viol_tol = maxdist))
# Parameters
@NLparameter(m, ρ == byp.ρ)
@NLparameter(m, δ == byp.δ)
@NLparameter(m, B1 == byp.B1)
using JuMP, Ipopt
m = Model(solver = IpoptSolver())
# Parameters
const γ = 2
const ρ = 0.05
const r = 0.041
const μR = 0.051
const ζ = 1.5
const σR = sqrt((ζ/γ+ 1)/2*(μR-r)^2/(ρ - r))
immutable QGramIterator{S, T <: Integer}
s::S # grapheorstring
l::Int # length of string
q::T # length of q-grams
end
function Base.start(qgram::QGramIterator)
(1, qgram.l < qgram.q ? endof(qgram.s) + 1 : chr2ind(qgram.s, qgram.q))
end
# Define iterator on q-grams
type QGramIterator{S <: AbstractString, T <: Integer}
s::S
q::T
end
function Base.start(qgram::QGramIterator)
len = length(qgram.s)
(1, len < qgram.q ? endof(qgram.s) + 1 : chr2ind(qgram.s, qgram.q))
end
function Base.next(qgram::QGramIterator, state)
@matthieugomez
matthieugomez / scalarstats.jl
Last active October 6, 2015 12:13
Summary stats
immutable SummaryStats{T<:FloatingPoint}
mean::T
std::T
min::T
p25::T
median::T
p75::T
max::T
end
@matthieugomez
matthieugomez / gist:7b8b0ef85478f69b1af5
Last active September 17, 2015 21:23
CG on A'A vs CG on Cimmino projection
##############################################################################
##
## CG on (Id - AA'/diag(AA')X = 0)
##
##############################################################################
type CimminoProblem
X::Matrix{Float64}
@matthieugomez
matthieugomez / gist:1878332e7073bd602079
Last active September 10, 2015 18:55
trace for hdfe
noi ds *, d
....
storage display value
variable name type format label variable label
--------------------------------------------------------------------------------------------------
DetailedSecur~e str27 %27s (firstnm) DetailedSecurityType
year float %8.0g
insurer str36 %36s
DeltaVincome_~s double %9.0g
DeltaVincome_~l float %9.0g