PlspmSpatial
Set of functions to help in Partial Least Square Path Modeling (PLS-PM) analysis in spatial ecology applications
Install / Use
/learn @JavierLopatin/PlspmSpatialREADME
plspmSpatial
Set of functions to help in PLS-PM analysis in spatial ecological applications
The currently included functions are:
- plspmPredict
- plspm.groupsPredict
- plspmResiduals
@author: Javier Lopatin
plspmPredict:
This function predicts PLS-PM latent and measurement variables from a 'plspm' object ('plspm' R-package)
This is based on the publication: Shmueli, G., Ray, S., Estrada, J. M., & Chatla, S. (n.d.). The Elephant in the Room: Evaluating the Predictive Performance of Partial Least Squares (PLS) Path Models (2015). SSRN Electronic Journal SSRN Journal.
The script was adapted from the script: https://github.com/ISS-Analytics/pls-predict/blob/master/lib/PLSpredict.R
The adaptation was done in order to work directly with an plspm object.
WARNING: For the moment, only working with <code>class(data) == data.frame</code> object for prediction. Raster classes to be added
Usage:
plspmPred(pls, dat, ...)
Arguments:
- pls: An plspm object from the plspm package
- dat: data.frame or Raster Stack with the model predictors
Details:
The function plspmPredict estimates extrapolation values of Latent and Measurement Variables from and plspm object
Values:
An object of class <code>plspmPredict</code> is returned. The object returns a list with:
-
mmData
Matrix or RasterStack of the input measurement variables -
mmPredicted
Matrix or RasterStack of the predicted all measurement variables -
mmResiduals
Matrix of the residuals of all measurement variables. Only if validation data of the target endogenous variables are provided for validation -
Scores
Matrix of the predicted Latent Variables scores [in ordination units]. Only if validation data of the target endogenous variables are provided for validation -
r_square
Matrix of Squared Pearson's Correlation values of all measurement variables. Only if validation data of the target endogenous variables are provided for validation -
RMSE
Matrix of Root-Mean-Square-Error values of all measurement variables Only if validation data of the target endogenous variables are provided for validation -
nRMSE
Matrix of normalizedRoot-Mean-Square-Error [%] values of all measurement variables. Only if validation data of the target endogenous variables are provided for validation -
bias
Matrix of bias values of all measurement variables. Only if validation data of the target endogenous variables are provided for validation
plspm.groupsPredict:
Usage:
plspm.groupsPredict(pls, pls.groups, train.groups, dat)
Details:
This function has the same functions as <code>plspmPredict</code>, but uses a <code>plspm.groups</code> object as input. Therefore, it gives a list of predicted scores, measurement variables, and residuals for the 'general', 'group1', and 'group2' models.
plspmRsiduals:
Usage:
plspmRsiduals(pls)
Arguments:
- pls: An plspm object from the plspm package
- dat: data.frame or Raster Stack with the model predictors
Details:
This function obtain residuals for all Latent and Measurement variables from an 'plspm' object
Values:
An object of class <code>plspmResiduals</code> is returned. The object returns a list with:
-
inner_residuals
Matrix of residual values for the Latent Variables -
outer_residuals
Matrix of residual values for the Measurement Variables
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
