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

Return linbasex arrays as distr object #274

Open
DanHickstein opened this issue Apr 6, 2020 · 1 comment
Open

Return linbasex arrays as distr object #274

DanHickstein opened this issue Apr 6, 2020 · 1 comment

Comments

@DanHickstein
Copy link
Member

As discussed in #270 (comment), we should consider changing the way that linbasex returns its arrays. It should probably be more like rbasex, which uses the distr object. This way, only two variables are returned, instead of two or three.
(Note, I haven't done much research about this, I'm just opening an issue since @stggh seemed to think that this was a good idea.)

@MikhailRyazanov
Copy link
Collaborator

Two comments:

  1. Currently my Distributions.Results class holds cosn θ terms inside and converts them to other representations (such as harmonics or anisotropy parameters βn) upon request. This works fine for low orders, but cosn θ are actually very non-orthogonal (see Hilbert matrix), and thus their conversions to other representations are not well-conditioned, potentially leading to huge numerical errors when sufficiently high orders (n ≳ 10) are involved. linbasex apparently uses Legendre polynomials throughout, which are orthogonal and thus probably more numerically stable (although I don't know whether this is true in practice). In principle, Distributions.Results can be modified to hold any representation and convert it to any other when needed. I was thinking about this, but have not implemented it yet.

  2. linbasex also returns projections. I don't know whether they are useful for anything, but if yes, it will need to return 3 values inv_IM, distr, projections instead of 2 values inv_IM, (radial, Beta, projections).

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