Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No ignition is causing infinite error #18

Open
rwest opened this issue Mar 26, 2021 · 1 comment · May be fixed by #20
Open

No ignition is causing infinite error #18

rwest opened this issue Mar 26, 2021 · 1 comment · May be fixed by #20

Comments

@rwest
Copy link
Member

rwest commented Mar 26, 2021

We have a simulation that does not trigger an ignition (the temperature never rises quite enough) and end up with 'average error function' of Inf and 'average deviation function' of -Inf. for the whole data set.

Looking at

error_func = numpy.nanmean(error_func)

        # calculate error function for this dataset
        error_func = numpy.power(
            (numpy.log(ignition_delays_sim) -
             numpy.log(ignition_delays_exp)) / standard_dev, 2
             )
        error_func = numpy.nanmean(error_func)

I'm guessing the nanmean is supposed to take a mean excluding NaN values, but the result of numpy.log(ignition_delays_sim) is not NaN but is -Inf when no ignition is detected, because process_results() sets ignition delay to zero if no ignition:

  else:
            warnings.warn('No ignition for case ' + self.meta['id'] +
                          ', setting value to 0.0 and continuing',
                          RuntimeWarning
                          )
            self.meta['simulated-ignition-delay'] = 0.0 * units.second

So we end up with 'average error function' of Inf and 'average deviation function' of -Inf.

Should we exclude infinities before averaging? include them somehow?
I guess technically it is an infinite error, but that doesn't help you rank things!

@rwest
Copy link
Member Author

rwest commented Mar 26, 2021

Just noticed this is a duplicate of issue #1 :)

@kyleniemeyer kyleniemeyer linked a pull request Apr 6, 2021 that will close this issue
@kyleniemeyer kyleniemeyer linked a pull request Apr 6, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant