Description Usage Arguments Details Value References See Also Examples
This function inserts a change in the mean function to a given functional data sample. The change function
can either be directly defined by the user or it can be generated based on the sum of first
k
basis functions defined by the fdobj
. Once the change function is defined the change is inserted at the
defined change location with a signal magnitude defined by signal to noise ratio, SNR
.
For more details on how these quantities are defined. See Aue, Rice and Sonmez (2017+).
1 2 |
fdobj |
Functional data object of class |
change_fun |
Self defined change function. It has to be a functional data object having the same number of basis functions. |
k |
Number of basis functions to be summed to construct the change function. It should
be used when |
change_location |
Location of the change to be inserted. It is scaled to be in [0,1]. |
SNR |
Signal to Noise Ratio to determine the magnitude of the change function that is being inserted. |
plot |
Plots the functional data before (blue) and after (red) the change. |
... |
Further information to pass |
This function should only be used to artificially insert a change function to the mean of the functional data set either by defining a specific change function or generating the change function based from the basis functions.
fundata:
functional data with an inserted change in the mean function
change_fun:
inserted change function
plot:
of the functional data with inserted change
Ramsay, James O., and Silverman, Bernard W. (2006), Functional Data Analysis, 2nd ed., Springer, New York.
Aue A., Rice G., Sonmez O. (2017+), Detecting and dating structural breaks in functional data without dimension reduction (https://arxiv.org/pdf/1511.04020.pdf)
Data2fd, fun_IID, fun_MA, fun_AR
1 2 3 4 5 6 7 8 9 10 11 12 13 | ####################################
#first generate FAR(1) process
fdata = fun_AR(n=100, nbasis=25, Sigma=2^-(1:25))
# insert the change which is the sum of first 3 basis functions
# in the middle of the data with SNR=2
insert_change(fdata, k=3, change_location=0.5, SNR=2)
####################################
#first generate FAR(1) process
fdata = fun_AR(n=100, nbasis=25, Sigma=2^-(1:25))
# insert the change which is the 20th onservation
# in the middle of the data with SNR=2
insert_change(fdata, change_fun = fdata[20], change_location=0.5, SNR=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.