-
Notifications
You must be signed in to change notification settings - Fork 45
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
Post-STL seasonal smoothing edge artifacts #6
Comments
Hafen's thesis discusses blending the second order LOESS smoothing with a flat LOESS smoothing of half the smoothing width near the edges. I think stlplus can do this for all the LOESS smoothers used in STL. If I get a chance, I'll at least get this in for the post-STL smoothing, which is where I've tended to use the second degree LOESS. |
Hi @jcrotinger , |
Hi @littlehappi, Thanks!
It is Java, so it is not as fast as the Fortran version, but it scales similarly. There are some performance tests in |
Hi @jcrotinger , |
@littlehappi The Java code is thread friendly - there is no non-constant shared static state between different |
@jcrotinger Hi! I have read the source code, but it is questionable about how the stl-decomp-4j calls the port of the Fortran. I thought that the loess smoothing method decides the fitting performance and checked it. This method is also based on Java, except a part of commented-out code which has mentioned Fortran, like: |
Hi @littlehappi, The One could write a JNI wrapper to call the original Fortran, and I think there is a github project with a start on such a wrapper. Calling the native Fortran would be faster, but also less safe. I needed a Java implementation for an environment that does not allow calling unmanaged code, looked at The comments you referenced are copies of a section of the original Fortran code that I used when debugging my port. Fortran is indexed from 1, and the loop logic is somewhat messy, so I wanted to make sure that I understood it and wrote it correctly in Java. Thus the example calculations off to the right of the ratfor code. :) |
Hi @jcrotinger , |
@littlehappi Can you send add an example so I can try to reproduce the result? What does the raw data look like? This decomposition result does not look like there is any particular seasonality or trend to extract. Also, it looks odd because normally the seasonal component oscillates around 0. Also, can you post it as a new issue please? This has strayed from the subject of my original issue above. :) The R version actually calls the native Fortran. The Java version will not be as fast. But using the Fortran version requires running unmanaged code, which isn't always possible. That's why I wrote it. :) There is a comparison between Fortran and |
I did create a Java wrapper around the original Fortran code: https://github.com/ExpediaDotCom/stl-jni Have been using it for a couple years now (open sourced it about a year ago) and it works fine. So that option is available. But I'm excited to see a pure Java version so I'll give yours a try. |
@williewheeler I saw that - I have applications that can't use unmanaged code, which is why I went this route, but it definitely isn't as fast. It would be nice to have the Builder be able to build an unmanaged version if one is available - might look at that if I have time at some point. |
When doing post-STL smoothing of the seasonal component there can be artifacts at the edge. Here is a fit for some synthetic data.
The smoother is really too wide here and the artifact isn't intolerable when a more narrow smoother is used, but it is still not optimal.
The text was updated successfully, but these errors were encountered: