The tutorials can be found here:
In order to reproduce the vignette follow the instructions described in the next sections
Our package needs to be installed from source code. In such cases, a collection of software (e.g. C, C++, Fortran, ...) are required, mainly for Windows users. These programs can be installed using Rtools.
Then, some required packages must be installed:
# Install BiocManager (if not previously installed)
install.packages("BiocManager")
# Install required packages
BiocManager::install(c("Matrix", "RcppEigen", "RSpectra",
"beachmat", "DelayedArray",
"HDF5Array", "rhdf5"))
After that, BigDataStatMeth
is installed from our GitHub repository:
# Install devtools and load library (if not previously installed)
install.packages("devtools")
library(devtools)
# Install BigDataStatMeth
install_github("isglobal-brge/BigDataStatMeth")
Download and execute this file.
Let us imaging we are interested fitting a linear model:
The ordinary least square (OLS) estimate of is
were is the QR decomposition of
To illustrate, let us consider the "mtcars" example, and run this regression:
data(mtcars)
lm(mpg ~ wt + cyl, data=mtcars)
Remeber that
Y <- matrix(mtcars$mpg)
X <- model.matrix(~ wt + cyl, data=mtcars)
Tasks:
- Use functions in R to estimate model parameters using OLS.
- Use functions in
BigDataStatMeth
to estimate model parameters using OLS with in memory data. - Use functions in
BigDataStatMeth
to estimate model parameters using OLS with a HDF5 file.
NOTE: use bdpseudoinv()
function instead of bdInvCholesky()
since the matrix is not positive definite