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

Exception while calling your likelihood function #433

Closed
getrude386 opened this issue Aug 4, 2022 · 1 comment
Closed

Exception while calling your likelihood function #433

getrude386 opened this issue Aug 4, 2022 · 1 comment

Comments

@getrude386
Copy link

getrude386 commented Aug 4, 2022

Hi, can you please assist me with this error:

processing all 4 sources with 1 cpus
Filter set contains 23 bands
Model sets contains 18 bands

Fitting sources from catalog: /idia/users/thando/AGNfitter/data/cosmos.txt

  • Sourceline: 0
  • Sourcename: 119920
    ......................................................
    model parameters ('tau', 'age', 'Nh', 'irlum', 'SB', 'BB', 'GA', 'TO', 'EBVbbb', 'EBVgal')
    minimum values (0.0, 5.0, 21.0, 7.0, 0.0, 0.0, 0.0, 0.0, -0.1, -0.1)
    maximum values (15, 9.976882609374064, 25, 15, 10.0, 10.0, 10.0, 10.0, 1.0, 1.0)
    ......................................................
    100 walkers
    Running burn-in nr. 0 with 4000 steps
    emcee: Exception while calling your likelihood function:
    exception:
    Traceback (most recent call last):
    File "/idia/users/thando/AGNfitter/emcee/ensemble.py", line 465, in call
    return self.f(x, *self.args)
    File "/idia/users/thando/AGNfitter/functions/PARAMETERSPACE_AGNfitter.py", line 124, in ln_probab
    posterior = lnp + ln_likelihood(data.nus,data.fluxes,data.fluxerrs, data.z, y_model)
    File "/idia/users/thando/AGNfitter/functions/PARAMETERSPACE_AGNfitter.py", line 97, in ln_likelihood
    resid = [(y[i] - y_model[i])/ysigma[i] for i in x_valid]
    IndexError: index 18 is out of bounds for axis 0 with size 18
    Traceback (most recent call last):
    File "./RUN_AGNfitter_multi.py", line 264, in
    RUN_AGNfitter_multiprocessing(args.ncpu, data_ALL, Modelsdict)
    File "./RUN_AGNfitter_multi.py", line 203, in RUN_AGNfitter_multiprocessing
    catalog_fitting = pool.map(multi_run_wrapper, itertools.izip(range(nsources), itertools.repeat(data_obj), itertools.repeat(modelsdict)))
    File "/usr/lib/python2.7/multiprocessing/pool.py", line 253, in map
    return self.map_async(func, iterable, chunksize).get()
    File "/usr/lib/python2.7/multiprocessing/pool.py", line 572, in get
    raise self._value
    IndexError: index 18 is out of bounds for axis 0 with size 18
@dfm
Copy link
Owner

dfm commented Aug 4, 2022

That exception means there's an error inside of your likelihood function and it's not an issue with emcee so we can't really help you with that here. It's an indexing bug in your code (the actual error message is in the middle of the traceback) so dig into that!

@dfm dfm closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2022
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

No branches or pull requests

2 participants