MyNixOS website logo
Description

Compares Random Distributions using Stochastic Dominance.

The Stochastic Dominance (SD) is the classical way of comparing two random prospects, using their distribution functions. Almost Stochastic Dominance (ASD) has also been developed to cover the SD failures due to the extreme utility functions. This package focuses on classical and heuristic methods for testing the first and second SD and ASD methods given the probability mass function (PMF) of the random prospects. The goal is to apply these methods easily, efficiently, and effectively on real-world datasets. For more details see Hanoch and Levy (1969) <doi:10.2307/2296431>, Leshno and Levy (2002) <doi:10.1287/mnsc.48.8.1074.169>, and Tzeng et al. (2012) <doi:10.1287/mnsc.1120.1616>.

RSD

RSD (RStochastic Dominance) is designed and developed to calculate Stochastic Dominance (SD) and Almost Stochastic Dominance (ASD) in general. In more details, given two probability mass functions (PMF), this package helps with:

  • Calculate the first and second order SD values (FSD and SSD, respectively),
  • Calculate the first and second order ASD values (AFSD and ASSD, respectively),
  • Compare two probability distributions by these methods.

Installation

Install the released version of RSD from CRAN by:

install.packages("RSD")

Or from GitHub by:

install.packages("pak")
pak::pkg_install("ShayanTohidi/RSD")

Getting Started

RSD provides a function, createStochasticDominance() to create the SD object to be used in all other functions of this package. This function requires two discrete distributions. Here, the example data set data_ex will be used for creating the object:

library(RSD)
outcome1 = data_ex$yield[data_ex$gen == 'B73/PHM49']
outcome2 = data_ex$yield[data_ex$gen == 'LH74/PHN82']
pr = rep(1/29,29)
sd.obj = createStochasticDominance(outcome1, outcome2, pr, pr)

Using this code, we can compare the distributions of the performance (yield) of two cultivars. The output of this code snippet, sd.obj contains all information for performing SD and ASD comparisons. This is the main argument in the other functions of this package.

Metadata

Version

0.2.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows