Also for the above code is there a way to only use samples which fall within a certain credible interval, say a 95% credible interval?
and unrelated but if I want to automate this code to run for different number of samples each time is there a way to put this into a for loop. Then record the data for each loop somewhere?