X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=.Rhistory;fp=.Rhistory;h=6616dbe0fcc95e8cd68c1b6e45c962ab88f4ce4d;hb=f227455a1604906b255ef366d64c10a93e796983;hp=0000000000000000000000000000000000000000;hpb=d4304982ed571d445017bb7daa031dd9fb453b41;p=valse.git diff --git a/.Rhistory b/.Rhistory new file mode 100644 index 0000000..6616dbe --- /dev/null +++ b/.Rhistory @@ -0,0 +1,512 @@ +lines(1:15, rep(0,15), col='red') +N = 300 +mugamma = c(1,2,3) +Gamma = matrix(c(5,-0.02,0.01,-0.02,1,0.1,0.01,0.1,1),3,3) +s2 = 0.01 +Si = getbasismatrix(seq(0,1,length=15),create.fourier.basis(nbasis = 3)) +gammai = t(sapply(1:N,FUN = function(i){ +rmvnorm(1,mugamma,Gamma) +})) +Xdata = t(sapply(1:N,FUN = function(i){ +as.vector(Si%*%gammai[i,])+rnorm(15,0,s2) +})) +matplot(t(Xdata),type="l") +#beta = c(.1,.5,-.3) +beta = c(1,-3.5,4.5,-2.5) +pydata = sapply(1:N,FUN=function(i){ +a = sum(beta*c(1,gammai[i,])) +return(exp(a)/(1+exp(a))) +}) +U = runif(length(pydata)) +ydata = as.numeric(U