R/bpc_get_parameters.R
get_parameters_df.Rd
Function to retrieve a data frame with summary of the parameters
get_parameters_df( bpc_object, params = NULL, HPDI = TRUE, credMass = 0.95, n_eff = FALSE, Rhat = FALSE, keep_par_name = T )
bpc_object | a bpc object |
---|---|
params | a vector with the parameters to use. If null then all will be present |
HPDI | should return the HPDI or the credible intervals. Default is returning the HPDI |
credMass | probability mass for the summary stats |
n_eff | Should include the number of effective samples in the df |
Rhat | Should include the Rhat in the df |
keep_par_name | keep the parameter name e.g. lambda Graff instead of Graff. Default to T. Only valid for lambda, so we can have better ranks |
# \donttest{ m<-bpc(data = tennis_agresti, player0 = 'player0', player1 = 'player1', result_column = 'y', model_type = 'bt', solve_ties = 'none') #> Running MCMC with 4 parallel chains... #> #> Chain 2 finished in 3.2 seconds. #> Chain 3 finished in 3.2 seconds. #> Chain 1 finished in 3.3 seconds. #> Chain 4 finished in 3.2 seconds. #> #> All 4 chains finished successfully. #> Mean chain execution time: 3.2 seconds. #> Total execution time: 3.6 seconds. param<-get_parameters_df(m) print(param) #> Parameter Mean Median HPD_lower HPD_higher #> 1 lambda[Seles] 0.40713235 0.388460 -2.26913 3.10646 #> 2 lambda[Graf] 0.83924941 0.834391 -1.82868 3.55931 #> 3 lambda[Sabatini] -0.44105063 -0.472083 -3.10371 2.29590 #> 4 lambda[Navratilova] -0.05551631 -0.081147 -2.68499 2.64094 #> 5 lambda[Sanchez] -1.21522138 -1.239695 -3.83926 1.60181 # }