genRandomProposals: genRandomProposals Generates a set of random proposal to face...

Description Usage Arguments Value Examples

View source: R/genRandomProposals.R

Description

Generates a set of Random proposals to face the status quo. Several different probability distributions can be used to generate the proposals.

Usage

1
2
3
4
5
6
7
8
genRandomProposals(
  numberOfDimensionsGenRandomProposals = 2,
  numberOfRandomProposalsGenRandomProposals = 3,
  distributionTypeGenRandomProposals = "unif",
  distributionParametersGenRandomProposals = c(-1, 1),
  dimOneBoundsGenRandomProposals = c(-Inf, Inf),
  dimTwoBoundsGenRandomProposals = c(-Inf, Inf)
)

Arguments

numberOfDimensionsGenRandomProposals

The number of policy dimensions.

numberOfRandomProposalsGenRandomProposals

Number of RandomProposals to generate.

distributionTypeGenRandomProposals

A string identifying the base R discribution to draw the ideal points from. Uses the base R random number generation family of commands rxxxx (see ?distributions). The user should specify the distribution as a string using the standard R abreviation for the distribution (see ?distributions for a list). Currently supported are: "norm", "unif", "beta", "cauchy", "chisq", "weibull"

distributionParametersGenRandomProposals

A vector that contains the additional parameters needed by the particular rxxxx function for a distribtuion. (see ?rxxxx where xxxx is a function listed under ?distribution). Example for a Normal(0,1), use: c(0,1).

dimOneBoundsGenRandomProposals

A vector that contains the starting and ending poitns of t he first dimension. Example: c(0,1). Defaults to c(-Inf, Inf) if no boundary is provided.

dimTwoBoundsGenRandomProposals

A vector that contains the starting and ending poitns of t he first dimension. Example: c(0,1). Defaults to c(-Inf, Inf) if no boundary is provided.

Value

outRandomProposalsDataFrame data.frame The RandomProposals data frame will have the following format.

proposalID: A numeric identifier unique to the voter. xLocation: The x coordinate of the voter's ideal point. yLocation: The y coordinate of the voter's ideal point.

Examples

1
2
3
4
5
  genRandomProposals(numberOfDimensionsGenRandomProposals=1, numberOfRandomProposalsGenRandomProposals=10, distributionTypeGenRandomProposals ="unif", distributionParametersGenRandomProposals = c(-1,1), dimOneBoundsGenRandomProposals = c(-Inf,Inf), dimTwoBoundsGenRandomProposals = c(-Inf,Inf) ) 
 
  genRandomProposals(numberOfDimensionsGenRandomProposals=2, numberOfRandomProposalsGenRandomProposals=100, distributionTypeGenRandomProposals ="norm")
  
 genRandomProposals(numberOfDimensionsGenRandomProposals=2, numberOfRandomProposalsGenRandomProposals=10, distributionTypeGenRandomProposals ="beta", distributionParametersGenRandomProposals = c(.1,1), dimOneBoundsGenRandomProposals = c(0,1), dimTwoBoundsGenRandomProposals = c(0,1) ) 

robiRagan/voteR documentation built on Feb. 27, 2020, 6:48 p.m.