PCP functions in R including adaptations for environmental data.
To use this package, clone the repo or download the .zip file. Locate the folder, unzip if applicable, and use the following code. Replace path_to_folder
with your local path.
install.packages("path_to_folder", repos = NULL, type="source")
library(pcpr)
-
- This includes a non-negativity constraint on the
L
solution matrix. It does not include a LOD (limit of detection) penalty. - It takes 4 inputs:
D
the original datasetlambda
parametermu
parameterverbose
parameter (optional)
- For more info:
?stable_pcp
- This includes a non-negativity constraint on the
-
- This includes a non-negativity constraint on the
L
solution matrix and a separate penalty function for values <LOD. - Values <LOD should be pre-processed as
-1
. - It takes 5 inputs:
D
the original datasetlambda
parametermu
parameterLOD
may be a scalar, vector, or matrixverbose
parameter (optional)
- For more info:
?pcp_lod
- This includes a non-negativity constraint on the
-
- This changes the objective function by removing the squaring of the error term so that the
mu
parameter does not rely on the unknownsigma
value. It does not include a non-negativity constraint on theL
matrix or a LOD penalty. - It takes 4 inputs:
D
the original datasetlambda
parametermu
parameterverbose
parameter (optional)
- For more info:
?root_pcp
- This changes the objective function by removing the squaring of the error term so that the
-
- This includes a non-negativity constraint on the
L
matrix with the squareroot version of the objective function. It does not include a LOD penalty. - It takes 4 inputs:
D
the original datasetlambda
parametermu
parameterverbose
parameter (optional)
- For more info:
?root_pcp_nonnegL
- This includes a non-negativity constraint on the
-
- This allows for missing values with the squareroot version of the objective function. It does not include a LOD penalty or a non-negativity constraint on the
L
matrix. - Missing values should be pre-processed as
NA
. - It takes 4 inputs:
D
the original datasetlambda
parametermu
parameterverbose
parameter (optional)
- For more info:
?root_pcp_na
- This allows for missing values with the squareroot version of the objective function. It does not include a LOD penalty or a non-negativity constraint on the
-
- This includes a non-negativity constraint on the
L
matrix and allows for missing values with the squareroot version of the objective function. It does not include a LOD penalty. - Missing values should be pre-processed as
NA
. - It takes 4 inputs:
D
the original datasetlambda
parametermu
parameterverbose
parameter (optional)
- For more info:
?root_pcp_na_nonnegL
- This includes a non-negativity constraint on the
-
- This includes a non-negativity constraint on the
L
matrix, allows for missing values, and includes a separate penalty function for values <LOD with the squareroot version of the objective function. - Missing values should be pre-processed as
NA
. - Values <LOD should be pre-processed as
-1
. - It takes 5 inputs:
D
the original datasetlambda
parametermu
parameterLOD
may be a scalar, vector, or matrixverbose
parameter (optional)
- For more info:
?root_pcp_na_nonnegL_lod
- This includes a non-negativity constraint on the
-
- This replaces the nuclear norm in the objective function with a projection to a lower rank. It does not include a LOD penalty or a non-negativity constraint on the
L
matrix. - It takes 5 inputs:
D
the original datasetlambda
parametermu
parameterr
the desired rankverbose
parameter (optional)
- For more info:
?root_pcp_noncvx
- This replaces the nuclear norm in the objective function with a projection to a lower rank. It does not include a LOD penalty or a non-negativity constraint on the
-
- This replaces the nuclear norm in the objective function with a projection to a lower rank. It includes a non-negativity constraint on the
L
matrix. It does not include a LOD penalty. - It takes 5 inputs:
D
the original datasetlambda
parametermu
parameterr
the desired rankverbose
parameter (optional)
- For more info:
?root_pcp_noncvx_nonneg
- This replaces the nuclear norm in the objective function with a projection to a lower rank. It includes a non-negativity constraint on the
-
- This replaces the nuclear norm in the objective function with a projection to a lower rank. It does not include a LOD penalty or a non-negativity constraint on the
L
matrix. It does allow missing values. - Missing values should be pre-processed as
NA
. - It takes 5 inputs:
D
the original datasetlambda
parametermu
parameterr
the desired rankverbose
parameter (optional)
- For more info:
?root_pcp_noncvx_w_na
- This replaces the nuclear norm in the objective function with a projection to a lower rank. It does not include a LOD penalty or a non-negativity constraint on the
-
- This replaces the nuclear norm in the objective function with a projection to a lower rank. It includes a non-negativity constraint on the
L
matrix. It does not include a LOD penalty. It does allow missing values. - Missing values should be pre-processed as
NA
. - It takes 5 inputs:
D
the original datasetlambda
parametermu
parameterr
the desired rankverbose
parameter (optional)
- For more info:
?root_pcp_noncvx_nonneg_w_na
- This replaces the nuclear norm in the objective function with a projection to a lower rank. It includes a non-negativity constraint on the
-
- This replaces the nuclear norm in the objective function with a projection to a lower rank. It includes a non-negativity constraint on the
L
matrix and a LOD penalty. It does allow missing values. - Missing values should be pre-processed as
NA
. - It takes 5 inputs:
D
the original datasetlambda
parametermu
parameterr
the desired rankLOD
may be a scalar, vector, or matrixverbose
parameter (optional)
- For more info:
?root_pcp_na_nonneg_noncvx_LOD
- This replaces the nuclear norm in the objective function with a projection to a lower rank. It includes a non-negativity constraint on the