All problems
MCMC Burn-In Mean
Problem
Discard the first burn_in samples of a Markov chain and return the mean of the remaining samples. A negative burn_in is treated as 0, and 0.0 is returned when nothing remains.
Hint
Burn-in removes the transient before averaging.
Test cases
case 1
in: [[1,2,3,4,5],2]
expected: 4
case 2
in: [[1,2],0]
expected: 1.5
case 3
in: [[1,2,3],3]
expected: 0
case 4
in: [[],0]
expected: 0
Starter codePython
def mcmc_burn_in_mean(samples, burn_in):
# Your code here
pass4 test cases · run your code against them in the editor