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

Example using Numcosmo unbinned likelihood #9

Open
combet opened this issue Sep 16, 2021 · 4 comments
Open

Example using Numcosmo unbinned likelihood #9

combet opened this issue Sep 16, 2021 · 4 comments
Assignees

Comments

@combet
Copy link
Collaborator

combet commented Sep 16, 2021

Add example notebook using NC unbinned likelihood on SkySim data

@combet combet self-assigned this Sep 16, 2021
@combet
Copy link
Collaborator Author

combet commented Sep 20, 2021

@pennalima, @vitenti, I've adapted the NC script to run on SkySim data... and it does not work :( In branch issue/9/numcosmo_unbinned

  • there's the script version NumCosmo_abundance_skysim.py in the top directory
  • and the notebook version notebook/NumCosmo_abundance_skysim.ipynb

I haven't been able to probably instantiate the mass and redshift in the absence of errors; the syntax cluster_z = Nc.ClusterRedshiftNodist('z-min': 0.0, 'z-max': 1.0) does not work and I haven't found the proper one.

So I reverted to using the lognormal and gaussian distributions for mass and redshift respectively. Then the script runs, but the first minimization step using NLOpt gets to lower and lower values of "Omega_c", finally reaching the lower allowed bound.

Anyhow, this is were I'm at at the moment...

@vitenti
Copy link
Collaborator

vitenti commented Sep 24, 2021

Hello @combet , I just pushed a new commit with a working version of the NumCosmo notebook. Please, take a look.

@combet
Copy link
Collaborator Author

combet commented Sep 27, 2021

@vitenti - thank you for fixing this and I saw where I got things wrong (in particular the silly mistake with the amplitude conversion). This now runs fine. I will keep experimenting and maybe move to a larger sky area/catalog to see how this scales.

I will also experiment how to launch this through the job scheduler at cc-in2p3. Quick question, will esmcmc.set_nthreads enable the job to run on 4 threads in parallel?

@vitenti
Copy link
Collaborator

vitenti commented Sep 27, 2021

@combet - Good news! If you want to try the parallelized version you need to use:

Ncm.func_eval_set_max_threads (4)
esmcmc.set_nthreads (4)

The first call controls the number of threads available to NumCosmo as a whole, and the second the number of threads used in sampling. Please, tell me if it works properly. There is also the MPI version, but for that it's probably easier to call directly from a script and not from a notebook

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