Skip to content

Commit 466f887

Browse files
authoredDec 30, 2021
Add files via upload
# matrixNormal 0.1.0 2021-Dec-29 - `pmatnorm`: Included argument `keepAttr` to pass to `mvtnorm::pmvtnorm()` v.1.1-2: logical allowing users to attach error and message to the return value. See . - `rmatnorm`: - Added argument `checkSymmetry = FALSE` to `mvtnorm::rmvnorm()` as the matrices are already checked for symmetry. See . - U and V are incorrectly switched, (thanks, @prockenschaub, <#1>) - Added warning to earlier versions of R - Changed reference cited. - Made argument method clearer - Documentation clarification, thanks \#1 # matrixNormal 0.0.5 2021-Apr-1 ## Bug Fixes - Minor Change: Changed lazy data to FALSE in description file to remove notes on CRAN check in R 4.0.5. # matrixNormal 0.0.4 2020-08-26 - New `vech()` function: performs half-vectorization on a symmetric matrix. This is the vector-form of the lower triangular matrix only. Unlike other functions on CRAN, vech() inherits any names from the matrix. ## Bug Fixes - `dmatrixnorm`: Clarified by replacing the name of argument `use.log` with `log` for consistency in argument name with mvtnorm and stats package. - `is.symmetric()`, `is.positive.definite()`, `is.positive.semi.definite()`: - if A is not symmetric, these functions NOW return FALSE instead of stopping the function. Restructured helper `find.eval()`. - if A contains a missing value (`NA`), these functions NOW return NA. - `rmatrixnorm`: Added the first argument `s` to draw many random samples. Only 1 sample is still drawn; the argument currently has no effect but acts as a placeholder in future releases. - Clarified documentation. - Added session information and version details to the vignette. The updated versions of the packages listed do not affect the results of matrixNormal functions.
1 parent 64132e0 commit 466f887

24 files changed

+1872
-461
lines changed
 

Diff for: ‎DESCRIPTION

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
Package: matrixNormal
2-
Version: 0.0.1
3-
Date: 2019-05-22
2+
Version: 0.0.5
43
Type: Package
54
Title: The Matrix Normal Distribution
6-
Authors@R: person("Paul", "Hargarten", email = "hargartenp@vcu.edu", role = c("aut", "cre"))
7-
Depends: R (>= 3.5.0)
8-
Imports:
9-
mvtnorm (>= 1.0.8),
10-
utils (>= 3.5.0)
11-
Suggests:
12-
matrixcalc (>= 1.0.3),
13-
roxygen2,
14-
stats (>= 3.5.0),
15-
spelling,
16-
testthat (>= 2.0.1),
17-
knitr,
18-
rmarkdown
5+
Authors@R: person("Paul M.", "Hargarten", email = "hargartenp@vcu.edu", role = c("aut", "cre"))
6+
Depends: R (>= 3.5.0), stats, utils
7+
Imports: mvtnorm (>= 1.0.8)
8+
Suggests:
9+
formatR,
10+
knitr,
11+
LaplacesDemon (>= 16.1.1),
12+
matrixcalc (>= 1.0-3),
13+
matrixsampling (>= 1.1.0),
14+
MBSP (>= 1.0),
15+
rmarkdown,
16+
roxygen2,
17+
sessioninfo,
18+
spelling,
19+
testthat
1920
Description: Computes densities, probabilities, and random deviates of the Matrix Normal (Iranmanesh et al. (2010) <doi:10.7508/ijmsi.2010.02.004>). Also includes simple but useful matrix functions. See the vignette for more information.
2021
License: GPL-3
2122
Encoding: UTF-8
22-
LazyData: true
23+
LazyData: false
2324
BugReports: https://github.com/phargarten2/matrixNormal/issues
24-
RoxygenNote: 6.1.1
25+
RoxygenNote: 7.1.1
2526
Language: en-US
2627
VignetteBuilder: knitr

Diff for: ‎LICENSE.md

+595
Large diffs are not rendered by default.

Diff for: ‎NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export(pmatnorm)
1111
export(rmatnorm)
1212
export(tr)
1313
export(vec)
14+
export(vech)
1415
import(mvtnorm)
1516
importFrom(mvtnorm,pmvnorm)
1617
importFrom(utils,head)

Diff for: ‎NEWS.Rmd

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
output: github_document
3+
---
4+
# matrixNormal 0.1.0 2021-Dec-29
5+
6+
* `pmatnorm`: Included argument `keepAttr` to pass to `mvtnorm::pmvnorm()` v.1.1-2: logical allowing users to attach error and message to the return value.
7+
8+
* `rmatnorm`:
9+
+ Added argument `checkSymmetry = FALSE` to `mvtnorm::rmvnorm()` as the matrices are already checked for symmetry.
10+
+ U and V are incorrectly switched, (thanks, @prockenschaub, https://github.com/phargarten2/matrixNormal/issues/1)
11+
- Added warning to earlier versions of R
12+
- Changed reference cited.
13+
- Made argument method clearer
14+
15+
* Documentation clarification, thanks @1
16+
17+
* Vignette clarification, thanks @#1.
18+
19+
# matrixNormal 0.0.5 2021-Apr-1
20+
21+
## Bug Fixes
22+
* Minor Change: Changed lazy data to FALSE in description file to remove notes on CRAN check in R 4.0.5.
23+
24+
# matrixNormal 0.0.4 2020-08-26
25+
* New `vech()` function: performs half-vectorization on a symmetric matrix. This is the vector-form of the lower triangular matrix only. Unlike other functions on CRAN, vech() inherits any names from the matrix.
26+
27+
## Bug Fixes
28+
* `dmatrixnorm`: Clarified by replacing the name of argument `use.log` with `log` for consistency in argument name with mvtnorm and stats package.
29+
* `is.symmetric()`, `is.positive.definite()`, `is.positive.semi.definite()`:
30+
+ if A is not symmetric, these functions NOW return FALSE instead of stopping the function. Restructured helper `find.eval()`.
31+
+ if A contains a missing value (`NA`), these functions NOW return NA.
32+
* `rmatrixnorm`: Added the first argument `s` to draw many random samples. Only 1 sample is still drawn; the argument currently has no effect but acts as a placeholder in future releases.
33+
* Clarified documentation.
34+
* Added session information and version details to the vignette. The updated versions of the packages listed do not affect the results of matrixNormal functions.
35+
36+
37+
# matrixNormal 0.0.2 2019-12-5
38+
* The documentation is clarified.
39+
* Submitted to CRAN but failed to be released.
40+
41+
# matrixNormal 0.0.1 2019-07-09
42+
* Vignette is added, replacing the package R file. Included the use and uniqueness of matrixNormal distribution. Also included an example that uses the package. Added additional packages to be imported in Documentation.
43+
* Documentation clarified.
44+
* Minor Changes in Examples:
45+
** Changed order of examples in rmatnorm() for reproducibility
46+
** Made clearer in using the dataset package in pmatnorm() example
47+
** Removed installation of matrixcalc package in is.symmetric.matrix examples.
48+
* `is.positive.definite()`, `is.positive.semi.definite()` returns NA if the matrix contains missing value (bug fix).
49+
* `pmatnorm()`, `dmatnorm()`, `rmatnorm()` now throws error if the parameters of the matrix Normal Distribution `M`, `U`, or `V` contain any missing values.
50+
* `rmatnorm()` now returns a matrix with rownames from U and the colnames from V.
51+
* In `rmatnorm()`, `pre0.9_9994` that was passed from `rmvnorm()` function in **mvtnorm library** is removed, because it is not needed. This argument was introduced in mvtnorm library to fix a bug in version 0.9-9993, but matrixNormal uses a version of at least 1.0.8. This argument is just not needed, and if pre0.9_9994 is set to TRUE, nothing will happen.
52+
53+
# matrixNormal 0.0.0.9000
54+
* This is a new submission.
55+
* Added a `NEWS.md` file to track changes to the package.
56+
* First Release of the Package
57+
* Successfully passed windows check.
58+

Diff for: ‎NEWS.md

+84-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,88 @@
1-
# matrixNormal 0.0.1
2-
* Documentation updates: ADDED vignette, removed package R file. Included the use and uniqueness of matrixNormal distribution. Also included an example that uses the package. Added datasets package to be imported in Documentation.
3-
* is_symmetric()
4-
* rmatnorm(): Removed argument pre0.9_9994 that was passed from rmvnorm() function in mvtnorm library. This argument was introduced in mvtnorm library to fix a bug in version 0.9-9993, but matrixNormal uses the version at least 1.0.8. This argument simply is not needed. The origin of this argument was to fix bug in the mvtnorm library, but matrixNormal uses a version of mvtnorm library greater than update. This argument is just not needed, and if pre0.9_9994 is set to TRUE, nothing will happen.
5-
* pmatnorm(), dmatnorm(), rmatnorm(): Added error if parameters of the matrix Normal Distribution -- M, U, or V -- contain any missing values. This makes the issue clearer to the user, but the function couldn't run anyway)
6-
* rmatnorm() now returns a matrix with rownames from U and the colnames from V.
71

8-
* Minor Changes in Examples
9-
** Changed order of examples in rmatnorm() for reproducibility
10-
** Made clearer in using the dataset package in pmatnorm() example
11-
** Removed installation of matrixcalc package in is.symmetric.matrix examples.
2+
# matrixNormal 0.1.0 2021-Dec-29
123

4+
- `pmatnorm`: Included argument `keepAttr` to pass to
5+
`mvtnorm::pmvtnorm()` v.1.1-2: logical allowing users to attach
6+
error and message to the return value. See .
7+
8+
- `rmatnorm`:
9+
10+
- Added argument `checkSymmetry = FALSE` to `mvtnorm::rmvnorm()`
11+
as the matrices are already checked for symmetry. See .
12+
- U and V are incorrectly switched, (thanks, @prockenschaub,
13+
<https://github.com/phargarten2/matrixNormal/issues/1>)
14+
- Added warning to earlier versions of R
15+
- Changed reference cited.
16+
- Made argument method clearer
17+
18+
- Documentation clarification, thanks \#1
19+
20+
# matrixNormal 0.0.5 2021-Apr-1
21+
22+
## Bug Fixes
23+
24+
- Minor Change: Changed lazy data to FALSE in description file to
25+
remove notes on CRAN check in R 4.0.5.
26+
27+
# matrixNormal 0.0.4 2020-08-26
28+
29+
- New `vech()` function: performs half-vectorization on a symmetric
30+
matrix. This is the vector-form of the lower triangular matrix only.
31+
Unlike other functions on CRAN, vech() inherits any names from the
32+
matrix.
33+
34+
## Bug Fixes
35+
36+
- `dmatrixnorm`: Clarified by replacing the name of argument `use.log`
37+
with `log` for consistency in argument name with mvtnorm and stats
38+
package.
39+
- `is.symmetric()`, `is.positive.definite()`,
40+
`is.positive.semi.definite()`:
41+
- if A is not symmetric, these functions NOW return FALSE instead
42+
of stopping the function. Restructured helper `find.eval()`.
43+
- if A contains a missing value (`NA`), these functions NOW return
44+
NA.
45+
- `rmatrixnorm`: Added the first argument `s` to draw many random
46+
samples. Only 1 sample is still drawn; the argument currently has no
47+
effect but acts as a placeholder in future releases.
48+
- Clarified documentation.
49+
- Added session information and version details to the vignette. The
50+
updated versions of the packages listed do not affect the results of
51+
matrixNormal functions.
52+
53+
# matrixNormal 0.0.2 2019-12-5
54+
55+
- The documentation is clarified.
56+
- Submitted to CRAN but failed to be released.
57+
58+
# matrixNormal 0.0.1 2019-07-09
59+
60+
- Vignette is added, replacing the package R file. Included the use
61+
and uniqueness of matrixNormal distribution. Also included an
62+
example that uses the package. Added additional packages to be
63+
imported in Documentation.
64+
- Documentation clarified.
65+
- Minor Changes in Examples: \*\* Changed order of examples in
66+
rmatnorm() for reproducibility \*\* Made clearer in using the
67+
dataset package in pmatnorm() example \*\* Removed installation of
68+
matrixcalc package in is.symmetric.matrix examples.
69+
- `is.positive.definite()`, `is.positive.semi.definite()` returns NA
70+
if the matrix contains missing value (bug fix).
71+
- `pmatnorm()`, `dmatnorm()`, `rmatnorm()` now throws error if the
72+
parameters of the matrix Normal Distribution `M`, `U`, or `V`
73+
contain any missing values.
74+
- `rmatnorm()` now returns a matrix with rownames from U and the
75+
colnames from V.
76+
- In `rmatnorm()`, `pre0.9_9994` that was passed from `rmvnorm()`
77+
function in **mvtnorm library** is removed, because it is not
78+
needed. This argument was introduced in mvtnorm library to fix a bug
79+
in version 0.9-9993, but matrixNormal uses a version of at least
80+
1.0.8. This argument is just not needed, and if pre0.9\_9994 is set
81+
to TRUE, nothing will happen.
1382

1483
# matrixNormal 0.0.0.9000
15-
* This is a new submission.
16-
* Added a `NEWS.md` file to track changes to the package.
17-
* First Release of the Package
18-
* Successfully passed windows check.
19-
84+
85+
- This is a new submission.
86+
- Added a `NEWS.md` file to track changes to the package.
87+
- First Release of the Package
88+
- Successfully passed windows check.

Diff for: ‎R/Special_matrices.R

+24-30
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
1-
#'Generating Special Matrices
1+
#' Generating Special Matrices
22
#'
3-
#'@family matrix
4-
#'@keywords matrix identity ones
3+
#' @family matrix
4+
#' @keywords matrix identity ones
55
#'
6-
#'@name special.matrix
6+
#' @name special.matrix
77
#'
8-
#'@description Creates Identity Matrix I and Matrix of Ones J.
8+
#' @description Creates an Identity Matrix \emph{I} and a Matrix of Ones \emph{J}. \itemize{
9+
#' \item \code{I}(): Creates an identity matrix where the number of columns is n. This is a diagonal matrix with all equal to one (1). An identity matrix is usually written as \emph{I}. Names of rows and columns (\code{dimnames}) are included.
10+
#' \item \code{J}(): Creates a matrix of ones with any number of rows and columns. Names of rows and columns (\code{dimnames}) are included.
11+
#' }
912
#'
10-
#'@details
11-
#'Create an Identity Matrix where the number of columns is n. This is a diagonal matrix with all equal to one (1). An identity matrix is usually written as I. To make an identity matrix with r rows and columns, use \code{I}.
13+
#' @param n Number of rows in \emph{I} or \emph{J}.
14+
#' @param m Number of columns in \emph{J}. Default: Same as number of rows.
1215
#'
13-
#'A J matrix is a general matrix of any number of rows and columns, but in which all elements in the matrix are equal to one (1). \code{J} will make a n x m J matrix, given the number or rows, n, and number of columns, m. Names of rows and columns (dimnames) are included.
14-
#'
15-
#'@param n number of rows in I or J.
16-
#'@param m number of columns in J. Default: same as number of rows.
17-
#'
18-
#'@examples
19-
#' #To create an identity matrix of order 12
16+
#' @examples
17+
#' # To create an identity matrix of order 12
2018
#' I(2)
21-
#' #To make a matrix of 6 rows and 10 columns of all ones
22-
#' J(6,10)
23-
#' #To make a matrix of unity, dimensions 6 x 6 .
19+
#' # To make a matrix of 6 rows and 10 columns of all ones
20+
#' J(6, 10)
21+
#' # To make a matrix of unity, dimensions 6 x 6.
2422
#' J(6)
25-
26-
#'@rdname special.matrix
27-
#'@export I
28-
I <- function(n){
29-
#Identity Matrix where number of columns is n.
23+
#' @rdname special.matrix
24+
#' @export I
25+
I <- function(n) {
26+
# Identity Matrix where number of columns is n.
3027
D <- diag(1, n)
3128
dimnames(D) <- list(1:n, 1:n)
3229
return(D)
3330
}
3431

35-
#'@rdname special.matrix
36-
#'@export J
37-
J<- function(n, m=n){
38-
#A matrix of ones with n rows and m columns.
39-
matrix(c(1),nrow=n,ncol=m, dimnames = list(1:n, 1:m))
32+
#' @rdname special.matrix
33+
#' @export J
34+
J <- function(n, m = n) {
35+
# A matrix of ones with n rows and m columns.
36+
matrix(c(1), nrow = n, ncol = m, dimnames = list(1:n, 1:m))
4037
}
41-
42-
43-

0 commit comments

Comments
 (0)
Please sign in to comment.