Skip to content

Commit

Permalink
mbplsr
Browse files Browse the repository at this point in the history
  • Loading branch information
mlesnoff committed Feb 14, 2025
1 parent 069d594 commit a755bfd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/mbplsr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ This function runs a PLSR on {X, `Y`} where X is the horizontal
concatenation of the blocks in `Xbl`. The function gives the
same global LVs and predictions as function `mbplswest`, but is much faster.
Function `summary` returns:
* `explvarx` : Proportion of the total X inertia (squared Frobenious norm)
explained by the global LVs.
* `rdxbl2t` : Rd coefficients between each block (= Xbl[k]) and the global LVs.
* `rvxbl2t` : RV coefficients between each block and the global LVs.
* `corx2t` : Correlation between the X-variables and the global LVs.
## Examples
```julia
using Jchemo, JchemoData, JLD2
Expand Down Expand Up @@ -191,3 +198,5 @@ function Base.summary(object::Mbplsr, Xbl)
corx2t = DataFrame(z, nam)
(explvarx = explvarx, rdxbl2t, rvxbl2t, corx2t)
end


15 changes: 12 additions & 3 deletions src/mbplswest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ Keyword arguments:
This functions implements the MBPLSR Nipals algorithm such
as in Westerhuis et al. 1998. The function gives the same
results as function `mbplsr`.
global scores and predictions as function `mbplsr`.
Function `summary` returns:
* `explvarx` : Proportion of the total X inertia (squared Frobenious norm)
explained by the global LVs.
* `rdxbl2t` : Rd coefficients between each block (= Xbl[k]) and the global LVs.
* `rvxbl2t` : RV coefficients between each block and the global LVs.
* `cortbl2t` : Correlations between the block LVs (= Tbl[k]) and the global LVs.
* `corx2t` : Correlation between the X-variables and the global LVs.
## References
Westerhuis, J.A., Kourti, T., MacGregor, J.F., 1998. Analysis
Expand Down Expand Up @@ -70,9 +78,10 @@ rmsep(res.pred, ytest)
res = summary(model, Xbltrain) ;
pnames(res)
res.explvarx
res.rdxbl2t
res.rvxbl2t
res.cortbl2t
res.corx2t
res.cortb2t
res.rdx
```
"""
mbplswest(; kwargs...) = JchemoModel(mbplswest, nothing, kwargs)
Expand Down

0 comments on commit a755bfd

Please sign in to comment.