[R] Efficient testing for +ve definiteness
Dear R-users, Is there a preferred method for testing whether a real symmetric matrix is positive definite? [modulo machine rounding errors.] The obvious way of computing eigenvalues via E - eigen(A, symmetric=T, only.values=T)$values and returning the result of !any(E = 0) seems less efficient than going through the LU decomposition invoked in determinant.matrix(A) and checking the sign and (log) modulus of the determinant. I suppose this has to do with the underlying C routines. Any thoughts or anecdotes? Many Thanks, Makram Talih -- Makram Talih, Ph.D. Assistant Professor Department of Mathematics and Statistics Hunter College of the City University of New York 695 Park Avenue, Room 905 HE New York, NY 10021 Website: http://stat.hunter.cuny.edu/talih E-mail: [EMAIL PROTECTED] Tel: 212-772-5308 Fax: 212-772-4858 __ 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] trouble with cumsum?
Dear R users, I am using R version 2.0.1 (2004/11/15) on an i386-pc-mingw32 platform. I encounter the following problem while using cumsum: a - rep(0.01, 100) b - cumsum(a) sum(a) == 1 [1] TRUE b[100] == 1 [1] FALSE Am I missing something? Should cumsum have such an outcome? Thanks in advance for any clarifications any of you can offer. Regards, Makram Talih -- Makram Talih, Ph.D. Assistant Professor Department of Mathematics and Statistics Hunter College of the City University of New York 695 Park Avenue, Room 905 HE New York, NY 10021 Website: http://stat.hunter.cuny.edu/talih E-mail: [EMAIL PROTECTED] Tel: 212-772-5308 Fax: 212-772-4858 __ 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] NULL object, R programming
Dear R users, I get the following (I think puzzling) result when doing the following: a - list(3,4,5) a[[2]] - NULL a [[1]] [1] 3 [[2]] [1] 5 I would have expected the result to be: [[1]] [1] 3 [[2]] NULL [[3]] [1] 4 as in the outcome of: list(3, NULL, 4) Is this a desired effect? If so, could it be built in a 'help(NULL)' file? If you think it is relevant, I am using the following R version: platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major1 minor6.2 year 2003 month01 day 10 language R Many thanks for any clarifications regarding this! Regards, Makram Talih Yale University Statistics __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help