tune_hyper {pumBayes}R Documentation

Generate Probability Samples for Voting "Yes"

Description

This function generates probability samples for Voting "Yes". It uses predefined hyperparameters and simulates data based on the specified number of members ('n_leg') and issues ('n_issue').

Usage

tune_hyper(hyperparams = hyperparams, n_leg, n_issue)

Arguments

hyperparams

A list of hyperparameter values: - 'beta_mean': The prior mean of the 'beta' parameter, representing legislator positions. - 'beta_var': The prior variance of 'beta'. - 'alpha_mean': A vector of length two, specifying the prior means of the item discrimination parameters, 'alpha1' and 'alpha2'. - 'alpha_scale': The scale parameter for 'alpha1' and 'alpha2'. - 'delta_mean': A vector of length two, indicating the prior means of the item difficulty parameters, 'delta1' and 'delta2'. - 'delta_scale': The scale parameter for 'delta1' and 'delta2'.

n_leg

Integer, representing the number of legislators (members) to be simulated.

n_issue

Integer, indicating the number of issues to be simulated.

Value

A numeric vector containing the simulated probabilities of voting "Yes" for legislators across issues.

Examples

hyperparams = list(beta_mean = 0, beta_var = 1, alpha_mean = c(0, 0),
                   alpha_scale = 5, delta_mean = c(-2, 10),
                   delta_scale = sqrt(10))
theta = tune_hyper(hyperparams, n_leg = 10, n_issue = 10)

[Package pumBayes version 1.0.0 Index]