Created
December 2, 2022 05:05
-
-
Save sosiristseng/dd581f92a06a84b4e631c062eca056d6 to your computer and use it in GitHub Desktop.
Commonly used functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################## | |
### Commonly-used functions | |
################################## | |
""" | |
Regular Hill function | |
""" | |
hill(x, k=one(x)) = x / (x + k) | |
hill(x, k, n) = hill(x^n, k^n) | |
""" | |
Repressive Hill function | |
""" | |
hillr(x, k=one(x)) = hill(k, x) | |
hillr(x, k, n) = hill(k, x, n) | |
""" | |
expit(x) | |
Logistic sigmoid function. `expit(x) = 1 / (1 + exp(-x))` | |
""" | |
expit(x) = hillr(exp(-x)) | |
""" | |
exprel(x, em1 = expm1(x)) | |
Returns `x / (exp(x)-1)` | |
""" | |
exprel(x, em1=expm1(x)) = x / em1 | |
""" | |
Signed sqare root | |
""" | |
sqrt_s(x) = sign(x) * sqrt(abs(x)) | |
""" | |
Signed power | |
""" | |
pow_s(x, n) = sign(x) * (abs(x)^n) | |
""" | |
Signed Hill function | |
""" | |
hill_s(x, k, n) = hill(pow_s(x, n), pow_s(k, n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment