-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check-in version of code uploaded to CRAN
- Loading branch information
Showing
22 changed files
with
3,319 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Package: bayesefa | ||
Type: Package | ||
Title: Bayesian Exploratory Factor | ||
Version: 0.0.0.4 | ||
Date: 2021-02-05 | ||
Authors@R: c( | ||
person("Albert", "Man", | ||
email = "aman3@illinois.edu", | ||
role = c("aut") | ||
), | ||
person("Steven Andrew", "Culpepper", | ||
email = "sculpepp@illinois.edu", | ||
role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0003-4226-6176") | ||
) | ||
) | ||
Description: Exploratory Bayesian factor analysis of continuous, mixed-type, and bounded continuous variables using the mode-jumping algorithm of Man and Culpepper (2020) <doi:10.1080/01621459.2020.1773833>. | ||
License: GPL-3 | ||
Depends: R (>= 3.5.0) | ||
Imports: Rcpp (>= 1.0.1), psych | ||
LinkingTo: Rcpp, RcppArmadillo | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 7.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(EFA_Mode_Jumper) | ||
export(IFA_Mode_Jumper) | ||
export(IFA_Mode_Jumper_MixedResponses) | ||
export(min2LL_ono) | ||
export(mixedresponse_posterior_prediction) | ||
export(proposal2) | ||
importFrom(Rcpp,sourceCpp) | ||
useDynLib(bayesefa, .registration = TRUE) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Package documentation | ||
#' @aliases bayesefa-package | ||
#' @references | ||
#' Man, A. & Culpepper, S. A. (2020). A mode-jumping algorithm for Bayesian factor analysis. Journal of the American Statistical Association, doi:10.1080/01621459.2020.1773833. | ||
#' | ||
#' | ||
"_PACKAGE" | ||
|
||
|
||
# The following block is used by usethis to automatically manage | ||
# roxygen namespace tags. Modify with care! | ||
## usethis namespace: start | ||
#' @useDynLib bayesefa, .registration = TRUE | ||
#' @importFrom Rcpp sourceCpp | ||
## usethis namespace: end | ||
NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#' International Exchange Rate Dataset | ||
#' | ||
#' This dataset was considered by West and Harrison (1997) and | ||
#' Lopes and West (2004). The dataset consists of n = 143 monthly | ||
#' first-differences of the exchange rates of 6 international | ||
#' currencies against the British pound, from Jan 1975 to Dec 1986, | ||
#' these currencies are: US dollar (USD), Canadian dollar (CAD), | ||
#' Japanese yen (JPY), French franc (FRF), German (deutsche) mark (DEM), | ||
#' and the Italian lira (ITL). | ||
#' | ||
#' @format A 143 by 7 \code{matrix} of exchange rate time-series. The variables include: | ||
#' \describe{ | ||
#' \item{\code{Month_Year}}{Month and year of exchange rate data.} | ||
#' \item{\code{USD}}{US dollar} | ||
#' \item{\code{CAD}}{Canadian dollar} | ||
#' \item{\code{JPY}}{Japanese yen} | ||
#' \item{\code{FRF}}{French franc} | ||
#' \item{\code{DEM}}{German (deutsche) mark} | ||
#' \item{\code{ITL}}{Italian lira} | ||
#' } | ||
#' @source | ||
#' | ||
#' Lopes, H. F., and West, M. (2004). Bayesian model assessment in factor analysis, Statistica Sinica, 14, 41–67. | ||
#' | ||
#' Man, A. & Culpepper, S. A. (2020). A mode-jumping algorithm for Bayesian factor analysis. Journal of the American Statistical Association, doi:10.1080/01621459.2020.1773833. | ||
#' | ||
#' West, M., and Harrison, J. (1997), Bayesian forecasting and dynamic models (2nd ed.), Berlin, Heidelberg: Springer-Verlag. | ||
#' | ||
#' @author Steven Culpepper | ||
#' | ||
"exchangerate" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <RcppArmadillo.h> | ||
|
||
#ifndef COMMONEFAFUNCTIONS_H | ||
#define COMMONEFAFUNCTIONS_H | ||
|
||
Rcpp::List proposal2(arma::uvec& new_r_idx,arma::mat& lambda_mean, arma::mat& f_mean); | ||
|
||
Rcpp::List mode_jump(const arma::mat& X, arma::mat& lambda_mean, arma::mat& f_mean, | ||
arma::mat& invClam, const arma::vec sigma, arma::uvec r_idx, double my_gamma); | ||
|
||
arma::mat rmvnorm(unsigned int n, const arma::vec& mu, const arma::mat& S); | ||
|
||
double sim_gamma_type(double x,double alph,double g,double d); | ||
|
||
void update_F_matrix(const arma::mat& Y,const arma::mat& I_K,arma::mat& F,arma::mat& Lambda, | ||
arma::vec& psis_inv); | ||
|
||
void update_invClam(const arma::mat& Lambda,arma::mat& invClam); | ||
|
||
arma::uvec my_setdiff(arma::uvec& x, const arma::uvec& y); | ||
|
||
void update_Lambda_loadings_hard_zero(const arma::mat& Y,arma::uvec& r_idx,arma::mat& F, | ||
arma::mat& Lambda,arma::vec& psis_inv, | ||
const arma::mat invClam,double my_gamma); | ||
|
||
arma::mat kappa_initialize(const arma::vec& Ms); | ||
|
||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.