Skip to content

Commit ee4af4c

Browse files
authored
Merge pull request #40 from jonlachmann/pre-cran
Pre cran
2 parents f57a2c4 + d467980 commit ee4af4c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+221
-236
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ Description: Implements the Mode Jumping Markov Chain Monte Carlo algorithm desc
1313
URL: https://github.com/jonlachmann/FBMS
1414
License: GPL-2
1515
Depends:
16-
R (>= 3.5.0),
16+
R (>= 3.5.0)
1717
Imports:
1818
Rcpp,
1919
fastglm,
2020
GenSA,
21+
parallel,
2122
methods,
2223
r2r,
2324
BAS,

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ S3method(coef,gmjmcmc)
66
S3method(coef,gmjmcmc_merged)
77
S3method(coef,mjmcmc)
88
S3method(coef,mjmcmc_parallel)
9-
S3method(fitted,fbms_predict)
109
S3method(get.best.model,gmjmcmc)
1110
S3method(get.best.model,gmjmcmc_merged)
1211
S3method(get.best.model,mjmcmc)
@@ -51,6 +50,7 @@ export(erf)
5150
export(exp_dbl)
5251
export(fbms)
5352
export(fbms.mlik.master)
53+
export(fitted.fbms_predict)
5454
export(gaussian.loglik)
5555
export(gelu)
5656
export(gen.params.gmjmcmc)

R/abalone-data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Physical measurements of 4177 abalones, a species of sea snail.
1+
#' Physical Measurements of 4177 Abalones, a Species of Sea Snail.
22
#'
33
#' %% ~~ A concise (1-5 lines) description of the dataset. ~~
44
#'

R/alpha_generation.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ gen.alphas <- function (strategy, feature, data, loglik, verbose) {
99
return(feature)
1010
}
1111

12-
#' Alpha generator using strategy 1 as per Hubin et. al.
12+
#' Alpha Generator Using Strategy 1 as per Hubin et. al.
1313
#' TODO: This is just a placeholder.
1414
#'
1515
#' @noRd
@@ -19,7 +19,7 @@ alpha_1 <- function (feature) {
1919
return(feature)
2020
}
2121

22-
#' Alpha generator using strategy 2 as per Hubin et. al.
22+
#' Alpha Generator Using Strategy 2 as per Hubin et. al.
2323
#' TODO: This is just a placeholder.
2424
#'
2525
#' @noRd
@@ -29,7 +29,7 @@ alpha_2 <- function (feature) {
2929
return(feature)
3030
}
3131

32-
#' Alpha generator using strategy 3 as per Hubin et. al.
32+
#' Alpha Generator Using Strategy 3 as per Hubin et. al.
3333
#'
3434
#' @param feature The feature to generate alphas for
3535
#' @param data The dataset used
@@ -65,7 +65,7 @@ alpha_3 <- function (feature, data, loglik, verbose) {
6565
return(feature)
6666
}
6767

68-
#' Alpha generator using strategy 4 as per Hubin et. al.
68+
#' Alpha Generator Using Strategy 4 as per Hubin et. al.
6969
#'
7070
#' @param feature The feature to generate alphas for
7171
#'

R/arguments.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Created by: jonlachmann
44
# Created on: 2021-02-19
55

6-
#' Generate a probability list for MJMCMC (Mode Jumping MCMC)
6+
#' Generate a Probability List for MJMCMC (Mode Jumping MCMC)
77
#'
88
#' @return A named list with five elements:
99
#' \describe{
@@ -41,7 +41,7 @@ gen.probs.mjmcmc <- function () {
4141
return(probs)
4242
}
4343

44-
#' Generate a probability list for GMJMCMC (Genetically Modified MJMCMC)
44+
#' Generate a Probability List for GMJMCMC (Genetically Modified MJMCMC)
4545
#'
4646
#' @param transforms A list of the transformations used (to get the count).
4747
#'
@@ -119,7 +119,7 @@ gen.probs.gmjmcmc <- function (transforms) {
119119
return(probs)
120120
}
121121

122-
#' Generate a parameter list for MJMCMC (Mode Jumping MCMC)
122+
#' Generate a Parameter List for MJMCMC (Mode Jumping MCMC)
123123
#'
124124
#' @param ncov The number of covariates in the dataset that will be used in the algorithm
125125
#'
@@ -216,7 +216,7 @@ gen.params.mjmcmc <- function (ncov) {
216216
return(params)
217217
}
218218

219-
#' Generate a parameter list for GMJMCMC (Genetically Modified MJMCMC)
219+
#' Generate a Parameter List for GMJMCMC (Genetically Modified MJMCMC)
220220
#'
221221
#' This function generates the full list of parameters required for the Generalized Mode Jumping Markov Chain Monte Carlo (GMJMCMC) algorithm, building upon the parameters from \code{gen.params.mjmcmc}. The generated parameter list includes feature generation settings, population control parameters, and optimization controls for the search process.
222222
#'

R/exa-data.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Excerpt from the Open Exoplanet Catalogue data set
1+
#' Excerpt from the Open Exoplanet Catalogue Data Set
22
#'
33
#' Data fields include planet and host star attributes.
44
#'
@@ -32,4 +32,4 @@
3232
#' Toronto, Ontario M1C 1A4
3333
#' hanno.rein 'at' utoronto.ca
3434
#'
35-
"exoplanet"
35+
"exoplanet"

R/fbms.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#' Fit a BGNLM model using Genetically Modified Mode Jumping Markov Chain Monte Carlo (MCMC) sampling.
2-
#' Or Fit a BGLM model using Modified Mode Jumping Markov Chain Monte Carlo (MCMC) sampling.
3-
#'
1+
#' Fit a BGNLM Model Using MJMCMC or GMJMCMC Sampling.
2+
#'
43
#' This function fits a model using the relevant MCMC sampling. The user can specify the formula,
54
#' family, data, transforms, and other parameters to customize the model.
65
#'

R/feature.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# | NA FEAT3 ALPHA3 |
1717
# ...
1818

19-
#' Create method for "feature" class
19+
#' Create Method for \"feature\" Class
2020
#'
2121
#' @param transform A numeric denoting the transform type
2222
#' @param features A list of features to include
@@ -58,7 +58,7 @@ create.feature <- function (transform, features, trans.priors, alphas=NULL) {
5858
return(feature)
5959
}
6060

61-
#' Update alphas on a feature
61+
#' Update Alphas on a Feature
6262
#'
6363
#' @param feature The feature to be updated
6464
#' @param alphas The alphas that will be used
@@ -93,7 +93,7 @@ update.alphas <- function (feature, alphas, recurse=FALSE) {
9393
else return(feature)
9494
}
9595

96-
#' Print method for "feature" class
96+
#' Print Method for \"feature\" Class
9797
#'
9898
#' @param x An object of class "feature"
9999
#' @param dataset Set the regular covariates as columns in a dataset

R/gmjmcmc.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#' @importFrom Rcpp sourceCpp
99
NULL
1010

11-
#' Main algorithm for GMJMCMC (Genetically Modified MJMCMC)
11+
#' Main Algorithm for GMJMCMC (Genetically Modified MJMCMC)
1212
#'
1313
#' @param x matrix containing the design matrix with data to use in the algorithm
1414
#' @param y response variable
@@ -202,7 +202,7 @@ gmjmcmc <- function (
202202
}
203203

204204

205-
#' Subalgorithm for generating a new population of features in GMJMCMC (Genetically Modified MJMCMC)
205+
#' Subalgorithm for Generating a New Population of Features in GMJMCMC (Genetically Modified MJMCMC)
206206
#'
207207
#' @param S.t The current population of features
208208
#' @param F.0 The initial population of features, i.e. the bare covariates
@@ -294,4 +294,3 @@ gmjmcmc.transition <- function (S.t, F.0, data, loglik.alpha, marg.probs.F.0, ma
294294
}
295295
return(S.t)
296296
}
297-

R/gmjmcmc_support.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
# Created by: jonlachmann
44
# Created on: 2021-02-11
55

6-
#' Set the transformations option for GMJMCMC (Genetically Modified MJMCMC),
7-
#' this is also done when running the algorithm, but this function allows for it to be done manually.
6+
#' Set the Transformations Option for GMJMCMC (Genetically Modified MJMCMC).
7+
#'
8+
#' This is also done when running the algorithm, but this function allows for it to be done manually.
89
#'
910
#' @param transforms The vector of non-linear transformations
1011
#'
@@ -38,7 +39,7 @@ verify.inputs <- function (data, loglik.pi, transforms, T, N, N.final, probs, pa
3839
if (sum(probs$large.kern > 1 | probs$large.kern < 0) != 0) error <- c(error, "Large jump kernel probabilities must be in [0,1].")
3940
}
4041

41-
#' Function for calculating marginal inclusion probabilities of features given a list of models
42+
#' Function for Calculating Marginal Inclusion Probabilities of Features Given a List of Models
4243
#' @param models The list of models to use.
4344
#'
4445
#' @return A numeric vector of marginal model probabilities based on relative frequencies of model visits in MCMC.
@@ -61,7 +62,7 @@ marginal.probs <- function (models) {
6162
return(probs)
6263
}
6364

64-
#' Function for calculating feature importance through renormalized model estimates
65+
#' Function for Calculating Feature Importance Through Renormalized Model Estimates
6566
#' @param models The models to use.
6667
#' @param type Select which probabilities are of interest, features or models
6768
#'

0 commit comments

Comments
 (0)