2
$\begingroup$

I am fitting a time series model in R. I plotted the time series to check for the pattern of it. It has 30625 observations. The observations are half hourly

plot.ts(ts) enter image description here I was checking acf plot to see for auto correlation.

acf(ts) enter image description here If ACF plot decreases slowly i.e. it has auto correlation out to higher number of lags, then it probably needs higher order of differencing.

I took the logarithm of the series and then checked its acf plot.

acf(log(ts))

I am getting an error

Error in plot.window(...) : need finite 'ylim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf

What does this error means? What should I do remove this error. I also think the significance bounds given by dotted line are not correctly calculated. What should I do in these two cases?

$\endgroup$
1
  • 1
    $\begingroup$ Better to apply transformations like $\log(x + 1)$ or $\log(|x| + 1)$ depending on you data! $\endgroup$ Commented Apr 13, 2017 at 16:49

1 Answer 1

2
$\begingroup$

Logarithm cannot handle numbers less than and equal to zero. You can exclude them from your time-series and then add them to the graph as points with different colors (if they are not many that would make the graph ambiguous and interpretation of it hard) or just simply exclude them but have the original graph side by side as well.

EDIT:

As proposed in the comments this would be a better option to avoid zeros:

log⁡(x+1)

or for negative numbers as well:

log⁡(|x|+1)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.