1
$\begingroup$

I would like to seasonally adjust data series that cannot be negative. How I could do this? Currently I am using seas in R. Is it possible to constrain the output series to 0 or positive values?

$\endgroup$

1 Answer 1

1
$\begingroup$

It is not very clear what you want exactly, but here are two options that may help you:

Option 1, offsetting: Subtract min(seriesX) from each element of output seriesX;

data.table style:

seriesX[, value := value - min(value)]

Option 2, thresholding: Transform each seriesX element smaller than 0 - to 0

data.table style:

seriesX[value < 0, value := 0]

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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