var.weight: Maximum variance weights

View source: R/var.weight.R

var.weightR Documentation

Maximum variance weights

Description

var.weight produces a set of weights that maximizes the total weighted variance of the distribution of different biomarkers within each subject.

Usage

var.weight(X, method = c("optim", "mosek"))

Arguments

X

n by p maxtrix containing observations of p biomarkers of n subjects.

method

optim (default) using R constrOptim function from stats package for optimization, mosek using mosek function from Rmosek package for optimization

Examples

library(MASS)
# a three biomarkers dataset generated from independent normal(0,1)
X = mvrnorm(n = 100, mu=rep(0,3), Sigma=diag(3), tol = 1e-6, empirical = FALSE, EISPACK = FALSE)
# compute maximum variance weights using constrOptim for optimization
var.weight(X)

## Not run: 
# need mosek installed
# compute maximum variance weights using mosek for optimization
library(Rmosek)
var.weight(X,'mosek')

## End(Not run)

mdw documentation built on Sept. 11, 2024, 7:07 p.m.

Related to var.weight in mdw...