Skip to content

Commit 7aef051

Browse files
authored
Hot fix for CRAN RNG Issue with r-devel (close #15) (#16)
* Add suggested temporary fix by Kurt to R 3.6.0's RNG change. * Minor documentation spacing fixes. * Bump version * Update NEWS with changes. * Remove integer casting... * Provide reason for patch..
1 parent bf0529e commit 7aef051

11 files changed

+136
-112
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: simcdm
22
Type: Package
33
Title: Simulate Cognitive Diagnostic Model ('CDM') Data
4-
Version: 0.1.0
4+
Version: 0.1.1
55
Authors@R: c(person("James Joseph", "Balamuta",
66
email = "balamut2@illinois.edu",
77
role = c("aut", "cre", "cph"),

NEWS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# simcdm 0.1.1
2+
3+
## Changes
4+
5+
- Addressed a signed vs. unsigned integer comparison.
6+
7+
## Documentation
8+
9+
- Fixed spacing issues brought on from an organization of _C++_ code.
10+
11+
## Deployment
12+
13+
- Changed unit tests to use R 3.5.0's RNG setup in anticipation for the RNG
14+
change in R 3.6.0.
15+
116
# simcdm 0.1.0
217

318
## Changes

R/RcppExports.R

Lines changed: 89 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
#' the probability of an incorrect response for individuals with
1717
#' all of the required attributes
1818
#'
19-
#' @return
19+
#' @return
2020
#' A dichotomous item matrix with dimensions \eqn{N \times J}{N x J}.
21-
#'
22-
#' @author
21+
#'
22+
#' @author
2323
#' Steven Andrew Culpepper and James Joseph Balamuta
24-
#'
25-
#' @seealso
24+
#'
25+
#' @seealso
2626
#' [simcdm::sim_dina_attributes()] and [simcdm::sim_dina_items()]
27-
#'
27+
#'
2828
#' @export
2929
#' @template sim-dina-class-example
3030
sim_dina_class <- function(N, J, CLASS, ETA, gs, ss) {
@@ -35,19 +35,19 @@ sim_dina_class <- function(N, J, CLASS, ETA, gs, ss) {
3535
#'
3636
#' Generates a DINA model's \eqn{\eta} matrix based on alphas and
3737
#' the \eqn{\mathbf{Q}} matrix.
38-
#'
38+
#'
3939
#' @inheritParams sim_dina_items
4040
#'
41-
#' @return
41+
#' @return
4242
#' The \eqn{\eta} `matrix` with dimensions \eqn{N \times J}{N x J} under
4343
#' the DINA model.
44-
#'
45-
#' @author
44+
#'
45+
#' @author
4646
#' Steven Andrew Culpepper and James Joseph Balamuta
47-
#'
48-
#' @seealso
47+
#'
48+
#' @seealso
4949
#' [simcdm::sim_dina_class()] and [simcdm::sim_dina_items()]
50-
#'
50+
#'
5151
#' @export
5252
#' @template sim-dina-example-body
5353
sim_dina_attributes <- function(alphas, Q) {
@@ -61,20 +61,20 @@ sim_dina_attributes <- function(alphas, Q) {
6161
#' generated under DINA model.
6262
#'
6363
#' @param alphas A \eqn{N} by \eqn{K} `matrix` of latent attributes.
64-
#' @param Q A \eqn{J} by \eqn{K} `matrix` indicating which skills are required
65-
#' for which items.
66-
#' @param ss A \eqn{J} `vector` of item slipping parameters.
64+
#' @param Q A \eqn{J} by \eqn{K} `matrix` indicating which skills are
65+
#' required for which items.
66+
#' @param ss A \eqn{J} `vector` of item slipping parameters.
6767
#' @param gs A \eqn{J} `vector` of item guessing parameters.
6868
#'
69-
#' @return
69+
#' @return
7070
#' A \eqn{N} by \eqn{J} `matrix` of responses from the DINA model.
71-
#'
72-
#' @author
71+
#'
72+
#' @author
7373
#' Steven Andrew Culpepper and James Joseph Balamuta
74-
#'
75-
#' @seealso
74+
#'
75+
#' @seealso
7676
#' [simcdm::sim_dina_class()] and [simcdm::sim_dina_attributes()]
77-
#'
77+
#'
7878
#' @export
7979
#' @template sim-dina-example-body
8080
sim_dina_items <- function(alphas, Q, ss, gs) {
@@ -113,9 +113,9 @@ sim_rrum_main <- function(Q, rstar, pistar, alpha) {
113113
#' @return Y A `matrix` with \eqn{N} rows and \eqn{J} columns indicating
114114
#' the indviduals' responses to each of the items, where \eqn{J}
115115
#' represents the number of items.
116-
#' @author
116+
#' @author
117117
#' Steven Andrew Culpepper, Aaron Hudson, and James Joseph Balamuta
118-
#'
118+
#'
119119
#' @export
120120
#' @template rrum-example
121121
#' @template rrum-references
@@ -127,18 +127,18 @@ sim_rrum_items <- function(Q, rstar, pistar, alpha) {
127127
#'
128128
#' Computes the powers of 2 from \eqn{0} up to \eqn{K - 1} for
129129
#' \eqn{K}-dimensional attribute pattern.
130-
#'
130+
#'
131131
#' @param K Number of Attributes.
132-
#'
133-
#' @return
132+
#'
133+
#' @return
134134
#' A \code{vec} with length \eqn{K} detailing the power's of 2.
135-
#'
136-
#' @author
135+
#'
136+
#' @author
137137
#' Steven Andrew Culpepper and James Joseph Balamuta
138-
#'
139-
#' @seealso
138+
#'
139+
#' @seealso
140140
#' [simcdm::attribute_inv_bijection()]
141-
#'
141+
#'
142142
#' @export
143143
#' @examples
144144
#' ## Construct an attribute bijection ----
@@ -154,17 +154,17 @@ attribute_bijection <- function(K) {
154154
#'
155155
#' @param CL An `integer` between \eqn{0} and \eqn{2^{K-1}}
156156
#' @inheritParams attribute_bijection
157-
#'
158-
#' @return
157+
#'
158+
#' @return
159159
#' A \eqn{K}-dimensional vector with an attribute pattern corresponding
160160
#' to `CL`.
161-
#'
162-
#' @author
161+
#'
162+
#' @author
163163
#' Steven Andrew Culpepper and James Joseph Balamuta
164-
#'
165-
#' @seealso
164+
#'
165+
#' @seealso
166166
#' [simcdm::attribute_bijection()]
167-
#'
167+
#'
168168
#' @export
169169
#' @examples
170170
#' ## Construct an attribute inversion bijection ----
@@ -182,22 +182,22 @@ attribute_inv_bijection <- function(K, CL) {
182182
#' @param J Number of Items
183183
#' @param K Number of Attributes
184184
#'
185-
#' @return
185+
#' @return
186186
#' A dichotomous \code{matrix} for Q.
187-
#'
188-
#' @author
187+
#'
188+
#' @author
189189
#' Steven Andrew Culpepper and James Joseph Balamuta
190-
#'
191-
#' @seealso
190+
#'
191+
#' @seealso
192192
#' [simcdm::attribute_bijection()] and [simcdm::attribute_inv_bijection()]
193-
#'
193+
#'
194194
#' @export
195195
#' @examples
196196
#' ## Simulate identifiable Q matrices ----
197-
#'
197+
#'
198198
#' # 7 items and 2 attributes
199199
#' q_matrix_j7_k2 = sim_q_matrix(7, 2)
200-
#'
200+
#'
201201
#' # 10 items and 3 attributes
202202
#' q_matrix_j10_k3 = sim_q_matrix(10, 3)
203203
sim_q_matrix <- function(J, K) {
@@ -211,29 +211,29 @@ sim_q_matrix <- function(J, K) {
211211
#' @param K Number of Attribute Levels
212212
#' @param J Number of Assessment Items
213213
#' @param Q Q Matrix with dimensions \eqn{K \times J}{K x J}.
214-
#'
215-
#' @return
214+
#'
215+
#' @return
216216
#' A `mat` with dimensions \eqn{J \times 2^K}{J x 2^K}.
217-
#'
218-
#' @author
217+
#'
218+
#' @author
219219
#' Steven Andrew Culpepper and James Joseph Balamuta
220-
#'
221-
#' @seealso
220+
#'
221+
#' @seealso
222222
#' [simcdm::sim_q_matrix()], [simcdm::attribute_bijection()], and
223223
#' [simcdm::attribute_inv_bijection()]
224-
#'
224+
#'
225225
#' @export
226226
#' @examples
227227
#' ## Simulation Settings ----
228-
#'
228+
#'
229229
#' # Fixed Number of Assessment Items for Q
230230
#' J = 18
231231
#'
232232
#' # Fixed Number of Attributes for Q
233233
#' K = 3
234234
#'
235235
#' ## Pre-specified configuration ----
236-
#'
236+
#'
237237
#' # Specify Q
238238
#' qbj = c(4, 2, 1, 4, 2, 1, 4, 2, 1, 6, 5, 3, 6, 5, 3, 7, 7, 7)
239239
#'
@@ -242,47 +242,49 @@ sim_q_matrix <- function(J, K) {
242242
#' for (j in seq_len(J)) {
243243
#' Q[j,] = attribute_inv_bijection(K, qbj[j])
244244
#' }
245-
#'
245+
#'
246246
#' # Create an eta matrix
247247
#' ETA = sim_eta_matrix(K, J, Q)
248-
#'
248+
#'
249249
#' ## Random generation of Q matrix with ETA matrix ----
250-
#'
250+
#'
251251
#' # Construct a random q matrix
252252
#' Q_sim = sim_q_matrix(J, K)
253-
#'
253+
#'
254254
#' # Generate the eta matrix
255255
#' ETA_gen = sim_eta_matrix(K, J, Q_sim)
256256
sim_eta_matrix <- function(K, J, Q) {
257257
.Call(`_simcdm_sim_eta_matrix`, K, J, Q)
258258
}
259259

260-
#' Simulate all the Latent Attribute Profile \eqn{\mathbf{\alpha}_c} in Matrix form
260+
#' Simulate all the Latent Attribute Profile \eqn{\mathbf{\alpha}_c} in
261+
#' Matrix form
261262
#'
262-
#' Generate the \eqn{\mathbf{\alpha}_c = (\alpha_{c1}, \ldots, \alpha_{cK})'}
263-
#' attribute profile matrix for members of class \eqn{c} such that \eqn{\alpha_{ck}}
264-
#' is 1 if members of class \eqn{c} possess skill \eqn{k} and zero otherwise.
263+
#' Generate the \eqn{\mathbf{\alpha}_c = (\alpha_{c1}, \ldots, \alpha_{cK})'}
264+
#' attribute profile matrix for members of class \eqn{c} such that
265+
#' \eqn{\alpha_{ck}} ' is 1 if members of class \eqn{c} possess skill \eqn{k}
266+
#' and zero otherwise.
265267
#'
266268
#' @param K Number of Attributes
267269
#'
268-
#' @return
270+
#' @return
269271
#' A \eqn{2^K} by \eqn{K} `matrix` of latent classes
270-
#' corresponding to entry \eqn{c} of \eqn{pi} based upon
272+
#' corresponding to entry \eqn{c} of \eqn{pi} based upon
271273
#' mastery and nonmastery of the \eqn{K} skills.
272-
#'
273-
#' @author
274+
#'
275+
#' @author
274276
#' James Joseph Balamuta and Steven Andrew Culpepper
275-
#'
277+
#'
276278
#' @seealso
277279
#' [simcdm::sim_subject_attributes()] and [simcdm::attribute_inv_bijection()]
278-
#'
280+
#'
279281
#' @export
280282
#' @examples
281283
#' ## Simulate Attribute Class Matrix ----
282-
#'
284+
#'
283285
#' # Define number of attributes
284286
#' K = 3
285-
#'
287+
#'
286288
#' # Generate an Latent Attribute Profile (Alpha) Matrix
287289
#' alphas = attribute_classes(K)
288290
attribute_classes <- function(K) {
@@ -292,35 +294,36 @@ attribute_classes <- function(K) {
292294
#' Simulate Subject Latent Attribute Profiles \eqn{\mathbf{\alpha}_c}
293295
#'
294296
#' Generate a sample from the
295-
#' \eqn{\mathbf{\alpha}_c = (\alpha_{c1}, \ldots, \alpha_{cK})'}
296-
#' attribute profile matrix for members of class \eqn{c} such that \eqn{\alpha_{ck}}
297-
#' is 1 if members of class \eqn{c} possess skill \eqn{k} and zero otherwise.
297+
#' \eqn{\mathbf{\alpha}_c = (\alpha_{c1}, \ldots, \alpha_{cK})'}
298+
#' attribute profile matrix for members of class \eqn{c} such that
299+
#' \eqn{\alpha_{ck}} ' is 1 if members of class \eqn{c} possess skill \eqn{k}
300+
#' and zero otherwise.
298301
#'
299302
#' @param N Number of Observations
300303
#' @param K Number of Skills
301-
#' @param probs A `vector` of probabilities that sum to 1.
302-
#'
303-
#' @return
304+
#' @param probs A `vector` of probabilities that sum to 1.
305+
#'
306+
#' @return
304307
#' A \eqn{N} by \eqn{K} `matrix` of latent classes
305-
#' corresponding to entry \eqn{c} of \eqn{pi} based upon
308+
#' corresponding to entry \eqn{c} of \eqn{pi} based upon
306309
#' mastery and nonmastery of the \eqn{K} skills.
307-
#'
308-
#' @author
310+
#'
311+
#' @author
309312
#' James Joseph Balamuta and Steven Andrew Culpepper
310-
#'
311-
#' @seealso
313+
#'
314+
#' @seealso
312315
#' [simcdm::attribute_classes()] and [simcdm::attribute_inv_bijection()]
313-
#'
316+
#'
314317
#' @export
315318
#' @examples
316319
#' # Define number of subjects and attributes
317320
#' N = 100
318321
#' K = 3
319-
#'
322+
#'
320323
#' # Generate a sample from the Latent Attribute Profile (Alpha) Matrix
321324
#' # By default, we sample from a uniform distribution weighting of classes.
322325
#' alphas_builtin = sim_subject_attributes(N, K)
323-
#'
326+
#'
324327
#' # Generate a sample using custom probabilities from the
325328
#' # Latent Attribute Profile (Alpha) Matrix
326329
#' probs = rep(1 / (2 ^ K), 2 ^ K)

cran-comments.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@
88

99
0 errors | 0 warnings | 1 note
1010

11-
Days since last update: 1
12-
1311
Possibly mis-spelled words in DESCRIPTION:
1412
Culpepper (22:5, 23:5)
1513
Torre (24:11)
1614
de (24:5)
1715

18-
- We are issuing a patch for the package 1 day after it was listed because
19-
of a compilation failure on Solaris, which is caused by an ambiguous overload
20-
of the `pow()` function.
16+
- We are issuing a patch for the package to address an issue with the
17+
unit tests governing the random number generation.
2118
- Regarding mis-spellings:
2219
- `Culpepper`, `de`, and `Torre` are either parts of names or lastnames.
2320

man/attribute_classes.Rd

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)