virocon-organization / viroconweb

A software to compute environmental contours. Django web-application package.
MIT License
2 stars 1 forks source link

Wrong plots when fitting a Weibull LN(dependent, independent) model #171

Closed ahaselsteiner closed 6 years ago

ahaselsteiner commented 6 years ago

I'm submitting a ...

Expected behavior

How should it work (with the bug fixed or the feature implemented)? The fits should get displayed correctly.

Screenshot

Actual behavior

How does it currently work (with the bug causing problems or without the feature)? The fits are plotted wrongly. The mu values are too low, precisely ln(correct value). The "fit of fits" plot is correct, however. The equation for mu is correct too.

Screenshot Wrong fit and correct "fit of fits": image

Used model and correct equation: image

Steps to reproduce the problem (how to see the actual behavior)

  1. Upload the standard Vanem data set
  2. Fit a Weibull, Log-normal(dependent, independent) model to it
  3. Inspect the fit
ahaselsteiner commented 6 years ago

This is likely an error caused by the viroconcom package since the LognormalDistribution instance returns the same values for mu and scale. The mu value is correct, the scale value incorrect.

LognormalDistribution image

ahaselsteiner commented 6 years ago

Interestingly, if the parameter is independent the mu value is correct.

This ist the output of LN LN(power, exp) model: image

ahaselsteiner commented 6 years ago

I narrowed the problem further down.

When a mu is dependent the BasicFit objects are incorrect. They have scale value, which is too low. It is ln(scale) of the correct scale value.

image

ahaselsteiner commented 6 years ago

When the BasicFits objects are cretated, they are correct: image image

ahaselsteiner commented 6 years ago

The Fitting module seems to send correct BasicFits. However, they seem to get altered later:

image

ahaselsteiner commented 6 years ago

I think I got it: image

image

ahaselsteiner commented 6 years ago

Yes, that was the problem.

Solved it: image

image

ahaselsteiner commented 6 years ago

This is fixed. It was fixed on Master.