Displaying 3 results from an estimated 3 matches for "xsamp".
Did you mean:
samp
2008 Aug 01
2
contour lines in windows device but neither in pdf nor in postscript
library(mvtnorm)
x = seq(-4,4,length=201)
xy = expand.grid(x,x)
sigma = (diag(c(1,1))+1)/2
d2 = matrix(dmvnorm(xy,sigma=sigma),201)
xsamp = rmvnorm(200,sigma=sigma)
contour(x,x,d2)
points(xsamp,col=3,pch=16)
pdf("pdftry.pdf")
contour(x,x,d2)
points(xsamp,col=3,pch=16)
dev.off()
postscript("pstry.ps")
contour(x,x,d2)
points(xsamp,col=3,pch=16)
dev.off()
# I can see contour lines in a window device but I can'...
2006 Dec 25
2
Problem to generate training data set and test data set
I have a full data set like this:
aa bas aas bms ams bcu acu omega y
1 ALA 0 127.71 0 69.99 0 -0.2498560 79.91470 outward
2 PRO 0 68.55 0 55.44 0 -0.0949008 76.60380 outward
3 ALA 0 52.72 0 47.82 0 -0.0396550 52.19970 outward
4 PHE 0 22.62 0 31.21 0 0.1270330 169.52500 inward
5 SER 0 71.32 0 52.84 0 -0.1312380 7.47528 outward
6
2006 Dec 26
1
Colored Dendrogram
...; > and 25% of observation of each levels to generate a testing set.
> >
> Hi Aimin,
> I haven't tested this exhaustively, but I think it does what you want.
>
> get.prob.sample<-function(x,prob=0.5) {
> xlevels<-levels(as.factor(x))
> xlength<-length(x)
> xsamp<-rep(FALSE,xlength)
> for(i in xlevels) {
> lengthi<-length(x[x == i])
> xsamp[sample(which(x == i),lengthi*prob)]<-TRUE
> }
> return(xsamp)
> }
>
> get.prob.sample(mydata$aa,0.75)
>
> Jim
>
>
>
> ------------------------------
>
> Messag...