Skip to content

Commit

Permalink
turn off RAM for OED sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
omalled committed Apr 18, 2016
1 parent 7985ff5 commit bb1c47b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/BIGOED.jl
Expand Up @@ -98,12 +98,14 @@ function generateproposedobs(bigoed::BigOED, proposedindex::Int, numobsrealizati
#mcmcmodel = Lora.model(loglikelihood, init=bigoed.nominalparams)
mcmcparams = Lora.BasicContMuvParameter(:p, logtarget=loglikelihood)
mcmcmodel = Lora.likelihood_model(mcmcparams, false)
#=
if Base.isbindingresolved(Lora, :RAM)
mcmcsampler = Lora.RAM(fill(1e-1, length(bigoed.nominalparams)), 0.3)
else
warn("Robust Adaptive Metropolis (RAM) method is not available")
=#
mcmcsampler = Lora.MH(fill(1e-1, length(bigoed.nominalparams)))
end
#end
mcmcrange = Lora.BasicMCRange(nsteps=thinning * numobsrealizations + burnin, burnin=burnin, thinning=thinning)
mcmcparams0 = Dict(:p=>bigoed.nominalparams)
outopts = Dict{Symbol, Any}(:monitor=>[:value, :logtarget, :loglikelihood], :diagnostics=>[:accept])
Expand All @@ -120,7 +122,7 @@ function generateproposedobs(bigoed::BigOED, proposedindex::Int, numobsrealizati
proposedobsarray[i] = Array(Float64, length(proposedtimes))
for j = 1:length(bigoed.models)
goodindices = (proposedmodelindices .== j)
proposedobsarray[i][goodindices] = bigoed.models[j](vec(mcmcchain.samples[i, :]), bigoed.decisionparams[1], proposedlocations[goodindices], proposedtimes[goodindices])
proposedobsarray[i][goodindices] = bigoed.models[j](vec(mcmcchain.value[:, i]), bigoed.decisionparams[1], proposedlocations[goodindices], proposedtimes[goodindices])
end
#TODO maybe make the residual conditioned on the residuals between the model and the existing observations
residual = rand(proposedobsresidualdistribution)
Expand Down
2 changes: 1 addition & 1 deletion test/testoed.jl
Expand Up @@ -33,7 +33,7 @@ import ReusableFunctions
end
return result
end
r3innermodel = ReusableFunctions.maker3function(innermodel)
#r3innermodel = ReusableFunctions.maker3function(innermodel)
function model(params::Vector, decisionparams::Vector, xs::Vector, ts::Vector)
#return r3innermodel([params[1:end]; decisionparams[1:end]; xs[1:end]; ts[1:end]])
return innermodel([params[1:end]; decisionparams[1:end]; xs[1:end]; ts[1:end]])
Expand Down

0 comments on commit bb1c47b

Please sign in to comment.