README.md

nnls2d : two examples

To install the package from github

devtools::install_github("Jawad-Boulahfa/nnls2d")

Example 1: one explanatory variable

Choose the parameters

n <- 3
beta <- 2
sigma <- 4

Generate the dataset

dataset <- dataGenerator(n = n, beta = beta, sigma = sigma)

Solve the positively constrained least squares problem

results <- pcls1(X = dataset$X, Y = dataset$Y)

Example 2: two explanatory variables

Choose the parameters

n <- 3
beta <- 1:2
sigma <- 4

Generate the dataset

dataset <- dataGenerator(n = n, beta = beta, sigma = sigma)

Solve the positively constrained least squares problem

results <- pcls2(X = dataset$X, Y = dataset$Y)


Jawad-Boulahfa/nnls2d documentation built on Sept. 3, 2020, 10:37 p.m.