plot_solutionpaths: MM Algorithm - Plot results of solutionpaths function

Description Usage Arguments Author(s) Examples

View source: R/mmalgorithm.R

Description

plot_solutionpaths Function for plotting results of the solutionpaths function

Usage

1

Arguments

results

Results from the solutionpaths function

Author(s)

Jocelyn T. Chi

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Generate a test matrix
seed <- 12345
m <- 100
n <- 100
r <- 3
T <- testmatrix(m,n,r,seed=seed)

# Add some noise to the test matrix
E <- 0.1*matrix(rnorm(m*n),m,n)
A <- T + E

# Obtain a vector of unobserved entries
temp <- makeOmega(m,n,percent=0.5)
omega <- temp$omega

# Remove unobserved entries from test matrix
X <- A
X[omega] <- NA

# Make initial model matrix Z and find initial lambda
Z <- matrix(0,m,n)
lambda.start <- init.lambda(X,omega)
lambdaseq_length=20
tol <- 1e-2

ans <- solutionpaths(A,X,Z,omega,lambda.start,tol=tol,
   liveupdates=FALSE,lambdaseq_length=lambdaseq_length)

# Plot using results from solutionpaths function
plot_solutionpaths(ans)

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