This function performs the smoothing of a curve using the Nadaraya-Watson estimator given a particular kernel.
estimate_curve( curve, U, b, t0_list = NULL, kernel = "epanechnikov", n_obs_min = 1 )
curve | A list, with two entries:
|
---|---|
U | A vector of numeric, sampling points at which estimate the curve. |
b | Numeric or vector of numeric, estimation of the bandwidth. If one is provided, we use a unique bandwidth for the curve. However, if a vector is given, the bandwidth changes depending on the sampling points. |
t0_list | A vector of numeric, times at which the bandwidths have been
estimated. Only used if the parameter |
kernel | Character string, the kernel used for the estimation:
|
n_obs_min | Integer, minimum number of observation for the smoothing |
A list, with two entries:
$t The sampling points
$x The estimated points.
X <- generate_piecewise_fractional_brownian(N = 1, M = 300, H = c(0.2, 0.5, 0.8), sigma = 0.05) #> New names: #> * `` -> ...1 #> * `` -> ...2 #> * `` -> ...3 estimate_curve(X[[1]], U = seq(0, 1, length.out = 200), b = c(0.2, 0.5, 0.8), t0_list = c(0.16, 0.5, 0.83)) #> $t #> [1] 0.000000000 0.005025126 0.010050251 0.015075377 0.020100503 0.025125628 #> [7] 0.030150754 0.035175879 0.040201005 0.045226131 0.050251256 0.055276382 #> [13] 0.060301508 0.065326633 0.070351759 0.075376884 0.080402010 0.085427136 #> [19] 0.090452261 0.095477387 0.100502513 0.105527638 0.110552764 0.115577889 #> [25] 0.120603015 0.125628141 0.130653266 0.135678392 0.140703518 0.145728643 #> [31] 0.150753769 0.155778894 0.160804020 0.165829146 0.170854271 0.175879397 #> [37] 0.180904523 0.185929648 0.190954774 0.195979899 0.201005025 0.206030151 #> [43] 0.211055276 0.216080402 0.221105528 0.226130653 0.231155779 0.236180905 #> [49] 0.241206030 0.246231156 0.251256281 0.256281407 0.261306533 0.266331658 #> [55] 0.271356784 0.276381910 0.281407035 0.286432161 0.291457286 0.296482412 #> [61] 0.301507538 0.306532663 0.311557789 0.316582915 0.321608040 0.326633166 #> [67] 0.331658291 0.336683417 0.341708543 0.346733668 0.351758794 0.356783920 #> [73] 0.361809045 0.366834171 0.371859296 0.376884422 0.381909548 0.386934673 #> [79] 0.391959799 0.396984925 0.402010050 0.407035176 0.412060302 0.417085427 #> [85] 0.422110553 0.427135678 0.432160804 0.437185930 0.442211055 0.447236181 #> [91] 0.452261307 0.457286432 0.462311558 0.467336683 0.472361809 0.477386935 #> [97] 0.482412060 0.487437186 0.492462312 0.497487437 0.502512563 0.507537688 #> [103] 0.512562814 0.517587940 0.522613065 0.527638191 0.532663317 0.537688442 #> [109] 0.542713568 0.547738693 0.552763819 0.557788945 0.562814070 0.567839196 #> [115] 0.572864322 0.577889447 0.582914573 0.587939698 0.592964824 0.597989950 #> [121] 0.603015075 0.608040201 0.613065327 0.618090452 0.623115578 0.628140704 #> [127] 0.633165829 0.638190955 0.643216080 0.648241206 0.653266332 0.658291457 #> [133] 0.663316583 0.668341709 0.673366834 0.678391960 0.683417085 0.688442211 #> [139] 0.693467337 0.698492462 0.703517588 0.708542714 0.713567839 0.718592965 #> [145] 0.723618090 0.728643216 0.733668342 0.738693467 0.743718593 0.748743719 #> [151] 0.753768844 0.758793970 0.763819095 0.768844221 0.773869347 0.778894472 #> [157] 0.783919598 0.788944724 0.793969849 0.798994975 0.804020101 0.809045226 #> [163] 0.814070352 0.819095477 0.824120603 0.829145729 0.834170854 0.839195980 #> [169] 0.844221106 0.849246231 0.854271357 0.859296482 0.864321608 0.869346734 #> [175] 0.874371859 0.879396985 0.884422111 0.889447236 0.894472362 0.899497487 #> [181] 0.904522613 0.909547739 0.914572864 0.919597990 0.924623116 0.929648241 #> [187] 0.934673367 0.939698492 0.944723618 0.949748744 0.954773869 0.959798995 #> [193] 0.964824121 0.969849246 0.974874372 0.979899497 0.984924623 0.989949749 #> [199] 0.994974874 1.000000000 #> #> $x #> [1] 0.7668812 0.7613167 0.7555587 0.7495810 0.7435302 0.7379050 0.7331919 #> [8] 0.7289390 0.7252568 0.7222072 0.7197302 0.7175395 0.7155527 0.7134991 #> [15] 0.7111978 0.7086351 0.7063970 0.7040583 0.7011407 0.6979035 0.6947388 #> [22] 0.6918444 0.6888307 0.6856279 0.6821385 0.6783079 0.6746241 0.6712174 #> [29] 0.6680676 0.6651128 0.6624286 0.6600070 0.6579455 0.6568813 0.6564988 #> [36] 0.6563756 0.6561280 0.6558674 0.6560792 0.6564253 0.6567239 0.6577801 #> [43] 0.6601640 0.6637716 0.6689120 0.6756921 0.6836586 0.6927021 0.7026617 #> [50] 0.7132549 0.7240383 0.7344016 0.7444958 0.7542022 0.7631674 0.7710161 #> [57] 0.7774012 0.7821930 0.7855207 0.7873954 0.7880055 0.7876743 0.7867456 #> [64] 0.7855167 0.7842696 0.7831039 0.7820501 0.7810926 0.7803034 0.7796947 #> [71] 0.7793024 0.7791705 0.7793031 0.7798472 0.7807718 0.7820839 0.7837684 #> [78] 0.7857657 0.7879900 0.7904511 0.7931145 0.7959614 0.7989789 0.8021645 #> [85] 0.8055022 0.8089697 0.8125484 0.8162336 0.8200808 0.8241047 0.8283674 #> [92] 0.8329146 0.8377783 0.8429295 0.8483684 0.8540973 0.8601544 0.8665287 #> [99] 0.8732034 0.8801691 0.8873973 0.8944153 0.9010693 0.9073874 0.9133950 #> [106] 0.9191152 0.9245687 0.9297733 0.9347402 0.9394920 0.9440427 0.9484053 #> [113] 0.9525917 0.9566128 0.9604785 0.9641962 0.9677757 0.9712255 0.9745528 #> [120] 0.9777644 0.9808666 0.9838651 0.9867637 0.9895666 0.9922810 0.9949113 #> [127] 0.9974617 0.9999360 1.0023378 1.0046704 1.0069319 1.0091305 1.0112689 #> [134] 1.0133499 1.0153760 1.0173494 1.0192724 1.0211433 1.0229658 1.0247439 #> [141] 1.0264793 1.0281738 1.0298290 1.0314463 1.0330262 1.0345687 1.0360775 #> [148] 1.0375537 1.0389987 1.0404135 1.0417991 1.0431567 1.0444817 1.0457801 #> [155] 1.0470531 1.0483017 1.0495267 1.0507289 1.0519090 1.0530657 1.0542000 #> [162] 1.0553142 1.0564091 1.0574851 1.0585429 1.0595830 1.0615541 1.0637089 #> [169] 1.0658995 1.0681081 1.0703682 1.0727118 1.0750903 1.0775095 1.0799714 #> [176] 1.0824794 1.0850865 1.0878014 1.0905948 1.0934407 1.0963797 1.0994190 #> [183] 1.1025329 1.1057380 1.1089876 1.1121824 1.1153577 1.1185086 1.1216507 #> [190] 1.1247439 1.1277949 1.1307657 1.1337135 1.1366777 1.1396894 1.1427065 #> [197] 1.1457520 1.1487654 1.1517336 1.1546688 #>