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

full-redshift fitting with archetypes #275

Open
moustakas opened this issue Jan 30, 2024 · 3 comments
Open

full-redshift fitting with archetypes #275

moustakas opened this issue Jan 30, 2024 · 3 comments

Comments

@moustakas
Copy link
Member

@sbailey @abhi0395 can we use this ticket to flesh out what changes we would need to make to Redrock to support archetype-only fitting? In other words, at the moment I believe that archetypes can only be used to refine the redshifts found via other (PCA or NMF) means. However, it should be relatively straightforward to do the full-redshift fitting with archetypes.

The computation should be pretty fast because one only needs to algebraically compute the scale factor (after redshifting, resampling, and instrumental convolution) needed to match each template to the data. For a reasonable number of archetype templates (<10^3) the math should be ~instantaneous, especially on a GPU.

@sbailey
Copy link
Collaborator

sbailey commented Jan 30, 2024

One detail is that all prior archetype work on both BOSS and DESI has found it necessary to include Legendre nuisance terms, making the problem N>>1 small linear algebra solutions rather than just solving for a single scaling factor.

Current speed limiting factor is using the BVLS solver to keep archetype coefficients positive while allowing unbounded Legendre coefficients. This could be addressed with

  • custom bvls implementation (@dylanagreen has a fast Julia implementation, perhaps that can be ported to numba or cupy/GPU)
  • allowing unbounded solutions, and penalize/reject redshifts where the best fit archetype coefficient is negative
  • keep positive + negative versions of every legendre term, then solve with nnls (positive coefficients) which is much faster than bvls.

@moustakas
Copy link
Member Author

Thanks @sbailey. Nevertheless, it would be useful to be able to run in a super-simple mode with archetypes and no polynomials. Is this something that you or @abhi0395 could implement relatively easily or should I take a crack?

@abhi0395
Copy link
Member

Thanks @sbailey , @moustakas
We can try running archetypes without polynomial terms for all redshifts, but we still need to make some surgeries to the existing code. But before that, it would be nice to have @dylanagreen julia implementation of bvls into redrock-archetype mode to see how much gain do we achieve in runtime.

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

3 participants