plot_spect: MM Algorithm - Plotting the Spectroscopic Signal

Description Usage Arguments Author(s) Examples

View source: R/nonnegativeleastsquares.R

Description

plot_spect Function for plotting the spectroscopic signal

Usage

1
plot_spect(n, y, X, b, nnm)

Arguments

n

Number of samples

y

Nonnegative response

X

Nonnegative design matrix

b

Nonnegative initial regression vector

nnm

NNM object from generate_nnm function

Author(s)

Jocelyn T. Chi

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Setup mixture example
n <- 1e3
p <- 10
nnm <- generate_nnm(n,p)

set.seed(12345)
X <- nnm$X
b <- double(p)
nComponents <- 3
k <- sample(1:p,nComponents,replace=FALSE)
b[k] <- matrix(runif(nComponents),ncol=1)
y <- X%*%b + 0.25*matrix(abs(rnorm(n)),n,1)

plot_spect(n,y,X,b,nnm)

gettingtothebottom documentation built on May 29, 2017, 8:28 p.m.