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

Limits of Polynomials.PolyCompat? #247

Open
B-LIE opened this issue Jul 29, 2020 · 36 comments
Open

Limits of Polynomials.PolyCompat? #247

B-LIE opened this issue Jul 29, 2020 · 36 comments

Comments

@B-LIE
Copy link

B-LIE commented Jul 29, 2020

In the past (i.e., some months ago), functions polyfit, polyval, etc. worked. I have the impression that polyfit has been replaced by fit, and that polyval has been eliminated.

I have tried to use commands:

using Polynomials
Polynomials.PolyCompat

in the hope that this would make my old code work, but I get error messages.

Should this work?

@jverzani
Copy link
Member

Yes, but I think you are missing a "using Polynomials.PolyCompat" (the using isn't in your message). If it fails after that, please do show an example as the goal was to support the legacy code just by adding that one "using" command.

@B-LIE
Copy link
Author

B-LIE commented Jul 29, 2020 via email

@jverzani
Copy link
Member

It is a keyword now. Try adding fit(x,y,3,var=:s).

@B-LIE
Copy link
Author

B-LIE commented Jul 29, 2020 via email

@jverzani
Copy link
Member

Yes, just do p(x) instead. (There is a non exported evalpoly that might be useful for broadcasting purposes).

@B-LIE
Copy link
Author

B-LIE commented Jul 29, 2020 via email

@jverzani
Copy link
Member

Any feedback when you get a chance would be great. If you are interested, I have a PR that looked at allowing matrices as coefficients. It proves mostly successful when the size of the matrix is in the type information (e.g. SArrays) and less so when not. Anyways, I never merged it, as I didn't get any feedback on it and there are a few needed workarounds I recall being more hacky than I would prefer.

@B-LIE
Copy link
Author

B-LIE commented Jul 29, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@jverzani
Copy link
Member

I can't find the data. There was recently a different, but perhaps related issue where the user identified a graphing package (pyplot) as causing a conflict. To be honest, I can't see the connection, but... Anyways, I'll have a look if I can figure out where the numbers are.

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@jverzani
Copy link
Member

Where do I find the file? Does it get attached to this issue somehow?

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@jverzani
Copy link
Member

jverzani commented Jul 30, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@jverzani
Copy link
Member

That worked, but unfortunately I can't replicate the issue. fit(x,y,3) basically does this:

A = vander(Polynomial, a, 3)
pinv(A) * y

It could also be A \ y. I was expecting A to be poorly conditioned, but it doesn't appear to be.

If you bump into the error again, could you try this directly and see if the same error occurs?

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@jverzani
Copy link
Member

The other user said their similar issue was solved by installing MKL.jl. My suspicion is not that fit is different, but perhaps there is some oddity in what pinv calls. If I knew that, we could replace that call with the \ approach. Anyways, sorry about all the detective work.

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@jverzani
Copy link
Member

I don't know about MKL, but that is a poor solution. Better to see where the root cause is.

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@jverzani
Copy link
Member

jverzani commented Jul 30, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 30, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 31, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 31, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 31, 2020 via email

@B-LIE
Copy link
Author

B-LIE commented Jul 31, 2020 via email

@jverzani
Copy link
Member

Wow, that is subtle, and sadly consistent with the other report that was related. There a new gaming machine was the only machine that caused issues. I'll see if I can recreate locally somehow so I can slowly peel back the plot commands. There must be something triggering this.

@B-LIE
Copy link
Author

B-LIE commented Jul 31, 2020 via email

@jverzani
Copy link
Member

jverzani commented Jul 31, 2020 via email

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