Causal Impact: Set CI Model or MCMC Constraint > 0

223 views
Skip to first unread message

violant...@gmail.com

unread,
Jan 15, 2015, 2:26:40 PM1/15/15
to causal...@googlegroups.com
I have a question about the CI model. The model appears to be fitting the data. However, the point prediction in the post-intervention data contains negative values. Is there a way to set a constraint that predictions must be > 0 since a value < 0 for this data would be impossible (clicks, visits, revenue, orders, etc).

Any help would be great thanks!

- Andre

Kay Brodersen

unread,
Jan 16, 2015, 6:25:33 AM1/16/15
to violant...@gmail.com, causal...@googlegroups.com
Hi Andre,

You could log-transform your response variable. Ideally, this should be done inside the package and should be undone before computing the posterior predictive mean. This is idea is not currently part of CausalImpact, but you're welcome to give it a try and add it. As a quick approximation, you could simply run CausalImpact() as is, on data where the response variable has been log-transformed. Note that in this case the posterior means will actually be posterior modes.

Kay


--
You received this message because you are subscribed to the Google Groups "CausalImpact" group.
To unsubscribe from this group and stop receiving emails from it, send an email to causalimpact...@googlegroups.com.
To post to this group, send email to causal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/causalimpact/570c9ff4-a070-46b2-96b3-e12330f2905c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

andre violante

unread,
Jan 16, 2015, 12:42:14 PM1/16/15
to causal...@googlegroups.com, violant...@gmail.com
Thanks Kay!
Reply all
Reply to author
Forward
0 new messages