Learn R Programming

WLogit (version 2.1)

CalculWeight: Calculate the weight

Description

Calculate the weight in the penalized weighted- least-squares problem

Usage

CalculWeight(Px)

Arguments

Px

The vector of estimated probability for each response to be 1.

Author

Wencan Zhu, Celine Levy-Leduc, Nils Ternes

See Also

Please read https://hastie.su.domains/Papers/glmnet.pdf for more details

Examples

Run this code
data(X)
data(beta)
px <- CalculPx(X=X, beta=beta)
CalculWeight(px)
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (Px) 
{
    return(Px * (1 - Px))
  }

Run the code above in your browser using DataLab