Learn R Programming

Difdtl (version 2.0)

genp: Generate one precision matrix.

Description

Generate one precision matrix with certain sparse degree.

Usage

genp(p, sparsity, sigma)

Arguments

p
The dim of the matrix.
sparsity
The sparse degree.
sigma
The parameter used to describe the magnitude of the non-zero element.

Value

A symetric positive definite pXp matrix.

Examples

Run this code
set.seed(1)
sparsematrix<-genp(50,0.05,0.5)

Run the code above in your browser using DataLab