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

Fix units in plot.gts/ACF/PACF #3

Closed
stephaneguerrier opened this issue Sep 8, 2017 · 2 comments
Closed

Fix units in plot.gts/ACF/PACF #3

stephaneguerrier opened this issue Sep 8, 2017 · 2 comments
Assignees
Labels

Comments

@stephaneguerrier
Copy link
Member

There is a bug with the lags and xlab when freq != 1 for the functions mentioned in the title. Here is an example:

# Load savingrt dataset
data("savingrt")

# Simulate based on data
savingrt = gts(as.vector(savingrt), start = 1959, freq = 12, unit_ts = "%", 
            name_ts = "Saving Rates", data_name = "US Personal Saving Rates",
            unit_time = "month")

# Plot savingrt simulation
plot(savingrt)

# Compute ACF and plot result
savingrt_acf = ACF(savingrt)
plot(savingrt_acf)
@munsheet
Copy link
Member

I'm assuming Time can be NULL and will try to fix this issue by directly changing the gts() function.

Previously,

if (length(data) != length(Time)){
      stop('"data" and "Time" must have equal length.')
    } 

was contained outside of the if (!is.null(Time)) if loop since we did not consider when Time is NULL. Should we create a if case for when Time is NULL? Thanks.

@munsheet
Copy link
Member

munsheet commented Mar 23, 2018

Therefore, the problem did not lie because freq != 1 but was because of the stop() statement I included to error when the data and Time parameter were not of equal length. In the case about that you stated, our Time parameter is set to NULL. And NULL is not the same length as the length of our savingrt dataset.

Please close this issue if this bug seems to be fixed.

munsheet added a commit that referenced this issue Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants