diff --git a/.Rproj.user/3992D3D4/sources/prop/4F1C9B07 b/.Rproj.user/3992D3D4/sources/prop/4F1C9B07 new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.Rproj.user/3992D3D4/sources/prop/4F1C9B07 @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/AA8888B6 b/.Rproj.user/3992D3D4/sources/prop/AA8888B6 new file mode 100644 index 0000000..4a78862 --- /dev/null +++ b/.Rproj.user/3992D3D4/sources/prop/AA8888B6 @@ -0,0 +1,5 @@ +{ + "tempName": "Untitled1", + "cursorPosition": "3,7", + "scrollLine": "0" +} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/D1765424 b/.Rproj.user/3992D3D4/sources/prop/D1765424 new file mode 100644 index 0000000..a784f2b --- /dev/null +++ b/.Rproj.user/3992D3D4/sources/prop/D1765424 @@ -0,0 +1,6 @@ +{ + "tempName": "Untitled1", + "cursorPosition": "75,17", + "scrollLine": "48", + "last_setup_crc32": "9F8C73CAbb338d19" +} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/FCD88EE5 b/.Rproj.user/3992D3D4/sources/prop/FCD88EE5 index 1f2e483..20f7c93 100644 --- a/.Rproj.user/3992D3D4/sources/prop/FCD88EE5 +++ b/.Rproj.user/3992D3D4/sources/prop/FCD88EE5 @@ -1,5 +1,5 @@ { "tempName": "Untitled1", - "cursorPosition": "23,27", - "scrollLine": "1" + "cursorPosition": "23,8", + "scrollLine": "0" } \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/prop/INDEX b/.Rproj.user/3992D3D4/sources/prop/INDEX index 618717f..1329b2a 100644 --- a/.Rproj.user/3992D3D4/sources/prop/INDEX +++ b/.Rproj.user/3992D3D4/sources/prop/INDEX @@ -25,3 +25,6 @@ H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2Fman%2Fac.ratio.Rd="EF1AA608" H%3A%2FUbuntuRv2%2FIBGS%2FIBGS%2Fman%2FexBIC.Rd="BAAC6886" H%3A%2FUbuntuRv2%2FIBGS%2Ftest.R="FCD88EE5" H%3A%2FUbuntuRv2%2FIBGS%2Ftest.Rout="43B20C7B" +H%3A%2FUbuntuRv2%2FTCGS%2FIBGS.Rmd="D1765424" +H%3A%2FUbuntuRv2%2FTCGS%2FIBGS.tex="4F1C9B07" +H%3A%2FUbuntuRv2%2FTCGS%2Ftcg_ar.R="AA8888B6" diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/142B84EE-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/142B84EE-contents new file mode 100644 index 0000000..e69de29 diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3 b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3 new file mode 100644 index 0000000..1832d0f --- /dev/null +++ b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3 @@ -0,0 +1,25 @@ +{ + "id": "254CACE3", + "path": "H:/UbuntuRv2/IBGS/IBGS/R/blockgibbs.R", + "project_path": "R/blockgibbs.R", + "type": "r_source", + "hash": "0", + "contents": "", + "dirty": false, + "created": 1637272959110.0, + "source_on_save": false, + "relative_order": 6, + "properties": { + "tempName": "Untitled2", + "cursorPosition": "46,37", + "scrollLine": "25" + }, + "folds": "", + "lastKnownWriteTime": 1637239897, + "encoding": "UTF-8", + "collab_server": "", + "source_window": "", + "last_content_update": 1637239897, + "read_only": false, + "read_only_alternatives": [] +} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3-contents new file mode 100644 index 0000000..ec6590d --- /dev/null +++ b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/254CACE3-contents @@ -0,0 +1,49 @@ +#' The iterated block Gibbs sampler algorithm +#' +#' @param y the response variable +#' @param x the predictors +#' @param H the number of predictors in small groups, default is 30 +#' @param kapp the number of selected predictors in first step, default is 20 +#' @param tau the threshold to select the important predictors in second step, default is 0.9 +#' @param len the half number of generated samples, default is 200 +#' @param k the tuning parameter, default is 1 +#' @param gamma the parameter for extended BIC, default is 0.5 +#' @param info the selected model selection criterion from AIC, AICc, BIC and exBIC +#' @param family the type of model from linear, logistic, poisson +#' @param n.iter the number of iterations +#' @param n.models the number of top selected models +#' +#' @return a list contains a summary of final result +#' @export + +BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, + tau = 0.9, len = 200, k = 1, gamma = 0.5, + info = c("AIC", "BIC", "AICc", "exBIC"), + family = c("gaussian","poisson", "binomial")){ + p <- dim(x)[2] + x.predictors <- colnames(x) + colnames(x) <- 1:p + + x1 <- x + x2 <- vector() + + if(n.iter < 2){ + result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, + kapp, tau, len, k, gamma, p, info, family) + } + else{ + j <- 1 + while(j < n.iter){ + v.select <- BlockGibbsSampler.step2(y, x1, x2, H, kapp, tau, len, k, + gamma, p, info, family) + x1 <- x[, -v.select] + x2 <- x[, v.select] + + j <- j+1 + } + result <- BlockGibbsSampler.step3(y, x1, x2, n.models, x.predictors, H, + kapp, tau, len, k, gamma, p, info, family) + } + result$x.predictors <- x.predictors + return(result) +} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF new file mode 100644 index 0000000..283001f --- /dev/null +++ b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF @@ -0,0 +1,26 @@ +{ + "id": "462FD7FF", + "path": "H:/UbuntuRv2/TCGS/IBGS.Rmd", + "project_path": null, + "type": "r_markdown", + "hash": "2363041877", + "contents": "", + "dirty": false, + "created": 1637269087029.0, + "source_on_save": false, + "relative_order": 5, + "properties": { + "tempName": "Untitled1", + "cursorPosition": "75,17", + "scrollLine": "48", + "last_setup_crc32": "9F8C73CAbb338d19" + }, + "folds": "", + "lastKnownWriteTime": 1637272918, + "encoding": "UTF-8", + "collab_server": "", + "source_window": "", + "last_content_update": 1637272918280, + "read_only": false, + "read_only_alternatives": [] +} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF-contents new file mode 100644 index 0000000..1ba7f15 --- /dev/null +++ b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/462FD7FF-contents @@ -0,0 +1,78 @@ +--- +title: "An introduction to IBGS" +author: "Lizhong Chen" +date: "11/19/2021" +output: + pdf_document: default + html_document: + df_print: paged +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +``` + +## Introduction + +Here is a brief introduction to the R package "IBGS". The iterated block Gibbs sampler is a powerful variable selection method in high dimensions. It is important to identify the potential predictors which has significant influence on the response variable. + +The "IBGS" package works for the generalized linear models including linear, logistic and poisson models and uses AIC, AICc, BIC, and exBIC as the model selection criterion. + +There are two main goals for "IBGS" package: + +* Identify the important predictors with the marginal probability + +* Make a prediction based on the best selected model or model averaging using top selected models + +## Install + +To install and load the "IBGS" package, use this command +```{r, echo=FALSE} +cat("install.packages(\"IBGS_0.1.0.tar.gz\", repos = NULL)\nlibrary(IBGS)") +``` + +The "IBGS" package requires "doParallel" package. Please ensure that "doParallel" package is installed and loaded, then set up the register-cores. +```{r, echo=FALSE} +cat("library(doParallel)\nregisterDoParallel(ncores)\n") +``` +where ncores is the number of CPU cores used in the calculation. + +## Main function + +The main function is +```{r, echo=FALSE} +cat("BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, + tau = 0.9, len = 200, k = 1, gamma = 0.5, + info = c(\"AIC\", \"BIC\", \"AICc\", \"exBIC\"), + family = c(\"gaussian\",\"poisson\", \"binomial\"))") +``` +For details, please use help document. +```{r, echo=FALSE} +cat("?BlockGibbsSampler") +``` + +## Example + +Here is an example to show how "IBGS" works. We use the tropical cyclone genesis data. +```{r, echo=FALSE} +load("tcg_ar.RData") +``` + +It has 1856 samples and 149 predictors. +```{r, collapse=TRUE} +dim(x) +``` +We divide the data into train and test set and use the train set ($\approx 80\%$ of data) to run "IBGS" algorithm. Then we use the test set ($\approx 20\%$ of data) to verify the results. + +The simple following command is used +```{r} +cat("model <- BlockGibbsSampler(y_train, x_train, info = \"exBIC\", family = \"binomial\")") +``` +We only need to specify the response, predictors, the model selection criterion and the model type. +### Variable ranking + +We can plot the marginal probabilities for those important predictors using plots.Gibbs command. +```{r, collapse=TRUE} +plots.Gibbs(model) +``` + diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/9A53FC16-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/9A53FC16-contents new file mode 100644 index 0000000..aa1d1fd --- /dev/null +++ b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/9A53FC16-contents @@ -0,0 +1,189 @@ +% Options for packages loaded elsewhere +\PassOptionsToPackage{unicode}{hyperref} +\PassOptionsToPackage{hyphens}{url} +% +\documentclass[ +]{article} +\usepackage{lmodern} +\usepackage{amssymb,amsmath} +\usepackage{ifxetex,ifluatex} +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[T1]{fontenc} + \usepackage[utf8]{inputenc} + \usepackage{textcomp} % provide euro and other symbols +\else % if luatex or xetex + \usepackage{unicode-math} + \defaultfontfeatures{Scale=MatchLowercase} + \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} +\fi +% Use upquote if available, for straight quotes in verbatim environments +\IfFileExists{upquote.sty}{\usepackage{upquote}}{} +\IfFileExists{microtype.sty}{% use microtype if available + \usepackage[]{microtype} + \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts +}{} +\makeatletter +\@ifundefined{KOMAClassName}{% if non-KOMA class + \IfFileExists{parskip.sty}{% + \usepackage{parskip} + }{% else + \setlength{\parindent}{0pt} + \setlength{\parskip}{6pt plus 2pt minus 1pt}} +}{% if KOMA class + \KOMAoptions{parskip=half}} +\makeatother +\usepackage{xcolor} +\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available +\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} +\hypersetup{ + pdftitle={An introduction to IBGS}, + pdfauthor={Lizhong Chen}, + hidelinks, + pdfcreator={LaTeX via pandoc}} +\urlstyle{same} % disable monospaced font for URLs +\usepackage[margin=1in]{geometry} +\usepackage{color} +\usepackage{fancyvrb} +\newcommand{\VerbBar}{|} +\newcommand{\VERB}{\Verb[commandchars=\\\{\}]} +\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} +% Add ',fontsize=\small' for more characters per line +\usepackage{framed} +\definecolor{shadecolor}{RGB}{248,248,248} +\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}} +\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}} +\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.77,0.63,0.00}{#1}} +\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\BuiltInTok}[1]{#1} +\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}} +\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} +\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} +\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}} +\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}} +\newcommand{\ExtensionTok}[1]{#1} +\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} +\newcommand{\ImportTok}[1]{#1} +\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} +\newcommand{\NormalTok}[1]{#1} +\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}} +\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}} +\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}} +\newcommand{\RegionMarkerTok}[1]{#1} +\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} +\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} +\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\usepackage{graphicx,grffile} +\makeatletter +\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} +\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} +\makeatother +% Scale images if necessary, so that they will not overflow the page +% margins by default, and it is still possible to overwrite the defaults +% using explicit options in \includegraphics[width, height, ...]{} +\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} +% Set default figure placement to htbp +\makeatletter +\def\fps@figure{htbp} +\makeatother +\setlength{\emergencystretch}{3em} % prevent overfull lines +\providecommand{\tightlist}{% + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} +\setcounter{secnumdepth}{-\maxdimen} % remove section numbering + +\title{An introduction to IBGS} +\author{Lizhong Chen} +\date{11/19/2021} + +\begin{document} +\maketitle + +\hypertarget{introduction}{% +\subsection{Introduction}\label{introduction}} + +Here is a brief introduction to the R package ``IBGS''. The iterated +block Gibbs sampler is a powerful variable selection method in high +dimensions. It is important to identify the potential predictors which +has significant influence on the response variable. + +The ``IBGS'' package works for the generalized linear models including +linear, logistic and poisson models and uses AIC, AICc, BIC, and exBIC +as the model selection criterion. + +There are two main goals for ``IBGS'' package: + +\begin{itemize} +\item + Identify the important predictors with the marginal probability +\item + Make a prediction based on the best selected model or model averaging + using top selected models +\end{itemize} + +\hypertarget{install}{% +\subsection{Install}\label{install}} + +To install and load the ``IBGS'' package, use this command + +\begin{verbatim} +## install.packages("IBGS_0.1.0.tar.gz", repos = NULL) +## library(IBGS) +\end{verbatim} + +The ``IBGS'' package requires ``doParallel'' package. Please ensure that +``doParallel'' package is installed and loaded, then set up the +register-cores. + +\begin{verbatim} +## library(doParallel) +## registerDoParallel(ncores) +\end{verbatim} + +where ncores is the number of CPU cores used in the calculation. + +\hypertarget{main-function}{% +\subsection{Main function}\label{main-function}} + +The main function is + +\begin{verbatim} +## BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, +## tau = 0.9, len = 200, k = 1, gamma = 0.5, +## info = c("AIC", "BIC", "AICc", "exBIC"), +## family = c("gaussian","poisson", "binomial")) +\end{verbatim} + +For details, please use help document. + +\begin{verbatim} +## ?BlockGibbsSampler +\end{verbatim} + +\hypertarget{example}{% +\subsection{Example}\label{example}} + +Here is an example to show how ``IBGS'' works. We use the tropical +cyclone genesis data. + +It has 1856 samples and 149 predictors. + +\begin{Shaded} +\begin{Highlighting}[] +\KeywordTok{dim}\NormalTok{(x)} +\CommentTok{## [1] 1856 149} +\end{Highlighting} +\end{Shaded} + +We divide the data into train and test set and use the train set +(\$\approx\$80\% of data) + +\end{document} diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043 b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043 new file mode 100644 index 0000000..07bef63 --- /dev/null +++ b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043 @@ -0,0 +1,25 @@ +{ + "id": "A15EC043", + "path": "H:/UbuntuRv2/TCGS/tcg_ar.R", + "project_path": null, + "type": "r_source", + "hash": "0", + "contents": "", + "dirty": false, + "created": 1637268014092.0, + "source_on_save": false, + "relative_order": 4, + "properties": { + "tempName": "Untitled1", + "cursorPosition": "3,7", + "scrollLine": "0" + }, + "folds": "", + "lastKnownWriteTime": 1637268337, + "encoding": "UTF-8", + "collab_server": "", + "source_window": "", + "last_content_update": 1637268337695, + "read_only": false, + "read_only_alternatives": [] +} \ No newline at end of file diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043-contents b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043-contents new file mode 100644 index 0000000..2457986 --- /dev/null +++ b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/A15EC043-contents @@ -0,0 +1,29 @@ +library(IBGS) +library(doParallel) + +setwd("/mnt/h/UbuntuRv2/TCGS") + +#parallel setting +registerDoParallel(12) +set.seed(101) + +tcg <- read.csv("TC_data_12h_AR_Matched.csv") +z <- tcg[,8:157] + +y <- z$y +x <- as.matrix(z[,-1]) + +n <- dim(x)[1] +p <- dim(x)[2] + +index_train <- sample(x = 2, size = n, replace = TRUE, prob = c(0.8,0.2)) + +x_train <- x[index_train == 1, ] +y_train <- y[index_train == 1 ] + +x_test <- x[index_train == 2, ] +y_test <- y[index_train == 2 ] + +model <- BlockGibbsSampler(y_train, x_train, info = "exBIC", family = "binomial") + +save.image("tcg_ar.RData") diff --git a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702 b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702 index f1f102e..78675c6 100644 --- a/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702 +++ b/.Rproj.user/3992D3D4/sources/s-9F8C73CA/EB3BE702 @@ -3,7 +3,7 @@ "path": "H:/UbuntuRv2/IBGS/test.R", "project_path": null, "type": "r_source", - "hash": "524880278", + "hash": "0", "contents": "", "dirty": false, "created": 1637209496925.0, @@ -11,8 +11,8 @@ "relative_order": 10, "properties": { "tempName": "Untitled1", - "cursorPosition": "23,27", - "scrollLine": "1" + "cursorPosition": "23,8", + "scrollLine": "0" }, "folds": "", "lastKnownWriteTime": 1637237719, diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49F8C73CA/chunks.json b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49F8C73CA/chunks.json new file mode 100644 index 0000000..56836b2 --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/3992D3D49F8C73CA/chunks.json @@ -0,0 +1 @@ +{"chunk_definitions":[{"row":12,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"setup","include":false},"document_id":"462FD7FF","chunk_id":"csetup_chunk","chunk_label":"setup"},{"row":31,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-14"},"document_id":"462FD7FF","chunk_id":"cqmvnsw06ftmj","chunk_label":"unnamed-chunk-1"},{"row":36,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-10"},"document_id":"462FD7FF","chunk_id":"cs66fm6jqvos8","chunk_label":"unnamed-chunk-2"},{"row":47,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-11"},"document_id":"462FD7FF","chunk_id":"c93jpyd1jmhhi","chunk_label":"unnamed-chunk-3"},{"row":51,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-23"},"document_id":"462FD7FF","chunk_id":"cz52i8jarnd8t","chunk_label":"unnamed-chunk-4"},{"row":58,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-24"},"document_id":"462FD7FF","chunk_id":"cfq06oe8jrdlh","chunk_label":"unnamed-chunk-5"},{"row":63,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-25"},"document_id":"462FD7FF","chunk_id":"c9kilm1aj7mw3","chunk_label":"unnamed-chunk-6"},{"row":69,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"unnamed-chunk-26"},"document_id":"462FD7FF","chunk_id":"cubqz02zklowi","chunk_label":"unnamed-chunk-7"},{"row":76,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-27"},"document_id":"462FD7FF","chunk_id":"cbmf9q6dlwd8j","chunk_label":"unnamed-chunk-8"}],"doc_write_time":1637272637,"working_dir":null,"default_chunk_options":{"echo":true},"chunk_rendered_width":400} \ No newline at end of file diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c93jpyd1jmhhi/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c93jpyd1jmhhi/000002.csv new file mode 100644 index 0000000..6eee423 --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c93jpyd1jmhhi/000002.csv @@ -0,0 +1,8 @@ +"0","cat(""BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20," +"0"," tau = 0.9, len = 200, k = 1, gamma = 0.5," +"0"," info = c(\""AIC\"", \""BIC\"", \""AICc\"", \""exBIC\"")," +"0"," family = c(\""gaussian\"",\""poisson\"", \""binomial\""))"")" +"1","BlockGibbsSampler <- function(y, x, n.iter = 3, n.models =10, H = 30, kapp = 20, + tau = 0.9, len = 200, k = 1, gamma = 0.5, + info = c(""AIC"", ""BIC"", ""AICc"", ""exBIC""), + family = c(""gaussian"",""poisson"", ""binomial""))" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c9kilm1aj7mw3/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c9kilm1aj7mw3/000002.csv new file mode 100644 index 0000000..79c0d95 --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/c9kilm1aj7mw3/000002.csv @@ -0,0 +1,6 @@ +"0","dim(x)" +"1","[1]" +"1"," 1856" +"1"," 149" +"1"," +" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000002.csv new file mode 100644 index 0000000..7f46bad --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000002.csv @@ -0,0 +1 @@ +"0","plots.Gibbs(model)" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.metadata b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.metadata new file mode 100644 index 0000000..1e35f3c --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.metadata @@ -0,0 +1 @@ +{"height":432.6328800988875,"width":700.0,"size_behavior":0,"conditions":[]} \ No newline at end of file diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.png b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.png new file mode 100644 index 0000000..62ea67c Binary files /dev/null and b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.png differ diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.snapshot b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.snapshot new file mode 100644 index 0000000..5ff0a49 Binary files /dev/null and b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cbmf9q6dlwd8j/000003.snapshot differ diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cfq06oe8jrdlh/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cfq06oe8jrdlh/000002.csv new file mode 100644 index 0000000..5e91b71 --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cfq06oe8jrdlh/000002.csv @@ -0,0 +1 @@ +"0","load(""tcg_ar.RData"")" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/chunks.json b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/chunks.json new file mode 100644 index 0000000..3720aea --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/chunks.json @@ -0,0 +1 @@ +{"chunk_definitions":[{"row":12,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"setup","include":false},"document_id":"462FD7FF","chunk_id":"csetup_chunk","chunk_label":"setup"},{"row":31,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-14"},"document_id":"462FD7FF","chunk_id":"cqmvnsw06ftmj","chunk_label":"unnamed-chunk-1"},{"row":36,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-10"},"document_id":"462FD7FF","chunk_id":"cs66fm6jqvos8","chunk_label":"unnamed-chunk-2"},{"row":47,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-11"},"document_id":"462FD7FF","chunk_id":"c93jpyd1jmhhi","chunk_label":"unnamed-chunk-3"},{"row":51,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-23"},"document_id":"462FD7FF","chunk_id":"cz52i8jarnd8t","chunk_label":"unnamed-chunk-4"},{"row":58,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","echo":false,"label":"unnamed-chunk-24"},"document_id":"462FD7FF","chunk_id":"cfq06oe8jrdlh","chunk_label":"unnamed-chunk-5"},{"row":63,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-25"},"document_id":"462FD7FF","chunk_id":"c9kilm1aj7mw3","chunk_label":"unnamed-chunk-6"},{"row":69,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","label":"unnamed-chunk-26"},"document_id":"462FD7FF","chunk_id":"cubqz02zklowi","chunk_label":"unnamed-chunk-7"},{"row":76,"row_count":1,"visible":true,"expansion_state":0,"options":{"engine":"r","collapse":true,"label":"unnamed-chunk-27"},"document_id":"462FD7FF","chunk_id":"cbmf9q6dlwd8j","chunk_label":"unnamed-chunk-8"}],"doc_write_time":1637272637,"working_dir":null,"default_chunk_options":{"echo":true},"chunk_rendered_width":700} \ No newline at end of file diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cqmvnsw06ftmj/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cqmvnsw06ftmj/000002.csv new file mode 100644 index 0000000..1a240b1 --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cqmvnsw06ftmj/000002.csv @@ -0,0 +1,3 @@ +"0","cat(""install.packages(\""IBGS_0.1.0.tar.gz\"", repos = NULL)\nlibrary(IBGS)"")" +"1","install.packages(""IBGS_0.1.0.tar.gz"", repos = NULL) +library(IBGS)" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cs66fm6jqvos8/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cs66fm6jqvos8/000002.csv new file mode 100644 index 0000000..0338f24 --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cs66fm6jqvos8/000002.csv @@ -0,0 +1,4 @@ +"0","cat(""library(doParallel)\nregisterDoParallel(ncores)\n"")" +"1","library(doParallel) +registerDoParallel(ncores) +" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/csetup_chunk/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/csetup_chunk/000002.csv new file mode 100644 index 0000000..3624c10 --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/csetup_chunk/000002.csv @@ -0,0 +1 @@ +"0","knitr::opts_chunk$set(echo = TRUE)" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cubqz02zklowi/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cubqz02zklowi/000002.csv new file mode 100644 index 0000000..f1cc1ae --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cubqz02zklowi/000002.csv @@ -0,0 +1,2 @@ +"0","cat(""model <- BlockGibbsSampler(y_train, x_train, info = \""exBIC\"", family = \""binomial\"")"")" +"1","model <- BlockGibbsSampler(y_train, x_train, info = ""exBIC"", family = ""binomial"")" diff --git a/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cz52i8jarnd8t/000002.csv b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cz52i8jarnd8t/000002.csv new file mode 100644 index 0000000..a6e7173 --- /dev/null +++ b/.Rproj.user/shared/notebooks/8107308D-IBGS/1/s/cz52i8jarnd8t/000002.csv @@ -0,0 +1,2 @@ +"0","cat(""?BlockGibbsSampler"")" +"1","?BlockGibbsSampler" diff --git a/.Rproj.user/shared/notebooks/paths b/.Rproj.user/shared/notebooks/paths index 1c5374c..ecd2c0f 100644 --- a/.Rproj.user/shared/notebooks/paths +++ b/.Rproj.user/shared/notebooks/paths @@ -22,3 +22,6 @@ H:/UbuntuRv2/IBGS/IBGS/man/ac.ratio.Rd="7A1935D0" H:/UbuntuRv2/IBGS/IBGS/man/exBIC.Rd="1F3ED0BF" H:/UbuntuRv2/IBGS/test.R="56BC3B27" H:/UbuntuRv2/IBGS/test.Rout="56702734" +H:/UbuntuRv2/TCGS/IBGS.Rmd="8107308D" +H:/UbuntuRv2/TCGS/IBGS.tex="2DC8B9FE" +H:/UbuntuRv2/TCGS/tcg_ar.R="DBEF9E09"