Commit 7cca0dc9 authored by Peter Jentsch's avatar Peter Jentsch
Browse files

community intervalsmodel run

parent a02d4a82
......@@ -53,7 +53,7 @@ function univariate_simulations()
end
end
using AxisKeys
import AxisKeys
function multivariate_simulations()
len = 8
......@@ -96,7 +96,7 @@ function run_multivariate_sims(sims,default_parameters)
return sim_range
end
keyed_output = KeyedArray(app_output;NamedTuple{varnames}(output_keys)...)
keyed_output = AxisKeys.KeyedArray(app_output;NamedTuple{varnames}(output_keys)...)
path = joinpath(PACKAGE_FOLDER,"abm_output","$fname.dat")
serialize(path,(without_app,keyed_output))
return fname
......@@ -108,7 +108,7 @@ using LaTeXStrings
function plot_parameter_plane(input_fname)
path = joinpath(PACKAGE_FOLDER,"abm_output","$input_fname.dat")
output_no_app, output = deserialize(path)
var_ranges = axiskeys(output)
var_ranges = AxisKeys.axiskeys(output)
vars = (L"\eta",L"\omega_{en}")
......
......@@ -13,9 +13,10 @@ const swap_dict = OrderedDict("Y" => YOUNG, "M" => MIDDLE, "O" => OLD)
Runs parameter estimation for the three scenarios, hh, ws, and rest.
"""
function intervalsmodel()
hh(1000)
ws(1000)
rest(1000)
community(1000)
# hh(1000)
# ws(1000)
# rest(1000)
plot_all()
end
......@@ -88,6 +89,25 @@ function hh(particles)
bayesian_estimation("hh",err_hh,priors_list,dists,particles; alpha = 0.98)
end
"""
hh(particles::Integer)
Fit HH durations. This function specifies a list of distributions to fit, and loads the priors for "hh", and then calls `bayesian_estimation` with `err_hh`. This function passes parameters to `bayesian_estimation` depending on what produces the best fit for the HH data.
"""
function community(particles)
dists = [
Poisson,
]
poisson_priors = filter_priors("workschool")
# display(poisson_priors)
# Set parameter priors for fitting
priors_list = [
Factored(poisson_priors...),
]
community_error(p,d) = err_hh(p,d) + err_rest(p,d)
bayesian_estimation("community",community_error,priors_list,dists,particles; alpha = 0.98)
end
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment