-
-
Notifications
You must be signed in to change notification settings - Fork 69
Add GrassiaIIGeometric Distribution #528
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
269dd75
b264161
d734c68
71bd632
48e93f3
93c4a60
d2e72b5
8685005
026f182
d12dd0b
bcd9cac
78be107
f3ae359
8a30459
7c7afc8
fa9c1ec
b957333
d0c1d98
264c55e
05e7c55
0fa3390
5baa6f7
a715ec7
f3c0f29
a232e4c
ffc059f
1d41eb7
47ad523
5b77263
eb7222f
b34e3d8
9803321
5ff6853
63a0b10
932a046
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -509,7 +509,7 @@ def dist(cls, r, alpha, time_covariate_vector=None, *args, **kwargs): | |
time_covariate_vector = pt.as_tensor_variable(time_covariate_vector) | ||
return super().dist([r, alpha, time_covariate_vector], *args, **kwargs) | ||
|
||
def logp(value, r, alpha, time_covariate_vector=None): | ||
def logp(value, r, alpha, time_covariate_vector): | ||
if time_covariate_vector is None: | ||
time_covariate_vector = pt.constant(0.0) | ||
time_covariate_vector = pt.as_tensor_variable(time_covariate_vector) | ||
|
@@ -547,14 +547,12 @@ def C_t(t): | |
msg="r > 0, alpha > 0", | ||
) | ||
|
||
def logcdf(value, r, alpha, time_covariate_vector=None): | ||
def logcdf(value, r, alpha, time_covariate_vector): | ||
if time_covariate_vector is None: | ||
time_covariate_vector = pt.constant(0.0) | ||
time_covariate_vector = pt.as_tensor_variable(time_covariate_vector) | ||
|
||
def C_t(t): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this be moved outside the function so that it can be reused by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure how kosher this is, but due to how instantiation is handled in |
||
if t == 0: | ||
return pt.constant(0.0) | ||
if time_covariate_vector.ndim == 0: | ||
return t | ||
else: | ||
|
@@ -576,7 +574,7 @@ def C_t(t): | |
msg="r > 0, alpha > 0", | ||
) | ||
|
||
def support_point(rv, size, r, alpha, time_covariate_vector=None): | ||
def support_point(rv, size, r, alpha, time_covariate_vector): | ||
"""Calculate a reasonable starting point for sampling. | ||
|
||
For the GrassiaIIGeometric distribution, we use a point estimate based on | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like your logp doesn't handle ndim > 1 right? In that case raise NotImplementedError if value.ndim > 1 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would hierarchical models still be supported if this were the case?