Re: [R] Dickey Fuller Test

2010-10-29 Thread Cuckovic Paik
Thanks a lot for your answers, Dennis and Bernhard! -- View this message in context: http://r.789695.n4.nabble.com/Dickey-Fuller-Test-tp3018408p3019544.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing lis

[R] Dickey Fuller Test

2010-10-28 Thread Cuckovic Paik
Dear Users, please help with the following DF test: = library(tseries) library(timeSeries) Y=c(3519,3803,4332,4251,4661,4811,4448,4451,4343,4067,4001,3934,3652,3768 ,4082,4101,4628,4898,4476,4728,4458,4004,4095,4056,3641,3966,4417,4367 ,4821,5190,4638,4904,4528,4383,4339,4327,3856,4072,4563,4

Re: [R] How to print matrices in standard format was ... Re: How to define new matrix based on an elementary row oper

2010-09-12 Thread Cuckovic Paik
Thanks David. grid graphic works pretty well. -- View this message in context: http://r.789695.n4.nabble.com/How-to-define-new-matrix-based-on-an-elementary-row-operation-in-a-single-step-tp2341768p2536785.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] How to define new matrix based on an elementary row oper

2010-09-12 Thread Cuckovic Paik
I appreciate all you help. This is only for instructional purpose: A = matrix(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19), ncol=5, byrow=T) B =matrix(sample(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19),), ncol=5, byrow=T) Which print func( A, B, A+B) can print the resulting m

Re: [R] binomial distribution

2010-08-28 Thread Cuckovic Paik
try: ?pbinom -- View this message in context: http://r.789695.n4.nabble.com/binomial-distribution-tp2398568p2398705.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

Re: [R] How to define new matrix based on an elementary row oper

2010-08-28 Thread Cuckovic Paik
Thank you very much, David; for row swapping: R2<==>R3 > A=diag(1:4) > A [,1] [,2] [,3] [,4] [1,]1000 [2,]0200 [3,]0030 [4,]0004 > A1=A[c(1,3,2,4),] > A1 [,1] [,2] [,3] [,4] [1,]1000 [2,]0030

Re: [R] How to define new matrix based on an elementary row operation in a single step?

2010-08-28 Thread Cuckovic Paik
Thank all help help. Ted's intuitive single step definition is what I want. I try to teach elementary Linear Algebra using R to manupilate matrices. Since my students have no programming experience at all, any fancy and muliple step definition in matrix row operation will confuse them. Again, I a

Re: [R] How to define new matrix based on an elementary row operation in a single step?

2010-08-27 Thread Cuckovic Paik
Thanks for respose. you still used two steps to get the new matrix tst2: step 1: tst2 = tst step 2: perform the row operation in tst2. Can you do this in a single step? A similar example: > tst [,1] [,2] [,3] [,4] [1,]159 13 [2,]26 10 14 [3,]37 11

Re: [R] Scatterplot question

2010-08-27 Thread Cuckovic Paik
Is this what you want? x=rnorm(10) y1=0.5*rnorm(10)+0.5*rexp(10) y2=0.5*rnorm(10)+0.5*runif(10) xlimit=range(x) ylimit=range(c(y1,y2)) plot(x,y1,pch="1",col=2,xlim=xlimit, ylim=ylimit, ylab="Y", xlab="X", cex=0.7) points(x,y2,pch="2", col=4,cex=0.7) -- View this message in context: http://r.7

[R] How to define new matrix based on an elementary row operation in a single step?

2010-08-27 Thread Cuckovic Paik
-- View this message in context: http://r.789695.n4.nabble.com/How-to-define-new-matrix-based-on-an-elementary-row-operation-in-a-single-step-tp2341768p2341768.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mail

Re: [R] Memory Issue

2010-08-24 Thread Cuckovic Paik
Thanks for constrctive comments. I was very careful when I wrote the code. I wrote many functions and then wrapped up to get a single function. Originally, I used optim() to get MLE, it was at least 10 times slower than the code based on Newton method. I also vectorized all objects whenever possib

[R] Memory Issue

2010-08-23 Thread Cuckovic Paik
Dear All, I have an issue on memory use in R programming. Here is the brief story: I want to simulate the power of a nonparameteric test and compare it with the existing tests. The basic steps are 1. I need to use Newton method to obtain the nonparametric MLE that involves the inversion of a l