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

Non-negative constraint in disaggregated numbers #42

Open
AdamElderfield opened this issue Jan 28, 2020 · 2 comments
Open

Non-negative constraint in disaggregated numbers #42

AdamElderfield opened this issue Jan 28, 2020 · 2 comments

Comments

@AdamElderfield
Copy link

Hi,

Great package, thanks for all your work so far!

I have question, is it possible to impose a constraint that the disaggregated data not go negative? This happens when annual data is close to zero.

Thanks

Adam

@christophsax
Copy link
Owner

Need to look into it. Can you provide a reproducible example? Thank you!

@wian-boonzaaier
Copy link

wian-boonzaaier commented May 26, 2021

Hi,

I have also experienced the non-negative constraint issue when working with near-zero observations. Here is an example with no indicator variable using Denton-Cholette and truncated.rho = 0):

library(tempdisagg)
library(zoo)

lfreq <- c(0.5496272909, 0.5053369531,
           0.3997841521, 0.2173665480,
           0.1641758216, 0.1990214600,
           0.0791224856, 0.0011010778,
           0.0008603003, 0.0006170139,
           0.0003076042) 

lfreq <- ts(lfreq,
            start=2010,
            frequency=1)

denton <- td(lfreq ~ 1, to = "quarterly", method = "denton-cholette", conversion = "mean", truncated.rho=0)

as.matrix(predict(denton))

I would appreciate your thoughts on this. The quarterly SNA handbook only references the transformation of zeroes to near zeroes, which in this case should not be a problem.

Sincerely,

Wian

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

3 participants