Title: | Estimating the Degrees of Freedom of the Student's t-Distribution under a Bayesian Framework |
Version: | 1.0.0 |
Description: | A Bayesian framework to estimate the Student's t-distribution's degrees of freedom is developed. Markov Chain Monte Carlo sampling routines are developed as in <doi:10.3390/axioms11090462> to sample from the posterior distribution of the degrees of freedom. A random walk Metropolis algorithm is used for sampling when Jeffrey's and Gamma priors are endowed upon the degrees of freedom. In addition, the Metropolis-adjusted Langevin algorithm for sampling is used under the Jeffrey's prior specification. The Log-normal prior over the degrees of freedom is posed as a viable choice with comparable performance in simulations and real-data application, against other prior choices, where an Elliptical Slice Sampler is used to sample from the concerned posterior. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.3 |
URL: | https://github.com/Roy-SR-007/bayesestdft |
BugReports: | https://github.com/Roy-SR-007/bayesestdft/issues |
Imports: | numDeriv, dplyr |
Depends: | R (≥ 4.0.4) |
LazyData: | true |
NeedsCompilation: | no |
Packaged: | 2025-01-09 05:01:34 UTC; somjit |
Author: | Somjit Roy [aut, cre], Se Yoon Lee [aut, ctb] |
Maintainer: | Somjit Roy <sroy_123@tamu.edu> |
Repository: | CRAN |
Date/Publication: | 2025-01-09 18:10:01 UTC |
Estimating the Student's t degrees of freedom (dof) with a Gamma Prior over the dof
Description
BayesGA
samples from the posterior distribution of the degrees of freedom (dof) with Gamma prior endowed upon the dof, using a random walk Metropolis (RMW) algorithm.
Usage
BayesGA(y, ini.nu = 1, S = 1000, delta = 0.001, a = 1, b = 0.1)
Arguments
y |
an N-dimensional vector of continuous observations supported on the real-line |
ini.nu |
the initial posterior sample value of the degrees of freedom (default is 1) |
S |
the number of posterior samples (default is 1000) |
delta |
the step size for the respective sampling engines (default is 0.001) |
a |
rate parameter of Gamma prior (default is 1, corresponds to an Exponential prior) |
b |
rate parameter of Gamma prior (default is 0.1) |
Value
A vector of posterior sample estimates
res |
an S-dimensional vector with the posterior samples |
References
Lee, S. Y. (2022). "The Use of a Log-Normal Prior for the Student t-Distribution", Axioms, doi:10.3390/axioms11090462
Fernández, C., Steel, M. F. (1998). "On Bayesian modeling of fat tails and skewness", Journal of the American Statistical Association, doi:10.1080/01621459.1998.10474117
Juárez, M. A., Steel, M. F. (2010). "Model-Based Clustering of Non-Gaussian Panel Data Based on Skew-t Distributions", Journal of Business and Economic Statistics, doi:10.1198/jbes.2009.07145
Examples
# data from Student's t-distribution with dof = 0.1
y = rt(n = 100, df = 0.1)
# running the random walk Metropolis algorithm with default settings
nu = BayesGA(y)
# reporting the posterior mean estimate of the dof
mean(nu)
# application to log-return (daily index values) of United States (S&P500)
data(index_return)
# log-returns of United States
index_return_US <- dplyr::filter(index_return, Country == "United States")
y = index_return_US$log_return_rate
# running the random walk Metropolis algorithm with default settings
nu = BayesGA(y)
# reporting the posterior mean estimate of the dof from the log-return data of US
mean(nu)
Estimating the Student's t degrees of freedom (dof) with a Jeffreys Prior over the dof
Description
BayesJeffreys
samples from the posterior distribution of the degrees of freedom (dof) with Jeffreys prior endowed upon the dof, using a random walk Metropolis (RMW) algorithm and Metropolis-adjusted Langevin algorithm (MALA).
Usage
BayesJeffreys(
y,
ini.nu = 1,
S = 1000,
delta = 0.001,
sampling.alg = c("MH", "MALA")
)
Arguments
y |
an N-dimensional vector of continuous observations supported on the real-line |
ini.nu |
the initial posterior sample value of the degrees of freedom (default is 1) |
S |
the number of posterior samples (default is 1000) |
delta |
the step size for the respective sampling engines (default is 0.001) |
sampling.alg |
takes the choice of the sampling algorithm to be performed, either 'MH' or 'MALA' |
Value
A vector of posterior sample estimates
res |
an S-dimensional vector with the posterior samples |
References
Lee, S. Y. (2022). "The Use of a Log-Normal Prior for the Student t-Distribution", Axioms, doi:10.3390/axioms11090462
Gustafson, P. (1998). "A guided walk Metropolis algorithm", Statistics and Computing, doi:10.1023/A:1008880707168
Examples
# data from Student's t-distribution with dof = 0.1
y = rt(n = 100, df = 0.1)
# running the random walk Metropolis algorithm with default settings
nu1 = BayesJeffreys(y, sampling.alg = "MH")
# reporting the posterior mean estimate of the dof
mean(nu1)
# running MALA with default settings
nu2 = BayesJeffreys(y, sampling.alg = "MALA")
# reporting the posterior mean estimate of the dof
mean(nu2)
# application to log-return (daily index values) of United States (S&P500)
data(index_return)
# log-returns of United States
index_return_US <- dplyr::filter(index_return, Country == "United States")
y = index_return_US$log_return_rate
# running the random walk Metropolis algorithm with default settings
nu1 = BayesJeffreys(y, sampling.alg = "MH")
# reporting the posterior mean estimate of the dof from the log-return data of US
mean(nu1)
# running MALA with default settings
nu2 = BayesJeffreys(y, sampling.alg = "MALA")
# reporting the posterior mean estimate of the dof from the log-return data of US
mean(nu2)
Estimating the Student's t degrees of freedom (dof) with a Log-normal Prior over the dof
Description
BayesLNP
samples from the posterior distribution of the degrees of freedom (dof) with Log-normal prior endowed upon the dof, using an Elliptical Slice Sampler (ESS).
Usage
BayesLNP(y, ini.nu = 1, S = 1000, mu = 1, sigma.sq = 1)
Arguments
y |
an N-dimensional vector of continuous observations supported on the real-line |
ini.nu |
the initial posterior sample value of the degrees of freedom (default is 1) |
S |
the number of posterior samples (default is 1000) |
mu |
mean of the Log-normal prior density (default is 1) |
sigma.sq |
variance of the Log-normal prior density (default is 1) |
Value
A vector of posterior sample estimates
res |
an S-dimensional vector with the posterior samples |
References
Lee, S. Y. (2022). "The Use of a Log-Normal Prior for the Student t-Distribution", Axioms, doi:10.3390/axioms11090462
Murray, I., Prescott Adams, R., MacKay, D. J. (2010). "Elliptical slice sampling", Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics
Examples
# data from Student's t-distribution with dof = 0.1
y = rt(n = 100, df = 0.1)
# running the Elliptical Slice Sampler (ESS) with default settings
nu = BayesLNP(y)
# reporting the posterior mean estimate of the dof
mean(nu)
# application to log-return (daily index values) of United States (S&P500)
data(index_return)
# log-returns of United States
index_return_US <- dplyr::filter(index_return, Country == "United States")
y = index_return_US$log_return_rate
# running the Elliptical Slice Sampler (ESS) with default settings
nu = BayesLNP(y)
# reporting the posterior mean estimate of the dof from the log-return data of US
mean(nu)
Stock Market Index Return Data
Description
The stock market returns are recorded for four countries viz., United States (S&P500), Japan (NIKKEI225), Germany (DAX Index), and South Korea (KOSPI). Specifically log return rates (as computed in Section 5 of doi:10.3390/axioms11090462) are recorded for 5 months in the year 2009 for all the four countries, where these rates are considered to be Student's t-distributed and used for the purpose of estimating the corresponding degrees of freedom using a Bayesian model-based framework, developed in doi:10.3390/axioms11090462.
Usage
index_return
Format
A data frame with 4 columns:
- Country
name of the country to which the log return rate corresponds to: 'United States', 'Japan', 'Germany', and 'South Korea'
- log_return_rate
value of the log return rate
- time_index
an index for the log return rate observations
- date
the date on which the log return rate was recorded
Source
(Lee, 2022), doi:10.3390/axioms11090462.