Description Usage Arguments Value Examples
orthopen
1 2 3 |
X |
MxP observations matrix (features are in columns) |
Y |
MxT observed output matrix for T different tasks |
lambda |
a regularization parameter (default |
step_size |
step for gradient descent (default |
verbose |
option (default |
stop_no_improve |
number of gradient descent steps without improvment before stopping (default: |
max_iter |
maximum number of iterations before stopping optimization (default: |
K |
PxP orthogonality constraints matrix (default: diagonal matrix –> no orthogonality constraint) |
disjoint |
if |
logistic |
if |
enet |
if |
a list containing three elements
W
: optimal PxT matrix for objective function minimum
obj: objective function value at W
imax: number of steps before reaching optimum
1 2 3 4 5 6 7 8 9 10 11 12 13 | #solve orthogonal columns problem
# min_W 1/2 norm( X%*%W - Y )^2 + lambda ||W||_orthopen
NVAR=10
NTRAIN=100
T=3
K = matrix(1,nrow=T,ncol=T)
# Generate random data and random model
X <- matrix(rnorm(NTRAIN*NVAR),nrow=NTRAIN,ncol=NVAR)
# Random orthogonal matrix
W <- qr.Q(qr(matrix(rnorm(NVAR*T),nrow=NVAR,ncol=T)))
Y <- X %*% W + matrix(rnorm(NTRAIN*T),nrow=NTRAIN)
set.seed(42)
res <- orthopen(X,Y,lambda = 0.1,K = K,disjoint = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.