Re: [R] Help with Matrix package
Thanks Prof. Ripley for your prompt reply. With regards to Rblas.dll my current situation is that I have taken the Rblas.dll from CRAN: contrib/ATLAS/P4/, and replaced the default Rblas.dll in my R /bin with this one. Cheers, Rob. -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: 13 October 2005 11:33 To: rob foxall (IFR) Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Help with Matrix package The first thing is to ensure that you are using an optimized BLAS. On Windows, use Goto's BLAS if you have it (is not currently available and redistribution is not allowed) or one of the pre-built ATLAS-based Rblas.dll on CRAN or (best of all) optimize your own build of ATLAS. The Matrix package depends on an optimized BLAS even more crucially than base R. On Thu, 13 Oct 2005, rob foxall (IFR) wrote: > Hello all, > A colleague at work set me the challenge to convert some MATLAB > code into R, to see which is faster. We'd seen that benchmark comparing > MATLAB 6.5 to R1.90 (and others), and so I thought that I should be able > to get roughly comparable speeds. The code has lots of multiplications > of matrixes, transposes, and MATLAB's "repmat". I did the code > conversion, and R was about 6 times slower, so I had a closer look at > the benchmark comparison and it seems that I should be using the > "Matrix" package. > Is there any dummies-level help available for this package? I am > struggling even to apply simple functions such as "sum" and "mean" to > matrixes constructed from this class (not that I need to yet), and more > importantly "kronecker", to convert from "repmat". (The help for > "kronecker" from the Matrix package doesn't seem to mention kronecker, > so I am a bit stuck). Any guidance greatly accepted -- I have read the > overview, looked through the various Matrix-listed functions, and > unsuccessfully tried searching R-help. > > Using R version 2.2.0, windows xp. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Help with Matrix package
Hello all, A colleague at work set me the challenge to convert some MATLAB code into R, to see which is faster. We'd seen that benchmark comparing MATLAB 6.5 to R1.90 (and others), and so I thought that I should be able to get roughly comparable speeds. The code has lots of multiplications of matrixes, transposes, and MATLAB's "repmat". I did the code conversion, and R was about 6 times slower, so I had a closer look at the benchmark comparison and it seems that I should be using the "Matrix" package. Is there any dummies-level help available for this package? I am struggling even to apply simple functions such as "sum" and "mean" to matrixes constructed from this class (not that I need to yet), and more importantly "kronecker", to convert from "repmat". (The help for "kronecker" from the Matrix package doesn't seem to mention kronecker, so I am a bit stuck). Any guidance greatly accepted -- I have read the overview, looked through the various Matrix-listed functions, and unsuccessfully tried searching R-help. Using R version 2.2.0, windows xp. Cheers, Rob. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] lda predict
Dear R-helpers, I have a model created by lda, and I would like to use this model to make predictions for new or old data. The catch is, I want to do this without using the "predict" function, i.e. only using information directly from the foo.lda object to create my posterior probabilities. In anticipation of likely responses, I will be brushing up my lda knowledge using the given references when I have time, but am being hassled for an answer asap! Cheers, Rob. [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] anova subhypotheses
Hello all, A really noddy question for you all: I'm trying without success to do some subhypothesis testing. Using simple anova model, with a toy dataset from a book. I have four factors A,B,C,D, and wish to test mu_C = mu_D. This is what I have tried: > contrasts(infants$group,how.many=1) <- c(0,0,1,-1) > contrasts(infants$group) [,1] A0 B0 C1 D -1 > fit <- aov(age~group,data=infants) > summary(fit) Df Sum Sq Mean Sq F value Pr(>F) group1 0.740 0.740 0.2693 0.6092 Residuals 21 57.727 2.749 Now I know from the book, hand calculations and SPSS that for "group", Sum Sq = Mean Sq = 1.12, not 0.740. Also from the standard anova: > contrasts(infants$group) <- "contr.treatment" > fit <- aov(age~group,data=infants) > summary(fit) Df Sum Sq Mean Sq F value Pr(>F) group3 14.778 4.926 2.1422 0.1285 Residuals 19 43.690 2.299 So I'd like to have the (correct) Mean Sq value divided by 2.299 and not 2.749, with 19 and not 21 df. Any advice on how to correctly use contrasts for subhypothesis testing, including where to find it in the manuals, would be much appreciated. Cheers, Rob. (Other info) Using R 1.6.2, windows xp, data: > infants group age 1 A 9.00 2 A 9.50 3 A 9.75 4 A 10.00 5 A 13.00 6 A 9.50 7 B 11.00 8 B 10.00 9 B 10.00 10 B 11.75 11 B 10.50 12 B 15.00 13 C 11.50 14 C 12.00 15 C 9.00 16 C 11.50 17 C 13.25 18 C 13.00 19 D 13.25 20 D 11.50 21 D 12.00 22 D 13.50 23 D 11.50 [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] cat in windows vs linux
Hi all, Easy question for you (which I failed to find the answer to in the FAQ etc). I've recently been forced to switch from linux to windows (currently windows NT), and my usual habit of putting lots of "cat" statements in slow functions to get an idea of the progress rate is no longer useful. Why -- because R waits until the function is completely finished before printing the cat statements all at once to the screen. Don't know if this is an R thing or a windows thing, but if there is a way to get cat statements printed to the screen as soon as the function calls it, I'd like to hear it! Using R version 1.6.2. Cheers, Rob. __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help