Learn R Programming

grpSLOPE (version 0.3.3)

sigma: Extract (estimated) noise level

Description

Extract the noise level of the grpSLOPE model.

Usage

# S3 method for grpSLOPE
sigma(object, ...)

Value

The noise level of the given grpSLOPE model. A number.

Arguments

object

A grpSLOPE object

...

Potentially further arguments passed to and from methods

Details

This basically obtains object$sigma. For R (>= 3.3.0) sigma is an S3 method with the default method coming from the stats package.

Examples

Run this code
set.seed(1)
A   <- matrix(rnorm(100^2), 100, 100)
grp <- rep(rep(1:20), each = 5)
b   <- c(rep(1, 20), rep(0, 80))
y   <- A %*% b + rnorm(10) 
# model with unknown noise level
result <- grpSLOPE(X = A, y = y, group = grp, fdr = 0.1)
sigma(result)
# [1] 0.6505558
# model with known noise level
result <- grpSLOPE(X = A, y = y, group = grp, fdr = 0.1, sigma = 1)
sigma(result)
# [1] 1

Run the code above in your browser using DataLab