Skip to content

lee-kyungho/pysdtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PySDTest

A Python Package for Stochastic Dominance Tests

PySDTest is a Python 3 implementation of routines for Stochastic Dominance tests. This package was created by Kyungho Lee in collaboration with Yoon-Jae Whang.

This package implements stochastic dominance tests proposed by Barrett and Donald (2003, BD), Linton, Maasoumi and Whang (2005, LMW), Linton, Song and Whang (2010, LSW), Donald and Hsu (2014, DH). PySDTest also contains stochastic dominance tests by applying the numerical delta method (Hong and Li (2018, HL)).

Paper

https://arxiv.org/abs/2307.10694

The paper contains practical guidance for using PySDTest. In addition, we briefly give an overview about concepts of stochastic dominance and testing methods.

If you use our package, please cite the paper:

Lee, Kyungho, and Yoon-Jae Whang. "PySDTest: a Python Package for Stochastic Dominance Tests." arXiv preprint arXiv:2307.10694 (2023).

Features

  • Stochastic dominance (SD) testing via imposing the least favorable case (BD, LMW)
  • SD testing via Contact-set approach (LSW)
  • SD testing via Selective recentering approach (DH)
  • SD testing via Numerical delta method (HL)
  • Advanced hypotheses testing (Joint hypotheses testing)
  • Plotting (s-th order) CDFs
  • Resampling: bootstrap, subsampling, and paired-bootstrap

Installation

PySDTest is listed on the Python Package Index (PyPI) which is a repository of software for the Python programming language. If Python is installed on your computer, you can install PySDTest by entering:

pip install PySDTest

in Windows cmd or Mac (or Linux) terminal. For detailed information about installing a Python package, see Python Package User Guide in PyPI.

Importation

After installing PySDTest, an user can import it through the following code:

import pysdtest

Integration with Other Software

Python provides significant advantage regarding interaction with other programming languages and statistical software. Our package can be used in MATLAB, R, Julia, and Stata.

In MATLAB, an user can implement PySDTest as:

% Calling PySDTest in MATLAB
py.pysdtest

The reticulate library in R and the PyCall package in Julia serve similar feature, which calls Python modules in R and Julia, respectively:

# Calling PySDTest in R

library(reticulate)
pysdtest <- import("pysdtest")
# Calling PySDTest in Julia

using PyCall
pysdtest = pyimport("pysdtest")

In Stata, an user can call PySDTest by plugging python codes in between Python: and end. For example, the following codes work for importing PySDTest:

" Calling PySDTest in Stata "
python:
import pysdtest
end

In addition, a user can use python command in Stata to activate Python environment in Stata. For more detailed information, please refer to the Using MATLAB with Python in MATLAB, reticulate library in R, PyCall package in Julia and Python integration feature in Stata.

About

Python Package for Stochastic Dominance Test

Resources

License

Stars

Watchers

Forks

Packages

No packages published