NAVADMC / ADSM

A simulation of disease spread in livestock populations. Includes detection and containment simulation.
Other
10 stars 5 forks source link

Graphing the Probability Density Functions #331

Open josiahseaman opened 9 years ago

josiahseaman commented 9 years ago

Probably more difficult because we need to accommodate for each equation type.

330 again.

I think this issue requires me to match every equation type option to a function in matplotlib. If that's the case, it'll take me a while compared to Relational Functions

josiahseaman commented 8 years ago

Thanks for pointing me to Vose, Neil, it looks like the issue with Pareto and Pearson 5 was just a matter of unreasonable input values. When I copied their input values the graphs looked fine. That brings all the graphs within acceptable ranges, pending your approval. I fixed the y axis range to make them all comparable and limit so approaches zero craziness. The downside is that it flattened a couple graphs like Gamma and Weibull depending on their input parameters.

image

ndh2 commented 8 years ago

One problem I spotted with the discrete uniform. All of the values from min to max inclusive should have equal probability. In the plot below (min=3, max=7) it looks like 7 has a lower probability than the others.

discrete_uniform_plot_problem

missyschoenbaum commented 7 years ago

I am moving this into current milestone. It looks like it is very close. @lkholmstrom we may need some test data on these last few. Kick back to me if I need to get test data from Kelly or Tim.

missyschoenbaum commented 7 years ago

@lkholmstrom can you test this with a discrete uniform so we have an example before we send back in to the dev cycle?

lkholmstrom commented 7 years ago

The discrete uniform distribution is defined by the user specifying a minimum (a) and maximum (b) value. The calculation for the number of discrete values (n) is n = b-a+1 and all values have an equal probability of 1/n. In all test cases, the maximum value specified (b) has a lower probability than the other values, which is incorrect. So, hopefully it is just an error in the calculation in the code to be fixed. The other values look like the calculated probabilities are correct, but we need to check the outputs to verify those as well. Here are some examples:

discreteuniform10

The above is for min = 1, max = 10. So, each value should have equal probability of 0.1 (the max value does not)

discreteuniform5

Another example, with min = 1 and max = 5; probability for all values should be 0.2 (the max value does not). Also, this graph shows better why we need to also check to make sure the probability is correct for all the values - the blue circles look to be just above 0.2, but it might just be the bottom of the circle represents the intended value versus the center of the circle

missyschoenbaum commented 6 years ago

We think this is just a weird visualizing thing.

ConradSelig commented 6 years ago

The graph still displays with the lowest value an the highest value cut in half. The cause of this is somewhere between where the graph is created and where the graph is saved as a HttpFigure.

This conversion happens in ScenarioCreator/function_graphs.py lines 225-229.