This commit is contained in:
Pierre-Edouard Portier 2023-01-17 00:17:21 +01:00
parent 2b5075787d
commit 1d0386b45d
1 changed files with 25 additions and 0 deletions

25
pad.R
View File

@ -25,3 +25,28 @@
# adj = 0, cex = 0.6)
# points(0, 0, pch = 3)
# ```
source("01_intro_code.R")
source("04_validation_croisee_code.R")
set.seed(1123)
n <- 100
data = gendat(n,0.2)
splitres <- splitdata(data,0.8)
entr <- splitres$entr
test <- splitres$test
# K11 <- gausskernel(as.matrix(X[splidx,]), sigma2)
#
# K21 <- matrix(nrow = n-nspl, ncol = nspl)
# for(i in 1:(n-nspl))
# for(j in 1:nspl)
# K21[i,j] <- sum(X[notsplidx[i],] - X[splidx[j],])^2
# K21 <- exp(-1*K21/sigma2)
source("19_nystroem_approximation_code.R")
krm <- nakrr(entr$X, entr$Y, nspl=15)
yh <- predict(krm,test$X)
plt(test,f)
points(test$X, yh, pch=4)
# coef2 <- coef[order(strtoi(rownames(coef)))]