Skip to content

Conversation

fonnesbeck
Copy link
Member

Since so many continuous variables have positive-valued parameters, this just generates a simple warning if you pass a parameter that has non-positive support. As best it can, it checks whether the logp at zero is finite. This should help users avoid mis-parameterizing models.

@twiecki
Copy link
Member

twiecki commented Oct 23, 2016

Good idea.

@springcoil springcoil merged commit 968f341 into master Oct 23, 2016
@springcoil
Copy link
Contributor

Merging this.

@springcoil springcoil deleted the variance_warn branch October 23, 2016 13:07
@aloctavodia
Copy link
Member

Now something like this

    sigma = pm.HalfNormal('sigma', sd=10)  # or pm.HalfCauchy('sigma', 10) 
    y = pm.Normal('y', mu=mu, sd=sigma, observed=data)

results in a warning message. I guess this is related to sd=0 being problematic, but given that in practice it is ok to use HalfNormal (or HalfCauchy) as a prior for sd, I think this warning is misleading.

@fonnesbeck
Copy link
Member Author

I agree. I need to fine tune the warning a little.

@fonnesbeck
Copy link
Member Author

@aloctavodia Try out PR #1482

@aloctavodia
Copy link
Member

@fonnesbeck LGTM. Thanks for the prompt fix!

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

Successfully merging this pull request may close these issues.

4 participants