projcore: Calculate the residual of a matrix projected on a factor...

Description Usage Arguments Value Examples

Description

projcore calculates the residual of a matrix projected on a factor matrix using a method specified.

Usage

1
projcore(x, b, method = c("ridge", "lasso", "sam"))

Arguments

x

matrix

b

factor matrix

method

projection method. Default = 'linear'.

Value

a residual matrix

resi

a residual matrix

Examples

1
2
3
4
5
6
7
8
9
K = 3
n = 100
b = matrix(rnorm(K*n),n,K)
bx = 1:3
by = c(1,2,2)
x = b%*%bx+rnorm(n)
y = b%*%by+rnorm(n)
fit1 = projcore(x, b, method = "lasso")
fit2 = projcore(y, b, method = "sam")

statcodes/pgraph documentation built on May 30, 2019, 9:42 a.m.