Skip to content
Discussion options

You must be logged in to vote

Hi @Konrad-H - there is something that you can use. Give a fitted univariate model f, you can provide uniform random variates to the percentile function:

wf = WeibullFitter()
T = np.random.exponential(4, size=1000)
wf.fit(T)
sim = wf.percentile(np.random.random(size=10000)) # simulate 10000 survival times

This works due to inverse transform sampling.

Now, you want to take into account time that has already passed, call this time s. For this, you just need to remove any entries below s in the resulting vector.

sim[sim > s]

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Konrad-H
Comment options

@CamDavidsonPilon
Comment options

@Konrad-H
Comment options

Answer selected by Konrad-H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants