Skip to contents

The function constructs a Splinets-object that is made of subsampled elements of the input Splinets-object. The input objects have to be of the same order and over the same knots.

Usage

subsample(Sp, ss)

Arguments

Sp

Splinets-object, a collection of s splines;

ss

vector of integers, the coordinates from 1:s;

Value

An Splinets-object containing length(ss) splines that are selected from the input object./

Details

The output Splinet-object made of subsampled splines is always is of the regular type, i.e. SLOT type='sp'.

References

Liu, X., Nassar, H., Podg\(\mbox{\'o}\)rski, K. "Dyadic diagonalization of positive definite band matrices and efficient B-spline orthogonalization." Journal of Computational and Applied Mathematics (2022) <https://doi.org/10.1016/j.cam.2022.114444>.

Podg\(\mbox{\'o}\)rski, K. (2021) "Splinets – splines through the Taylor expansion, their support sets and orthogonal bases." <arXiv:2102.00733>.

Nassar, H., Podg\(\mbox{\'o}\)rski, K. (2023) "Splinets 1.5.0 – Periodic Splinets." <arXiv:2302.07552>

See also

is.splinets for diagnostic of Splinets-objects; construct for constructing such a Splinets-object; gather for combining Splinets-objects; refine for refinment of a spline to a larger number of knots; plot,Splinets-method for plotting Splinets-objects;

Examples

#-----------------------------------------------------#
#---------------------Subsampling---------------------#
#-----------------------------------------------------#

#Example with different support ranges, the 3rd order
n=25; xi=sort(runif(n+2)); xi[1]=0; xi[n+2]=1; k=3
supp=list(t(c(2,12)),t(c(4,20)),t(c(6,25))) #defining support ranges for three splines

#Initial random matrices of the derivative for each spline
set.seed(5)
SS1=matrix(rnorm((supp[[1]][1,2]-supp[[1]][1,1]+1)*(k+1)),ncol=(k+1)) 
SS2=matrix(rnorm((supp[[2]][1,2]-supp[[2]][1,1]+1)*(k+1)),ncol=(k+1)) 
SS3=matrix(rnorm((supp[[3]][1,2]-supp[[3]][1,1]+1)*(k+1)),ncol=(k+1)) 

spl=construct(xi,k,SS1,supp[[1]]) #constructing the first correct spline
#> 
#> Using  method RRM to correct the derivative matrix entries.
#> 
#> 
#> DIAGNOSTIC CHECK of a SPLINETS object
#> 
#> THE KNOTS:  
#> 
#> 
#> THE SUPPORT SETS:  
#> 
#> 
#> 
#> THE DERIVATIVES AT THE KNOTS:  
#> 
#> The boundary zero conditions are not satisfied for spline 1 in the input 'Splinets' object.
#> Correction of the first and last rows of the derivative matrices over the support component 1 of spline 1 in the output 'Splinets' object.
#> 
#> Spline 1 support 1 's highest derivative at the central knot is not zero.
#> Now it is set to zero.
#> 
#> The matrix of derivatives at the knots for spline 1 , support 1  does not satisfy the splie conditions (up to the accuracy set in SLOT 'epsilon').
#> The computed standard error per matrix entry is 1.311759 .
#> 
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The output object Spline 1  support 1 has the derivative matrix corrected by the RRM method.
#> The matrix derivative is now corrected by method RRM .
nspl=construct(xi,k,SS2,supp[[2]],'CRFC')
#> 
#> Using  method CRFC to correct the derivative matrix entries.
#> 
#> 
#> DIAGNOSTIC CHECK of a SPLINETS object
#> 
#> THE KNOTS:  
#> 
#> 
#> THE SUPPORT SETS:  
#> 
#> 
#> 
#> THE DERIVATIVES AT THE KNOTS:  
#> 
#> The boundary zero conditions are not satisfied for spline 1 in the input 'Splinets' object.
#> Correction of the first and last rows of the derivative matrices over the support component 1 of spline 1 in the output 'Splinets' object.
#> 
#> Spline 1 support 1 's highest derivative at the central knot is not zero.
#> Now it is set to zero.
#> 
#> The matrix of derivatives at the knots for spline 1 , support 1  does not satisfy the splie conditions (up to the accuracy set in SLOT 'epsilon').
#> The computed standard error per matrix entry is 1.29385 .
#> 
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The output object Spline 1  support 1 has the derivative matrix corrected by the RRM method.The zero boundary conditions are not satisfied.
#> The correction of the first and last rows of the derivative matrix has been made.
#> 
#> 
#> The highest order derivative at the central knot is not equal to zero.
#> It has been made equal to zero now.
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The matrix derivative is now corrected by method CRFC .

#See 'gather' function for more details on what follows
spl=gather(spl,nspl) #the second and the first ones
nspl=construct(xi,k,SS3,supp[[3]],'CRLC')
#> 
#> Using  method CRLC to correct the derivative matrix entries.
#> 
#> 
#> DIAGNOSTIC CHECK of a SPLINETS object
#> 
#> THE KNOTS:  
#> 
#> 
#> THE SUPPORT SETS:  
#> 
#> 
#> 
#> THE DERIVATIVES AT THE KNOTS:  
#> 
#> The boundary zero conditions are not satisfied for spline 1 in the input 'Splinets' object.
#> Correction of the first and last rows of the derivative matrices over the support component 1 of spline 1 in the output 'Splinets' object.
#> 
#> Spline 1 , support 1  - highest derivative is not symmetric at the center (equal values at the two central knots).
#> The two values have been made equal by averaging.
#> 
#> The matrix of derivatives at the knots for spline 1 , support 1  does not satisfy the splie conditions (up to the accuracy set in SLOT 'epsilon').
#> The computed standard error per matrix entry is 1.646284 .
#> 
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> Correction of the LHS part of the matrix
#> There are less than 5 knots, the first 2 entries of the 5 nd row counting from the end in the input will be changed in the output.
#> 
#> 
#> Correction of the RHS part of the matrix
#> There are less than 5 knots, the first 2 entries of the 5 nd row counting from the end in the input will be changed in the output.
#> 
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The output object Spline 1  support 1 has the derivative matrix corrected by the RRM method.The zero boundary conditions are not satisfied.
#> The correction of the first and last rows of the derivative matrix has been made.
#> 
#> 
#> The highest order derivative is not symmetrically defined at the center.
#>           The values at the two central knots should be equal.
#> The highest order derivative values at the two central knots
#>           have been made equal by averaging the two central values.
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The matrix derivative is now corrected by method CRLC .
spl=gather(spl,nspl) #the third is added

#Replicating by subsampling with replacement
sz=length(spl@der)
ss=sample(1:sz,size=10,rep=TRUE)

spl=subsample(spl,ss)
is.splinets(spl)[[1]]
#> 
#> 
#> DIAGNOSTIC CHECK of a SPLINETS object
#> 
#> THE KNOTS:  
#> 
#> 
#> THE SUPPORT SETS:  
#> 
#> 
#> 
#> THE DERIVATIVES AT THE KNOTS:  
#> 
#> 
#> The matrix of derivatives at the knots for spline 3 , support 1  does not satisfy the splie conditions (up to the accuracy set in SLOT 'epsilon').
#> The computed standard error per matrix entry is 3.272174e-07 .
#> 
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The output object Spline 3  support 1 has the derivative matrix corrected by the RRM method.
#> The matrix of derivatives at the knots for spline 5 , support 1  does not satisfy the splie conditions (up to the accuracy set in SLOT 'epsilon').
#> The computed standard error per matrix entry is 3.272174e-07 .
#> 
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The output object Spline 5  support 1 has the derivative matrix corrected by the RRM method.
#> The matrix of derivatives at the knots for spline 6 , support 1  does not satisfy the splie conditions (up to the accuracy set in SLOT 'epsilon').
#> The computed standard error per matrix entry is 3.272174e-07 .
#> 
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The output object Spline 6  support 1 has the derivative matrix corrected by the RRM method.
#> The matrix of derivatives at the knots for spline 7 , support 1  does not satisfy the splie conditions (up to the accuracy set in SLOT 'epsilon').
#> The computed standard error per matrix entry is 3.272174e-07 .
#> 
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The output object Spline 7  support 1 has the derivative matrix corrected by the RRM method.
#> [1] FALSE

spl@supp
#> [[1]]
#>      [,1] [,2]
#> [1,]    2   12
#> 
#> [[2]]
#>      [,1] [,2]
#> [1,]    6   25
#> 
#> [[3]]
#>      [,1] [,2]
#> [1,]    4   20
#> 
#> [[4]]
#>      [,1] [,2]
#> [1,]    2   12
#> 
#> [[5]]
#>      [,1] [,2]
#> [1,]    4   20
#> 
#> [[6]]
#>      [,1] [,2]
#> [1,]    4   20
#> 
#> [[7]]
#>      [,1] [,2]
#> [1,]    4   20
#> 
#> [[8]]
#>      [,1] [,2]
#> [1,]    6   25
#> 
#> [[9]]
#>      [,1] [,2]
#> [1,]    2   12
#> 
#> [[10]]
#>      [,1] [,2]
#> [1,]    6   25
#> 
spl@der
#> [[1]]
#>              [,1]        [,2]         [,3]          [,4]
#>  [1,]  0.00000000   0.0000000     0.000000 -1.701607e+04
#>  [2,] -0.18861400 -13.9660365  -689.415684  8.006952e+04
#>  [3,] -0.52285124  -9.5045431  1090.758120 -6.718437e+04
#>  [4,] -0.58130959  -0.6501706     1.545744 -1.009533e+00
#>  [5,] -0.59556091  -0.6156176     1.523010 -2.000473e+00
#>  [6,] -0.60290798  -0.5973131     1.498774  0.000000e+00
#>  [7,] -0.62170714  -0.5481955     1.494093 -1.426081e-01
#>  [8,] -0.63737252  -0.5029851     1.540283  1.550060e+00
#>  [9,] -0.63323135   5.4788975  4307.928400  1.551204e+06
#> [10,] -0.02086494  10.9898246 -3858.985284 -3.326554e+05
#> [11,]  0.00000000   0.0000000     0.000000  6.775253e+05
#> 
#> [[2]]
#>               [,1]       [,2]        [,3]          [,4]
#>  [1,]  0.000000000  0.0000000    0.000000 -6.115597e+04
#>  [2,] -0.018124452 -4.4880780 -740.908607  3.970527e+04
#>  [3,] -0.330537636 -7.4186308  562.342214 -1.883325e+04
#>  [4,] -0.384988728  0.9768266    1.134166  3.320349e-01
#>  [5,] -0.382272531  0.9799765    1.135087  1.572288e+00
#>  [6,] -0.357867495  1.0083175    1.173688 -1.069471e+00
#>  [7,] -0.352105409  1.0149851    1.167597  9.162865e-01
#>  [8,] -0.346805381  1.0210763    1.172367 -5.949929e-01
#>  [9,] -0.309577061  1.0625867    1.151107  2.181647e+00
#> [10,] -0.301041386  1.0718631    1.168556  3.314296e-02
#> [11,] -0.214273504  1.1627137    1.171130  3.314296e-02
#> [12,] -0.182175832  1.1949644    1.197662  9.743826e-01
#> [13,] -0.175861339  1.2012589    1.190998 -1.264473e+00
#> [14,] -0.073105262  1.2982348    1.168191 -2.774214e-01
#> [15,] -0.017615961  1.3470762    1.160245 -1.893987e-01
#> [16,] -0.011188490  1.3525965    1.158416 -3.840249e-01
#> [17,]  0.025061016  1.3835517    1.178040  7.405880e-01
#> [18,]  0.067815404  0.2229417  -55.743323 -1.338059e+03
#> [19,]  0.007379618 -0.6149995   34.168383  1.157503e+03
#> [20,]  0.000000000  0.0000000    0.000000 -9.491701e+02
#> 
#> [[3]]
#>                [,1]          [,2]          [,3]         [,4]
#>  [1,]  0.000000e+00  0.000000e+00  0.000000e+00  -2535361836
#>  [2,] -1.800618e+03 -3.331951e+05 -4.110402e+07   6338705399
#>  [3,] -7.661648e+03  3.484016e+05  1.016387e+08 -13560055910
#>  [4,] -4.602446e-01  5.846235e+05 -6.264228e+07   2469520918
#>  [5,] -7.243285e-01 -1.412136e+05  1.841509e+07   -899614499
#>  [6,] -6.921116e-02  8.119456e+03 -8.392332e+06   3177689711
#>  [7,]  1.463249e+00 -2.933671e+03  4.294365e+05    -23789154
#>  [8,]  1.877261e-01  4.400007e+02 -1.546032e+05     27144223
#>  [9,]  1.022023e+00 -2.796661e-01  2.387233e+00            0
#> [10,] -5.918348e-01 -9.294155e+02 -3.569389e+05    -68561227
#> [11,] -1.122007e-01  8.276058e+03  8.721990e+05     34399415
#> [12,] -9.249531e-01 -2.034494e+04 -8.029150e+06  -1112933354
#> [13,]  7.533048e-01  3.525286e+05  1.763181e+07    330424825
#> [14,] -1.126091e-01 -9.452061e+05 -1.129498e+08  -4795574597
#> [15,] -5.802955e+03 -1.115047e+06  4.849832e+07  30633231265
#> [16,] -4.150852e+03  2.968282e+05 -1.415082e+07   -762050940
#> [17,]  0.000000e+00  0.000000e+00  0.000000e+00    337309290
#> 
#> [[4]]
#>              [,1]        [,2]         [,3]          [,4]
#>  [1,]  0.00000000   0.0000000     0.000000 -1.701607e+04
#>  [2,] -0.18861400 -13.9660365  -689.415684  8.006952e+04
#>  [3,] -0.52285124  -9.5045431  1090.758120 -6.718437e+04
#>  [4,] -0.58130959  -0.6501706     1.545744 -1.009533e+00
#>  [5,] -0.59556091  -0.6156176     1.523010 -2.000473e+00
#>  [6,] -0.60290798  -0.5973131     1.498774  0.000000e+00
#>  [7,] -0.62170714  -0.5481955     1.494093 -1.426081e-01
#>  [8,] -0.63737252  -0.5029851     1.540283  1.550060e+00
#>  [9,] -0.63323135   5.4788975  4307.928400  1.551204e+06
#> [10,] -0.02086494  10.9898246 -3858.985284 -3.326554e+05
#> [11,]  0.00000000   0.0000000     0.000000  6.775253e+05
#> 
#> [[5]]
#>                [,1]          [,2]          [,3]         [,4]
#>  [1,]  0.000000e+00  0.000000e+00  0.000000e+00  -2535361836
#>  [2,] -1.800618e+03 -3.331951e+05 -4.110402e+07   6338705399
#>  [3,] -7.661648e+03  3.484016e+05  1.016387e+08 -13560055910
#>  [4,] -4.602446e-01  5.846235e+05 -6.264228e+07   2469520918
#>  [5,] -7.243285e-01 -1.412136e+05  1.841509e+07   -899614499
#>  [6,] -6.921116e-02  8.119456e+03 -8.392332e+06   3177689711
#>  [7,]  1.463249e+00 -2.933671e+03  4.294365e+05    -23789154
#>  [8,]  1.877261e-01  4.400007e+02 -1.546032e+05     27144223
#>  [9,]  1.022023e+00 -2.796661e-01  2.387233e+00            0
#> [10,] -5.918348e-01 -9.294155e+02 -3.569389e+05    -68561227
#> [11,] -1.122007e-01  8.276058e+03  8.721990e+05     34399415
#> [12,] -9.249531e-01 -2.034494e+04 -8.029150e+06  -1112933354
#> [13,]  7.533048e-01  3.525286e+05  1.763181e+07    330424825
#> [14,] -1.126091e-01 -9.452061e+05 -1.129498e+08  -4795574597
#> [15,] -5.802955e+03 -1.115047e+06  4.849832e+07  30633231265
#> [16,] -4.150852e+03  2.968282e+05 -1.415082e+07   -762050940
#> [17,]  0.000000e+00  0.000000e+00  0.000000e+00    337309290
#> 
#> [[6]]
#>                [,1]          [,2]          [,3]         [,4]
#>  [1,]  0.000000e+00  0.000000e+00  0.000000e+00  -2535361836
#>  [2,] -1.800618e+03 -3.331951e+05 -4.110402e+07   6338705399
#>  [3,] -7.661648e+03  3.484016e+05  1.016387e+08 -13560055910
#>  [4,] -4.602446e-01  5.846235e+05 -6.264228e+07   2469520918
#>  [5,] -7.243285e-01 -1.412136e+05  1.841509e+07   -899614499
#>  [6,] -6.921116e-02  8.119456e+03 -8.392332e+06   3177689711
#>  [7,]  1.463249e+00 -2.933671e+03  4.294365e+05    -23789154
#>  [8,]  1.877261e-01  4.400007e+02 -1.546032e+05     27144223
#>  [9,]  1.022023e+00 -2.796661e-01  2.387233e+00            0
#> [10,] -5.918348e-01 -9.294155e+02 -3.569389e+05    -68561227
#> [11,] -1.122007e-01  8.276058e+03  8.721990e+05     34399415
#> [12,] -9.249531e-01 -2.034494e+04 -8.029150e+06  -1112933354
#> [13,]  7.533048e-01  3.525286e+05  1.763181e+07    330424825
#> [14,] -1.126091e-01 -9.452061e+05 -1.129498e+08  -4795574597
#> [15,] -5.802955e+03 -1.115047e+06  4.849832e+07  30633231265
#> [16,] -4.150852e+03  2.968282e+05 -1.415082e+07   -762050940
#> [17,]  0.000000e+00  0.000000e+00  0.000000e+00    337309290
#> 
#> [[7]]
#>                [,1]          [,2]          [,3]         [,4]
#>  [1,]  0.000000e+00  0.000000e+00  0.000000e+00  -2535361836
#>  [2,] -1.800618e+03 -3.331951e+05 -4.110402e+07   6338705399
#>  [3,] -7.661648e+03  3.484016e+05  1.016387e+08 -13560055910
#>  [4,] -4.602446e-01  5.846235e+05 -6.264228e+07   2469520918
#>  [5,] -7.243285e-01 -1.412136e+05  1.841509e+07   -899614499
#>  [6,] -6.921116e-02  8.119456e+03 -8.392332e+06   3177689711
#>  [7,]  1.463249e+00 -2.933671e+03  4.294365e+05    -23789154
#>  [8,]  1.877261e-01  4.400007e+02 -1.546032e+05     27144223
#>  [9,]  1.022023e+00 -2.796661e-01  2.387233e+00            0
#> [10,] -5.918348e-01 -9.294155e+02 -3.569389e+05    -68561227
#> [11,] -1.122007e-01  8.276058e+03  8.721990e+05     34399415
#> [12,] -9.249531e-01 -2.034494e+04 -8.029150e+06  -1112933354
#> [13,]  7.533048e-01  3.525286e+05  1.763181e+07    330424825
#> [14,] -1.126091e-01 -9.452061e+05 -1.129498e+08  -4795574597
#> [15,] -5.802955e+03 -1.115047e+06  4.849832e+07  30633231265
#> [16,] -4.150852e+03  2.968282e+05 -1.415082e+07   -762050940
#> [17,]  0.000000e+00  0.000000e+00  0.000000e+00    337309290
#> 
#> [[8]]
#>               [,1]       [,2]        [,3]          [,4]
#>  [1,]  0.000000000  0.0000000    0.000000 -6.115597e+04
#>  [2,] -0.018124452 -4.4880780 -740.908607  3.970527e+04
#>  [3,] -0.330537636 -7.4186308  562.342214 -1.883325e+04
#>  [4,] -0.384988728  0.9768266    1.134166  3.320349e-01
#>  [5,] -0.382272531  0.9799765    1.135087  1.572288e+00
#>  [6,] -0.357867495  1.0083175    1.173688 -1.069471e+00
#>  [7,] -0.352105409  1.0149851    1.167597  9.162865e-01
#>  [8,] -0.346805381  1.0210763    1.172367 -5.949929e-01
#>  [9,] -0.309577061  1.0625867    1.151107  2.181647e+00
#> [10,] -0.301041386  1.0718631    1.168556  3.314296e-02
#> [11,] -0.214273504  1.1627137    1.171130  3.314296e-02
#> [12,] -0.182175832  1.1949644    1.197662  9.743826e-01
#> [13,] -0.175861339  1.2012589    1.190998 -1.264473e+00
#> [14,] -0.073105262  1.2982348    1.168191 -2.774214e-01
#> [15,] -0.017615961  1.3470762    1.160245 -1.893987e-01
#> [16,] -0.011188490  1.3525965    1.158416 -3.840249e-01
#> [17,]  0.025061016  1.3835517    1.178040  7.405880e-01
#> [18,]  0.067815404  0.2229417  -55.743323 -1.338059e+03
#> [19,]  0.007379618 -0.6149995   34.168383  1.157503e+03
#> [20,]  0.000000000  0.0000000    0.000000 -9.491701e+02
#> 
#> [[9]]
#>              [,1]        [,2]         [,3]          [,4]
#>  [1,]  0.00000000   0.0000000     0.000000 -1.701607e+04
#>  [2,] -0.18861400 -13.9660365  -689.415684  8.006952e+04
#>  [3,] -0.52285124  -9.5045431  1090.758120 -6.718437e+04
#>  [4,] -0.58130959  -0.6501706     1.545744 -1.009533e+00
#>  [5,] -0.59556091  -0.6156176     1.523010 -2.000473e+00
#>  [6,] -0.60290798  -0.5973131     1.498774  0.000000e+00
#>  [7,] -0.62170714  -0.5481955     1.494093 -1.426081e-01
#>  [8,] -0.63737252  -0.5029851     1.540283  1.550060e+00
#>  [9,] -0.63323135   5.4788975  4307.928400  1.551204e+06
#> [10,] -0.02086494  10.9898246 -3858.985284 -3.326554e+05
#> [11,]  0.00000000   0.0000000     0.000000  6.775253e+05
#> 
#> [[10]]
#>               [,1]       [,2]        [,3]          [,4]
#>  [1,]  0.000000000  0.0000000    0.000000 -6.115597e+04
#>  [2,] -0.018124452 -4.4880780 -740.908607  3.970527e+04
#>  [3,] -0.330537636 -7.4186308  562.342214 -1.883325e+04
#>  [4,] -0.384988728  0.9768266    1.134166  3.320349e-01
#>  [5,] -0.382272531  0.9799765    1.135087  1.572288e+00
#>  [6,] -0.357867495  1.0083175    1.173688 -1.069471e+00
#>  [7,] -0.352105409  1.0149851    1.167597  9.162865e-01
#>  [8,] -0.346805381  1.0210763    1.172367 -5.949929e-01
#>  [9,] -0.309577061  1.0625867    1.151107  2.181647e+00
#> [10,] -0.301041386  1.0718631    1.168556  3.314296e-02
#> [11,] -0.214273504  1.1627137    1.171130  3.314296e-02
#> [12,] -0.182175832  1.1949644    1.197662  9.743826e-01
#> [13,] -0.175861339  1.2012589    1.190998 -1.264473e+00
#> [14,] -0.073105262  1.2982348    1.168191 -2.774214e-01
#> [15,] -0.017615961  1.3470762    1.160245 -1.893987e-01
#> [16,] -0.011188490  1.3525965    1.158416 -3.840249e-01
#> [17,]  0.025061016  1.3835517    1.178040  7.405880e-01
#> [18,]  0.067815404  0.2229417  -55.743323 -1.338059e+03
#> [19,]  0.007379618 -0.6149995   34.168383  1.157503e+03
#> [20,]  0.000000000  0.0000000    0.000000 -9.491701e+02
#> 

#Subsampling without replacements
ss=c(3,8,1)
sspl=subsample(spl,ss)

sspl@supp
#> [[1]]
#>      [,1] [,2]
#> [1,]    4   20
#> 
#> [[2]]
#>      [,1] [,2]
#> [1,]    6   25
#> 
#> [[3]]
#>      [,1] [,2]
#> [1,]    2   12
#> 
sspl@der
#> [[1]]
#>                [,1]          [,2]          [,3]         [,4]
#>  [1,]  0.000000e+00  0.000000e+00  0.000000e+00  -2535361836
#>  [2,] -1.800618e+03 -3.331951e+05 -4.110402e+07   6338705399
#>  [3,] -7.661648e+03  3.484016e+05  1.016387e+08 -13560055910
#>  [4,] -4.602446e-01  5.846235e+05 -6.264228e+07   2469520918
#>  [5,] -7.243285e-01 -1.412136e+05  1.841509e+07   -899614499
#>  [6,] -6.921116e-02  8.119456e+03 -8.392332e+06   3177689711
#>  [7,]  1.463249e+00 -2.933671e+03  4.294365e+05    -23789154
#>  [8,]  1.877261e-01  4.400007e+02 -1.546032e+05     27144223
#>  [9,]  1.022023e+00 -2.796661e-01  2.387233e+00            0
#> [10,] -5.918348e-01 -9.294155e+02 -3.569389e+05    -68561227
#> [11,] -1.122007e-01  8.276058e+03  8.721990e+05     34399415
#> [12,] -9.249531e-01 -2.034494e+04 -8.029150e+06  -1112933354
#> [13,]  7.533048e-01  3.525286e+05  1.763181e+07    330424825
#> [14,] -1.126091e-01 -9.452061e+05 -1.129498e+08  -4795574597
#> [15,] -5.802955e+03 -1.115047e+06  4.849832e+07  30633231265
#> [16,] -4.150852e+03  2.968282e+05 -1.415082e+07   -762050940
#> [17,]  0.000000e+00  0.000000e+00  0.000000e+00    337309290
#> 
#> [[2]]
#>               [,1]       [,2]        [,3]          [,4]
#>  [1,]  0.000000000  0.0000000    0.000000 -6.115597e+04
#>  [2,] -0.018124452 -4.4880780 -740.908607  3.970527e+04
#>  [3,] -0.330537636 -7.4186308  562.342214 -1.883325e+04
#>  [4,] -0.384988728  0.9768266    1.134166  3.320349e-01
#>  [5,] -0.382272531  0.9799765    1.135087  1.572288e+00
#>  [6,] -0.357867495  1.0083175    1.173688 -1.069471e+00
#>  [7,] -0.352105409  1.0149851    1.167597  9.162865e-01
#>  [8,] -0.346805381  1.0210763    1.172367 -5.949929e-01
#>  [9,] -0.309577061  1.0625867    1.151107  2.181647e+00
#> [10,] -0.301041386  1.0718631    1.168556  3.314296e-02
#> [11,] -0.214273504  1.1627137    1.171130  3.314296e-02
#> [12,] -0.182175832  1.1949644    1.197662  9.743826e-01
#> [13,] -0.175861339  1.2012589    1.190998 -1.264473e+00
#> [14,] -0.073105262  1.2982348    1.168191 -2.774214e-01
#> [15,] -0.017615961  1.3470762    1.160245 -1.893987e-01
#> [16,] -0.011188490  1.3525965    1.158416 -3.840249e-01
#> [17,]  0.025061016  1.3835517    1.178040  7.405880e-01
#> [18,]  0.067815404  0.2229417  -55.743323 -1.338059e+03
#> [19,]  0.007379618 -0.6149995   34.168383  1.157503e+03
#> [20,]  0.000000000  0.0000000    0.000000 -9.491701e+02
#> 
#> [[3]]
#>              [,1]        [,2]         [,3]          [,4]
#>  [1,]  0.00000000   0.0000000     0.000000 -1.701607e+04
#>  [2,] -0.18861400 -13.9660365  -689.415684  8.006952e+04
#>  [3,] -0.52285124  -9.5045431  1090.758120 -6.718437e+04
#>  [4,] -0.58130959  -0.6501706     1.545744 -1.009533e+00
#>  [5,] -0.59556091  -0.6156176     1.523010 -2.000473e+00
#>  [6,] -0.60290798  -0.5973131     1.498774  0.000000e+00
#>  [7,] -0.62170714  -0.5481955     1.494093 -1.426081e-01
#>  [8,] -0.63737252  -0.5029851     1.540283  1.550060e+00
#>  [9,] -0.63323135   5.4788975  4307.928400  1.551204e+06
#> [10,] -0.02086494  10.9898246 -3858.985284 -3.326554e+05
#> [11,]  0.00000000   0.0000000     0.000000  6.775253e+05
#> 

is.splinets(sspl)[[1]]
#> 
#> 
#> DIAGNOSTIC CHECK of a SPLINETS object
#> 
#> THE KNOTS:  
#> 
#> 
#> THE SUPPORT SETS:  
#> 
#> 
#> 
#> THE DERIVATIVES AT THE KNOTS:  
#> 
#> 
#> The matrix of derivatives at the knots for spline 1 , support 1  does not satisfy the splie conditions (up to the accuracy set in SLOT 'epsilon').
#> The computed standard error per matrix entry is 3.272174e-07 .
#> 
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The output object Spline 1  support 1 has the derivative matrix corrected by the RRM method.
#> [1] FALSE

#A single spline sampled from a 'Splinets' object
is.splinets(subsample(sspl,1))
#> 
#> 
#> DIAGNOSTIC CHECK of a SPLINETS object
#> 
#> THE KNOTS:  
#> 
#> 
#> THE SUPPORT SETS:  
#> 
#> 
#> 
#> THE DERIVATIVES AT THE KNOTS:  
#> 
#> 
#> The matrix of derivatives at the knots for spline 1 , support 1  does not satisfy the splie conditions (up to the accuracy set in SLOT 'epsilon').
#> The computed standard error per matrix entry is 3.272174e-07 .
#> 
#> 
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> Correction of the LHS part of the matrix
#> Correction of the RHS part of the matrix
#> The output object Spline 1  support 1 has the derivative matrix corrected by the RRM method.
#> $is
#> [1] FALSE
#> 
#> $robject
#> splines
#> Knots: 27 non-equaly distributed knots between 0 and 1 
#> Size: 1 spline functions
#> Order: 3 
#> Support: Not the full range support, a single support interval for each spline.
#> $Er
#> [1] 4.818204e-12
#>