-
Notifications
You must be signed in to change notification settings - Fork 19
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
use bfast for one dimentional time series data #42
Comments
Yes, it is possible. You should create an "image" with only 1 pixel by re-shaping your dataset:
|
I just tried and it works! I would want to follow up on some other questions in case I understood wrongly:
Thank you! |
|
Thank you! I found the branch and want to test on my data set, but I kept meeting this error: my y is array([508104., 525865., 556608., ..., 538247., 534160., 553917.]), Is the format of x not correct? |
x should be a vector of floating point time-steps, e.g. 1 January 2001 would be represented by 2001.0, while 31 December 2001 would be something like 2001.99. You can use this function to generate such vector:
|
Thank you so much, however this function can not generate 365 numbers of data points for daily data in a year since the maximum number np.linespace can generate between 2016 and 2017 is 100? would you have other suggestions to represent daily timestep? (would be 20170101,20170102...20201231 works?) |
I don't know if I understood your question completely, but this call:
would return a vector of 365 values:
|
I found the problem, I write np.set_printoptions(precision=2, linewidth=120) before, and did not restart the kernel, after restarting the kernel, it works exactly as it should be! Thank you so much! Then I encounter this error again: sorry to ask so many questions since I am quite fresh to python and bfast... |
Do you have NaNs in your dataset? |
Hi, I do not have NaNs in dataset. I copy the code in bfast_1d_example.py in the bfast-experimental branch, and write the main as: data: an array contains daily data from 2017-2020, 1461 data points in total It first runs and shows: Then error information: /var/folders/2j/n5q0yrd16tzd0m321v49wb500000gn/T/ipykernel_73317/2059085243.py in plot(name, y, x, f, season, level, h, max_iter, nan_clr) ~/opt/anaconda3/envs/Milan_env/lib/python3.9/site-packages/bfast/models.py in fit(self, Yt, ti) ~/opt/anaconda3/envs/Milan_env/lib/python3.9/site-packages/bfast/bfast/python/base.py in fit(self, Yt, ti) ~/opt/anaconda3/envs/Milan_env/lib/python3.9/site-packages/bfast/bfast/python/base.py in fit_single(self, Yt, ti, smod) ~/opt/anaconda3/envs/Milan_env/lib/python3.9/site-packages/bfast/bfast/python/breakpoints.py in init(self, X, y, h, max_breaks, use_mp, verbose) ~/opt/anaconda3/envs/Milan_env/lib/python3.9/site-packages/bfast/bfast/python/breakpoints.py in extend_SSR_table(self, SSR_table, breaks) <array_function internals> in nanargmin(*args, **kwargs) ~/opt/anaconda3/envs/Milan_env/lib/python3.9/site-packages/numpy/lib/nanfunctions.py in nanargmin(a, axis) ValueError: All-NaN slice encountered Thank you so much! |
Hi,
Thanks for the package, I am just wondering could I apply the algorithm on 1-d time series data? I checked the format of input data which should be (N,W,H) only for image data. Thank you!
The text was updated successfully, but these errors were encountered: