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

Is there any way currently to deal with trendy only signal ? #3

Closed
mamadyonline opened this issue Jun 13, 2019 · 1 comment
Closed

Comments

@mamadyonline
Copy link

mamadyonline commented Jun 13, 2019

Not all signals have necessarily a seasonal component, some might be only trendy and in this case how do we go about setting the <seasonal_length> parameter?

For example, what are the right settings for the classical airline passengers data set? I tried 12 as the seasonal_length, running the robustSTL confounds trend and seasonality !

@LeeDoYup
Copy link
Owner

LeeDoYup commented Jul 24, 2019

(In my opiniton)
if you have no seasonality,

  1. Set season_len to enough length (about 12 if monthly)
  2. Remove seasonal extraction parts (https://github.com/LeeDoYup/RobustSTL/blob/master/RobustSTL.py#L41-L58)
def seasonality_extraction(sample, season_len=10, K=2, H=5, ds1=50., ds2=1.):
    '''
    sample_len = len(sample)
    idx_list = np.arange(sample_len)

    def get_season_value(idx):
        idxs = get_season_idx(sample_len, idx, season_len, K, H)
        if idxs.size == 0:
            return sample[idx]

        weight_sample = sample[idxs]
        #t_idxs = [idx - (int((idx -j)/season_len)+1)*season_len for j in idxs]
        #weights = np.array(list(map(lambda j, t: bilateral_filter(j, t, sample[j], sample[t], ds1, ds2), idxs, t_idxs)))
        weights = np.array(list(map(lambda j: bilateral_filter(j, idx, sample[j], sample[idx], ds1, ds2), idxs)))
        season_value = np.sum(weight_sample * weights)/np.sum(weights)
        return season_value

    seasons_tilda = np.array(list(map(get_season_value, idx_list)))
    '''
    return np.zeros(np.shape(sample)) 

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