R/opt_split.R
opt_split.Rd
For a given data f
and its average mean square error AMSE
, the function returns a vector of
the optimal split with the average mean square errors on the left and right of the splitting point, respectively.
opt_split(f, AMSE, M = 5)
f | n x nx matrix. where n is number of samples (rows) and nx reperesents the grid size in functional data interpreptation, AMSE is the total of mean square errors computed rowwise |
---|---|
AMSE | integer. the average mean square errors of |
M | integer. the minimal number of points between the optimal split and the two ends of the iterval.
The default is 10. The program will return |
A list made of three numeric values: opt_ix
, AMSE_L
and AMSE_R
.
The first numiric value opt_ix
is the optimal split (knot), and AMSE_L
, AMSE_R
are the average mean square errors left and right the spliting point, respectively.
Nassar, H., Podgórski, K. (2019) Empirically driven orthonormal bases for functional data analysis. Preprint. Department of Statistics, Lund University.
split
for constructing split at a given knot;
## Example: n=10 f=rbetafda(n) nx=dim(f)[2] AMSE = amse(f) ### Total mean square error for whole the samples opt_split(f,AMSE)#> [[1]] #> [1] 483 #> #> [[2]] #> [1] 0.06773946 #> #> [[3]] #> [1] 0.3171577 #>