search for: randz

Displaying 5 results from an estimated 5 matches for "randz".

Did you mean: rand
2012 May 06
2
Saving a variable
Hi all, I´m trying to use write function to save the output of a program (my constructed "H" matrix) randz<-matrix(rnorm(1000000),500,2000) H<-matrix(0,500,2000) H[1,]<-randz[1,] for (j in 1:2000){ for (i in 2:500){ if(i<251) H[i,j]<-0.6*H[i-1,j]+randz[i,j] else H[i,j]<-H[i-1,j]+randz[i,j] }} write(H, file = "datad.txt",2000) If I ommit the 2000 on write function it on...
2012 May 05
2
No error message no display output
Hi all, I´m re-starting (as my name indicates) my little knowlegde of CRAN R. I made this function time before but I don´t know where is the error because nothing appears as an error but the histogram plot doesn´t appear. Should I install some special library to run sapply? pru<-function(){ randz<-matrix(rnorm(200000),100,2000) H<-matrix(0,100,2000) for (j in 2:2000){ for (i in 2:100){ H[1,]<-randz[1,] H[i,j]<-H[i-1,j]+randz[i,j] }} hy<-nrow(H)-1 estima<-H[2:nrow(H),] estima2<-H[1:hy,] a<-estima b<-estima2 mycoef <- function(x, y) coefficients( lm(y...
2012 May 10
1
Error t value matrix
...al matrix called "t value" should include al the t values on the regression each of them incorporating a new observation, with the same rows and colums than "estima". I have tried several thing but I cannot achive. I writte to see if you can guide me¡¡¡ I swear I´m trying. randz<-matrix(rnorm(5000),50,100) H<-matrix(0,50,100) H[1,]<-randz[1,] for (i in 2:50){ if(i < 26) { H[i, ] <- 0.6 * H[i-1, ] + randz[i, ] } else { H[i, ] <- H[i-1, ] + randz[i, ] } } write.table(H, file = "datad.txt") g<-read.table("datad.txt") hy&l...
2009 Jul 16
3
rnorm
Hi I want to simulate random numbers normal distributed with this size (2000,10000). I tried this but my computer exhaust there is a fast way to make it? randz<-matrix(rnorm(2000000),2000,10000) [[alternative HTML version deleted]]
2009 Jul 21
3
writte file doubt
Hi I wrotte this function but when I get the "tmp.xls" file it shows data in a rare way. I mean not appears a matrix with 2000 rows and 100 columns. Can anyone help me, guide me? kim<-function(){ tmp<-randz<-matrix(rnorm(200000, mean=0,sd=0.01 ),2000,100); dim(tmp) write(tmp,file="tmp.xls") Thanks in advance. On the other hand, everytime I execute a function that is locatd in my documents I must open it source(file.choose()) , there is a folder where to put my function to not neces...