I have managed to run a regression model using cmdstanpy.
Here is my summary code & Result:
fit = LVR_model.sample(data=LVR_data, chains=4, iter_sampling=200,iter_warmup=200, adapt_delta=0.90, max_treedepth=10) Fit_Summary =fit.summary(percentiles=(5,95), sig_figs=2) Fit_Summary
Now as you can see in the result that it only gives me few last log_likelihood. What if I want to see the log_likelihood of the first 5 observation, that is something along the lines of
But this gives me error saying KeyError: “None of [Index([‘log_likelihood[1:5]’], dtype=‘object’)] are in the [index]”
But if I change the code to
But surely there must be an easy way to extract all the log_likelihood in one command, rather than typing each one like
Can someone please help me.