easystats / parameters

:bar_chart: Computation and processing of models' parameters
https://easystats.github.io/parameters/
GNU General Public License v3.0
418 stars 37 forks source link

parameters_selection for GAMs #161

Open DominiqueMakowski opened 4 years ago

DominiqueMakowski commented 4 years ago
IndrajeetPatil commented 3 years ago

Just adding an example for gamsel:

library(gamsel)
#> Loading required package: foreach
#> Loading required package: mda
#> Loading required package: class
#> Loaded mda 0.5-2
#> Loaded gamsel 1.8-1

data <- gendata(n = 500, p = 12, k.lin = 3, k.nonlin = 3, deg = 8, sigma = 0.5)
attach(data)
bases <- pseudo.bases(X, degree = 10, df = 6)

# Gaussian gam
gamsel.out <- gamsel(X, y, bases = bases)

class(gamsel.out)
#> [1] "gamsel"

gamsel.out
#> 
#> Call:  gamsel(x = X, y = y, bases = bases) 
#> 
#>       NonZero Lin NonLin    %Dev  Lambda
#>  [1,]       0   0      0 0.00000 34.0500
#>  [2,]       1   1      0 0.01590 31.0000
#>  [3,]       1   1      0 0.02908 28.2200
#>  [4,]       1   1      0 0.03999 25.6900
#>  [5,]       2   2      0 0.04912 23.3800
#>  [6,]       2   2      0 0.06348 21.2800
#>  [7,]       3   3      0 0.08133 19.3800
#>  [8,]       3   3      0 0.09740 17.6400
#>  [9,]       5   5      0 0.11300 16.0600
#> [10,]       5   4      1 0.14840 14.6200
#> [11,]       5   4      1 0.17860 13.3000
#> [12,]       6   4      2 0.21130 12.1100
#> [13,]       6   4      2 0.24270 11.0200
#> [14,]       6   4      2 0.26940 10.0400
#> [15,]       6   4      2 0.29220  9.1350
#> [16,]       7   4      3 0.31950  8.3160
#> [17,]       7   4      3 0.34440  7.5700
#> [18,]       7   4      3 0.36670  6.8910
#> [19,]       7   4      3 0.38710  6.2730
#> [20,]       7   4      3 0.40610  5.7100
#> [21,]       7   4      3 0.42410  5.1980
#> [22,]       7   4      3 0.44130  4.7320
#> [23,]       8   5      3 0.45850  4.3070
#> [24,]       8   5      3 0.47610  3.9210
#> [25,]       9   4      5 0.49430  3.5690
#> [26,]       9   3      6 0.51410  3.2490
#> [27,]       9   3      6 0.53420  2.9570
#> [28,]       9   3      6 0.55410  2.6920
#> [29,]       9   3      6 0.57350  2.4510
#> [30,]       9   3      6 0.59050  2.2310
#> [31,]       9   3      6 0.60670  2.0310
#> [32,]      10   3      7 0.62200  1.8490
#> [33,]      10   2      8 0.63640  1.6830
#> [34,]      10   2      8 0.64980  1.5320
#> [35,]      11   1     10 0.66250  1.3940
#> [36,]      11   1     10 0.67440  1.2690
#> [37,]      12   1     11 0.68520  1.1550
#> [38,]      12   1     11 0.69520  1.0520
#> [39,]      12   1     11 0.70440  0.9575
#> [40,]      12   0     12 0.71280  0.8716
#> [41,]      12   0     12 0.72060  0.7934
#> [42,]      12   0     12 0.72780  0.7222
#> [43,]      12   0     12 0.73440  0.6574
#> [44,]      12   0     12 0.74050  0.5985
#> [45,]      12   0     12 0.74610  0.5448
#> [46,]      12   0     12 0.75120  0.4959
#> [47,]      12   0     12 0.75590  0.4514
#> [48,]      12   0     12 0.76020  0.4109
#> [49,]      12   0     12 0.76410  0.3741
#> [50,]      12   0     12 0.76770  0.3405

Created on 2021-01-03 by the reprex package (v0.3.0)