Created
September 25, 2018 11:30
-
-
Save Nessiesson/816ecde71e8323e4288c430574c58559 to your computer and use it in GitHub Desktop.
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
import matplotlib.pyplot as plt | |
import numpy as np | |
def p(t, alpha=1.0, beta=1.0, p0=1.0): | |
return beta ** t * p0 + sum([alpha * beta ** (t - m) for m in range(1, t + 1)]) | |
vec_p = np.vectorize(p) | |
times = np.arange(10) | |
alphas = np.arange(-5, 5, 0.1) | |
output = [] | |
for t in times: | |
output.append(vec_p(t, alphas, beta=5)) | |
plt.plot(times, output) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment