Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

matrnorm

Generates random values from a normal and puts them in a matrix


Description

Generates random values from a normal and puts them in a matrix.

Usage

matrnorm(n, p)

Arguments

n

The sample size, the number of rows the matrix will have.

p

The dimensionality of the data, the nubmer of columns of the matrix.

Details

How many times did you have to simulated data from a (standard) normal distribution in order to test something? For example, in order to see the speed of logistic_only, one needs to generate a matrix with predictor variables. The same is true for other similar functions. In sftests, one would like to examine the typer I error of this test under the null hypothesis.

By using the Ziggurat method of generating standard normal variates, this function is really fast when you want to generate big matrices.

Value

An n x p matrix with data simulated from a standard normal distribution.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@yahoo.gr>

See Also

Examples

x <- matrnorm(100, 100)

Rfast

A Collection of Efficient and Extremely Fast R Functions

v2.0.1
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou.
Initial release
2020-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.