Regular Data Class
rdClass.Rd
The rdClass
class denotes an element of regular data.
Data objects are constructed with observations in rows and variables in columns.
The smoothing parameter is automatically set to zero (no smoothing).
Users can assign sparsity parameters only!
No grid points are involved in
rdClass
objects.
Arguments
- data
A matrix representing the data, with rows indicating observations and columns representing variables.
- Sparsity_parameter
A fixed number representing the level of sparsity for columns, or a vector of numerical values that will undergo cross-validation (CV) to determine the optimal value.
For no sparsity, set it to 0.
If
NULL
, the sparsity parameter will be tuned automatically.
Examples
# Example for Regular Data (rd)
rd_data <- matrix(rnorm(100), nrow = 10, ncol = 10) # 10 rows, 10 columns
rd_object <- rdClass(data = rd_data,
Sparsity_parameter = 3) # Custom sparsity parameter
# Display the created rd object
print(rd_object)
#> Regular Data (rdClass) Object
#> -----------------------------------
#> Dimensions: 10 x 10
#> Sparsity Parameter: 3
#> -----------------------------------
#> First few rows and columns of the data:
#> V1 V2 V3 V4 V5
#> [1,] 0.042869041 -1.9192325 0.9713965 -0.24131172 0.07365823
#> [2,] -0.008866413 -1.5342664 -0.5796630 0.82415583 0.35723614
#> [3,] -2.949083784 -1.1147612 1.6041798 -1.55564397 0.55042842
#> [4,] 0.020358254 1.5978116 0.2259733 0.09350128 0.03840179
#> [5,] -0.098446980 -0.6398051 -0.5148571 -0.36694942 -1.60957529
print(attr(rd_object, "Sparsity_parameter")) # Display sparsity parameter
#> [1] 3