
R Under development (unstable) (2026-04-23 r89955 ucrt) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> ## this will render the output independent from the version of the package
> suppressPackageStartupMessages(library(fsdaR))
> suppressPackageStartupMessages(library(rrcov))
> 
> ##  corfwdplot(), covplot(), spmplot(), regspmplot() =============
> data(hbk, package="robustbase")
> (out <- fsmult(hbk[,1:3], monitoring=TRUE))

This is the very first call to the FSDA engine, 
it can take some time to initialize it ...



Call:
fsmult(x = hbk[, 1:3], monitoring = TRUE)

> corfwdplot(out)
> 
> ##  takes too much time
> ##(out1 <- smult(hbk, monitoring=TRUE, trace=TRUE))
> ##corfwdplot(out1)
> 
> ##  Cannot suppress the temporary messages
> ##(out2 <- mmmult(hbk[,1:3], monitoring=TRUE, trace=TRUE))
> ##corfwdplot(out2)
> 
> (out3 <- fsreg(hbk[,1:3], hbk[,4], monitoring=TRUE, trace=TRUE, method="FS"))

Optional parameters: 
$intercept
[1] 1

$nocheck
[1] 0

$tstat
[1] "trad"

$conflev
[1] 0.95 0.99

attr(,"class")
[1] "FSReda_control"

Returning from MATLAB - Fields returned by MATLAB: 
 [1] "RES"       "LEV"       "BB"        "mdr"       "msr"       "nor"      
 [7] "Bols"      "S2"        "coo"       "Tols"      "Un"        "betaINT"  
[13] "sigma2INT" "y"         "X"         "class"    

Call:
fsreg.default(x = hbk[, 1:3], y = hbk[, 4], method = "FS", monitoring = TRUE,     trace = TRUE)

> corfwdplot(out3)
> 
> ##  takes too much time
> ##(out4 <- fsreg(hbk[,1:3], hbk[,4], monitoring=TRUE, trace=TRUE, method="S"))
> ##corfwdplot(out4)
> 
> ##  Cannot suppress the temporary messages
> ##(out5 <- fsreg(hbk[,1:3], hbk[,4], monitoring=TRUE, trace=TRUE, method="MM"))
> ##corfwdplot(out5)
> 
> 
> ##  Produce monitoring covariances plot with all default options
> out <- fsmult(hbk, monitoring=TRUE)
> covplot(out)
> 
> spmplot(hbk)
> 
> ## regspmplot() ==================================================
> set.seed(12345)
> n <- 100
> p <- 3
> X <- matrix(data=rnorm(n*p), nrow=n, ncol=p)
> y <- matrix(data=rnorm(n*1), nrow=n, ncol=1)
> regspmplot(y, X)
> 
> group <- rep(0, n)
> group[1:(n/2)] <- rep(1, n/2)
> regspmplot(y, X, group)
> regspmplot(y, X, group, plot=TRUE)
> regspmplot(y, X, group, xlim=c(-1,2), ylim=c(0,2), pch=c(10,11), trace=TRUE)

Optional parameters to regspmplot(): 
$group
  [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

$plo
$plo$sym
[1] ">"        "hexagram"

$plo$xlimx
[1] -1  2

$plo$ylimy
[1] 0 2


> 
> (out <- fsreg(y~X, method="LMS", control=LXS_control(nsamp=1000, msg=FALSE)))

Call:
fsreg.formula(formula = y ~ X, method = "LMS", control = LXS_control(nsamp = 1000,     msg = FALSE))

Coefficients:
(Intercept)           X1           X2           X3  
   -0.05276      0.11827      0.12531     -0.33265  

Scale estimate 0.6664 

> (out <- fsreg(y~X, bsb=out$bs, monitoring=TRUE))

Call:
fsreg.formula(formula = y ~ X, bsb = out$bs, monitoring = TRUE)

> resfwdplot(out)
standard
        xvalues: [13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 ... ] (1x88 double)
           xlim: ''
           ylim: ''
           titl: ''
           labx: 'Subset size m'
           laby: 'Scaled residuals'
          Color: {'b'}
      LineStyle: {'-'}
      LineWidth: 1
    SizeAxesLab: 12
    SizeAxesNum: 10

fground
      fthresh: 2.5000
        funit: ''
     flabstep: ''
        fmark: 0
    LineWidth: ''
        Color: ''
    LineStyle: ''
     FontSize: 12

bground
    bthresh: -Inf
     bstyle: ''

> ## regspmplot(out)
> 
> proc.time()
   user  system elapsed 
  18.39    4.43   17.76 
