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

modifying alpha. #96

Open
aazz7777 opened this issue Apr 23, 2024 · 6 comments
Open

modifying alpha. #96

aazz7777 opened this issue Apr 23, 2024 · 6 comments

Comments

@aazz7777
Copy link

how can i modify alpha level?

@WillianFuks
Copy link
Owner

Hi @aazz7777 ,

By alpha you mean the prior level? See if this helps:

ci = CausalImpact(data, pre_period, post_period, model_args={'prior_level_sd':0.1})

@aazz7777
Copy link
Author

aazz7777 commented May 6, 2024

I meant the alpha that affect CI value. 0.05, 0.2 . I noticed that it is set to 0.05

@WillianFuks
Copy link
Owner

It sure is, simply run: ci = CausalImpact(data, pre_period, post_period, alpha=0.02) for alpha=0.02 for instance.

@MilaimKas
Copy link

MilaimKas commented Aug 20, 2024

Hello, is it possible to access the posterior distribution of the cumulative effect directly ? The idea is to extract whatever high density interval is needed from the posterior without having to perform the calculation again.

Maybe something like that: np.quantile(ci.posterior_dist.sample(1000)[:,-1,0], [0.98, 0.02]). Although this seems to be based on the processed data ...

@WillianFuks
Copy link
Owner

Hi @MilaimKas ,

Unfortunately this information is not currently available directly. Maybe you'd have to compute the simulated posteriors and then take the effect on each one so to get a distribution for effects.

@MilaimKas
Copy link

Hello @WillianFuks
I took a quick look at the code. It looks like it should be possible to implement something without too much effort. I would love to contribute to the project (even though I do not have much experience with code development).

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