Re: [Rd] An interesting chat with ChatGPT

2023-02-16 Thread Ravi Varadhan via R-devel
ChatGPT provided an R code with error when I asked a question related to prediction of a new data point for linear mixed effects model. So, it is not immune to coding mistakes! Ravi From: R-devel on behalf of Boris Steipe Sent: Monday, February 13, 2023 10:5

Re: [Rd] Use of MathJax (or something similar) in .Rd files

2020-04-30 Thread Ravi Varadhan
Thank you. This is a very useful idea! Best, Ravi From: R-devel on behalf of Viechtbauer, Wolfgang (SP) Sent: Thursday, April 30, 2020 6:59:02 AM To: r-devel Subject: Re: [Rd] Use of MathJax (or something similar) in .Rd files Thanks Gabor and Duncan! It wo

Re: [Rd] status of Java & rJava?

2020-03-28 Thread Ravi Varadhan
I, too, had encountered problems with Java on Windows 10 while I was trying to install the package "xlsx." I tried the fixes I found online, but to no avail. Thanks & Best regards, Ravi From: R-devel on behalf of Gregory Warnes Sent: Saturday, March 28, 202

Re: [Rd] unstable corner of parameter space for qbeta?

2020-03-26 Thread Ravi Varadhan
This is also strange: qbeta <- function (p, shape1, shape2, ncp = 0, lower.tail = TRUE, log.p = FALSE) { if (missing(ncp)) .Call(C_qbeta, p, shape1, shape2, lower.tail, log.p) else .Call(C_qnbeta, p, shape1, shape2, ncp, lower.tail, log.p) } Since the default value is

Re: [Rd] R optim(method="L-BFGS-B"): unexpected behavior when working with parent environments

2019-05-06 Thread Ravi Varadhan
Optim's Nelder-Mead works correctly for this example. > optim(par=10, fn=fn, method="Nelder-Mead") x=10, ret=100.02 (memory) x=11, ret=121 (calculate) x=9, ret=81 (calculate) x=8, ret=64 (calculate) x=6, ret=36 (calculate) x=4, ret=16 (calculate) x=0, ret=0 (calculate) x=-4, ret=16 (calculate) x=

Re: [Rd] diag(-1) produces weird result

2018-09-17 Thread Ravi Varadhan
It behaves as per documentation. " Using diag(x) can have unexpected effects if x is a vector that could be of length one. Use diag(x, nrow = length(x)) for consistent behavior." Ravi From: R-devel on behalf of Gábor Csárdi Sent: Monday, September 17, 2018

Re: [Rd] Searching R Packages

2018-01-28 Thread Ravi Varadhan
Hi Spencer, Thank you for this wonderful service to the R community. A suggestion: it would be great to discuss how to search github and Bioconductor repositories. Thanks, Ravi From: R-devel on behalf of Spencer Graves Sent: Saturday, January 27, 20

Re: [Rd] Wrongly converging glm()

2017-07-21 Thread Ravi Varadhan
: Friday, July 21, 2017 3:09 PM To: Ravi Varadhan Cc: Therneau, Terry M., Ph.D. ; r-devel@r-project.org; jorism...@gmail.com; westra.harm...@outlook.com Subject: Re: [Rd] Wrongly converging glm() Hi Ravi: Well said. In John's Rvmmin package, he has codes for explaining the cause of the termin

Re: [Rd] Wrongly converging glm()

2017-07-21 Thread Ravi Varadhan
Please allow me to add my 3 cents. Stopping an iterative optimization algorithm at an "appropriate" juncture is very tricky. All one can say is that the algorithm terminated because it triggered a particular stopping criterion. A good software will tell you why it stopped - i.e. the stopping

Re: [Rd] Subject: Milestone: 10000 packages on CRAN

2017-01-28 Thread Ravi Varadhan
Amazing! I join Henrik in expressing my humble gratitude to all the R and CRAN gurus like Brian Ripley, Duncan Murdoch, Luke Tierney, Martin Maechler, Uwe Ligges, Kurt Hornik, Peter Dalgaard, Simon Urbanek, and many others. Thank you & Best regards, Ravi

Re: [Rd] optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound

2016-10-09 Thread Ravi Varadhan
Spencer, Another option is to try the "lbfgs" package. Hans Werner Borchers has told me that this is a good implementation of L-BFGS. Best, Ravi From: R-devel on behalf of Spencer Graves Sent: Saturday, October 8, 2016 7:03 PM To: Mark Leeds Cc: R-devel

Re: [Rd] optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound

2016-10-08 Thread Ravi Varadhan
Have you tried "optimx" package that John Nash and I wrote? The main purpose is to be able to readily compare multiple optimizers on a particular class of problems and see which one seems to do the best. It doesn't include nloptr, but most other optimizers are there. Ravi

Re: [Rd] Milestone: 9000 packages on CRAN

2016-08-22 Thread Ravi Varadhan
Indeed! Ravi From: R-devel on behalf of Spencer Graves Sent: Monday, August 22, 2016 8:59 AM To: r-devel@r-project.org Subject: Re: [Rd] Milestone: 9000 packages on CRAN The entirety of humanity lives a little better today, because of problems

Re: [Rd] Optimization bug when byte compiling with gcc 5.3.0 on windows

2016-04-11 Thread Ravi Varadhan
all.equal.eigen() should also accommodate complex vectors, right? Ravi From: R-devel on behalf of Martin Maechler Sent: Monday, April 11, 2016 3:08 AM To: William Dunlap Cc: r-devel; Jeroen Ooms Subject: Re: [Rd] Optimization bug when byte compiling with

Re: [Rd] typo in R-exts.html section 6.9

2015-04-13 Thread Ravi Varadhan
You are correct that indefinite means an antiderivative. A definite integral has both limits specified. Technically correct terms are: proper and improper definite integrals (although improper integrals are not synonymous with, but include integrals with an infinite range). Your suggestion i

Re: [Rd] Hyper-dual numbers in R

2015-03-07 Thread Ravi Varadhan
is any interest. Thanks & Best, Ravi From: Duncan Murdoch Sent: Friday, March 6, 2015 3:31 PM To: Ravi Varadhan; r-devel@r-project.org Subject: Re: [Rd] Hyper-dual numbers in R On 06/03/2015 11:18 AM, Ravi Varadhan wrote: > Hi, > Has anyone

[Rd] Hyper-dual numbers in R

2015-03-06 Thread Ravi Varadhan
Hi, Has anyone in R core thought about providing "hyper-dual numbers" in R? Hyper-dual (HD) numbers, invented by Jeffrey Fike at Stanford, are useful for computing exact second-order derivatives (e.g., Hessian). HD numbers are extensions of complex numbers. They are like "quaternions" and have

Re: [Rd] Re R CMD check checking in development version of R

2014-08-28 Thread Ravi Varadhan
Hi, I second Bert's comment. I would like to go even farther and suggest that it would be really useful if one of the R gurus (like Simon) wrote a relatively non-technical article in the R journal on this topic of "Depends/Imports/Suggested." Someone like myself would benefit immensely. Thank

Re: [Rd] A bug in princomp(), perhaps?

2014-06-03 Thread Ravi Varadhan
Perhaps, adding Gavin's work around for a dataframe with missing values might also be useful to the documentation: princomp(na.omit(x)) Thanks, Ravi -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Ben Bolker Sent: Monday, June

Re: [Rd] A bug in princomp(), perhaps?

2014-06-03 Thread Ravi Varadhan
Thank you, Ben. Best, Ravi -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Ben Bolker Sent: Monday, June 02, 2014 8:07 PM To: r-de...@stat.math.ethz.ch Subject: Re: [Rd] A bug in princomp(), perhaps? Ben Bolker gmail.com> wri

Re: [Rd] A bug in princomp(), perhaps?

2014-05-30 Thread Ravi Varadhan
different than when a formula is provided, with regards to the NA action? It should be easy enough to remove the rows of `x’ with NAs. This is my main point. Ravi From: Gavin Simpson [mailto:ucfa...@gmail.com] Sent: Friday, May 30, 2014 10:46 AM To: Ravi Varadhan Cc: peter dalgaard; r-devel

Re: [Rd] A bug in princomp(), perhaps?

2014-05-30 Thread Ravi Varadhan
014 5:15 AM To: Ravi Varadhan Cc: r-devel@r-project.org Subject: Re: [Rd] A bug in princomp(), perhaps? It's only documented to work for princomp.formula; other methods do not know about na.action. -pd On 29 May 2014, at 22:10 , Ravi Varadhan wrote: > Hi, > It may be my misunder

[Rd] A bug in princomp(), perhaps?

2014-05-29 Thread Ravi Varadhan
Hi, It may be my misunderstanding, but it seems that the "na.action" in the princomp() function for principal components analysis does not work. Please see this simple example: u <- matrix(rnorm(75), ncol=1) v <- matrix(rnorm(20), ncol=1) x <- u%*%t(v) + matrix(rnorm(20*75),ncol=20) x[1,1] <- N

Re: [Rd] What algorithm is R using to calculate mean?

2013-07-26 Thread Ravi Varadhan
This uses the idea of Kahan's summation, if I am not mistaken. http://en.wikipedia.org/wiki/Kahan_summation_algorithm Ravi From: r-devel-boun...@r-project.org [r-devel-boun...@r-project.org] on behalf of Joshua Ulrich [josh.m.ulr...@gmail.com] Sent: Frid

Re: [Rd] Problem following an R bug fix to integrate()

2013-07-19 Thread Ravi Varadhan
This, i.e. quadrature, is another area where the "default" or "base" R functionality needs enhancement, just like the functionality for optimization. While `integrate' is good, it can be improved. Hans Werner, what routines do you use for quadrature? Best, Ravi -Original Message- Fr

Re: [Rd] eigen(symmetric=TRUE) for complex matrices

2013-06-19 Thread Ravi Varadhan
I am also able to reproduce this problem on Windows: library(eiginv) n <- 33 # problem does not arise for n <= 32 evals <- sort(rnorm(n)) system.time(A <- eiginv(evals, symmetric=TRUE)) all.equal(evals, sort(eigen(A+0i,,TRUE)$val)) cbind(evals, sort(eigen(A+0i,,TRUE)$val)) Best, Ravi >

Re: [Rd] RFC: a "safe" uniroot() function for future R

2013-05-31 Thread Ravi Varadhan
Dear Martin, I am not sure I like this idea of expanding the interval. It can have bad consequences. The best feature of uniroot is that it makes the user think about the behavior of the function. Your suggestion is in the spirit of making him unthink (if there is such a word!). Here is a ca

Re: [Rd] nobs() with glm(family="poisson")

2013-02-28 Thread Ravi Varadhan
This is getting further away from typical R-devel issues, but let me add another perspective: the `n' in BIC reflects the rate at which the information in the log-likelihood grows. Ravi -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On

Re: [Rd] Regression stars

2013-02-12 Thread Ravi Varadhan
They are "reaching for the stars". Pardon my jest, but I couldn't resist. Ravi -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Uwe Ligges Sent: Tuesday, February 12, 2013 10:01 AM To: Frank Harrell Cc: r-devel@r-project.org Sub

Re: [Rd] Regression stars

2013-02-12 Thread Ravi Varadhan
I think that we should use P < .03 (which approximates the probability of 5 consecutive heads) for assigning significance! Ravi -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Frank Harrell Sent: Tuesday, February 12, 2013 9:43

Re: [Rd] Catching errors from solve() with near-singular matrices

2012-12-12 Thread Ravi Varadhan
I am not sure that this query is appropriate for r-devel, it seems to be more appropriate for r-help. In any case, you might want to try MASS::ginv instead of solve(), if you expect ill-conditioning. Here is one possible solution: f <- function(X) { invX <- tryCatch(ginv(X,

Re: [Rd] non-differentiable evaluation points in nlminb(), follow-up of PR#15052

2012-09-28 Thread Ravi Varadhan
Can you provide a correct/sensible example that illustrates the problem? Your gradient function is wrong. So, how do you expect the algorithms to work? Why is the gradient Inf when |x| < 1.e-5? It should be 0. Here the following works fine: require(optimx) f <- function (x) { if(is.na(x)

Re: [Rd] The constant part of the log-likelihood in StructTS

2012-05-03 Thread Ravi Varadhan
Thanks, Tom, for the reply as well as to the reference to Claeskens & Hjort. Ravi From: Thomas Lumley [tlum...@uw.edu] Sent: Thursday, May 03, 2012 4:41 PM To: Mark Leeds Cc: Ravi Varadhan; r-devel@r-project.org Subject: Re: [Rd] The constant part of

Re: [Rd] The constant part of the log-likelihood in StructTS

2012-05-02 Thread Ravi Varadhan
king which model gives lower BIC value. Hadn't though about it before, have to be more careful in future when checking results from different packages etc. Jouni On Tue, May 1, 2012 at 4:51 PM, Ravi Varadhan wrote: > This is not a problem at all. The log likelihood function is a >

Re: [Rd] The constant part of the log-likelihood in StructTS

2012-05-01 Thread Ravi Varadhan
This is not a problem at all. The log likelihood function is a function of the model parameters and the data, but it is defined up to an additive arbitrary constant, i.e. L(\theta) and L(\theta) + k are completely equivalent, for any k. This does not affect model comparisons or hypothesis tests

Re: [Rd] Column(row)wise minimum and maximum

2012-04-19 Thread Ravi Varadhan
, 2012 3:57 PM To: Ravi Varadhan Cc: oliver; r-devel@r-project.org Subject: Re: [Rd] Column(row)wise minimum and maximum This is why the matrixStats package was created, cf. http://cran.r-project.org/web/packages/matrixStats/ 1. Yes, it would be nice to have them in one of the default packages. 2

Re: [Rd] Column(row)wise minimum and maximum

2012-04-19 Thread Ravi Varadhan
in other packages, but I am hoping that such basic operations would be part of "base" distribution. Ravi -Original Message- From: oliver [mailto:oli...@first.in-berlin.de] Sent: Thursday, April 19, 2012 2:34 PM To: Ravi Varadhan Cc: r-devel@r-project.org Subject: Re: [Rd] Colu

[Rd] Column(row)wise minimum and maximum

2012-04-19 Thread Ravi Varadhan
red before? Please forgive me if this has already been discussed before. Thanks, Ravi Ravi Varadhan, Ph.D. Assistant Professor The Center on Aging and Health Division of Geriatric Medicine & Gerontology Johns Hopkins University rvarad...@jhmi.edu<mailto:rvarad...@jhmi.edu> 410-502-2619

Re: [Rd] Task View on Numerical Analysis and Differential Equations

2012-03-08 Thread Ravi Varadhan
Dear Hans Werner, I like the idea overall. Nothing prevents you from doing this, but you should be committed to getting it up and running and then keeping it updated. In addition to concurring with Berend's comments, I also would like to mention that numerical analysis (NA) is an extremely bro

Re: [Rd] Conditional means and variances of a multivariate normal distribution

2012-03-04 Thread Ravi Varadhan
as "fMultivar" or "mvtnorm". Best, Ravi. From: r-devel-boun...@r-project.org [r-devel-boun...@r-project.org] on behalf of Ravi Varadhan [rvarad...@jhmi.edu] Sent: Sunday, March 04, 2012 10:32 AM To: r-devel@r-project.org Subject: [Rd] Conditional means and variances of a

[Rd] Conditional means and variances of a multivariate normal distribution

2012-03-04 Thread Ravi Varadhan
Hi, Let X = (x_1, x_2, ... , x_p) be multivariate normal with mean, mu = (mu_1, ... , mu_p) and covariance = Sigma. I was looking for an R function to compute conditional mean and conditional variance of a given subset of X given another subset of X. While this is trivially easy to do, the

Re: [Rd] Task views

2012-02-14 Thread Ravi Varadhan
A couple of (lengthier!) suggestions: "topic-area resources" or "task-oriented resources" Ravi From: r-devel-boun...@r-project.org [r-devel-boun...@r-project.org] on behalf of Patrick Burns [pbu...@pburns.seanet.com] Sent: Monday, February 13, 2012 4:32 A

Re: [Rd] An example of very slow computation

2011-08-18 Thread Ravi Varadhan
:37 PM To: Ravi Varadhan Cc: 'cbe...@tajo.ucsd.edu'; r-de...@stat.math.ethz.ch; 'nas...@uottawa.ca' Subject: Re: [Rd] An example of very slow computation On Aug 17, 2011, at 23:24 , Ravi Varadhan wrote: > A principled way to solve this system of ODEs is to use the idea of

Re: [Rd] An example of very slow computation

2011-08-17 Thread Ravi Varadhan
applies to *any* linear system of ODEs for which the eigenvalues are real (and negative). Ravi. ------- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2

Re: [Rd] An example of very slow computation

2011-08-17 Thread Ravi Varadhan
than that in "Matrix" package. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu -Origin

Re: [Rd] Improved Nelder-Mead algorithm - a potential replacement for optim's Nelder-Mead

2011-07-19 Thread Ravi Varadhan
Take a look at the `nmk' function in"dfoptim" package. Ravi. From: r-devel-boun...@r-project.org [r-devel-boun...@r-project.org] on behalf of Kellner [ralf.kell...@wiso.uni-erlangen.de] Sent: Tuesday, July 19, 2011 1:33 PM To: r-devel@r-project.org Subject

Re: [Rd] Time-machine typo

2011-05-10 Thread Ravi Varadhan
Indeed, Dirk, but realistic, I might add! BTW, I enjoyed some of the "Gaussian Facts". My favorite: It only takes Gauss 4 minutes to sing "Aleph-Null Bottles of Beer on the Wall". Best, Ravi. --- Ravi Varadhan, Ph.D.

Re: [Rd] Curry: proposed new functional programming, er, function.

2011-05-04 Thread Ravi Varadhan
Thanks, Hadley. This (i.e., different ways to prepare curry) is quite instructive to me. Best, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph

Re: [Rd] Curry: proposed new functional programming, er, function.

2011-05-04 Thread Ravi Varadhan
f(x, a=argA), lower=0, upper=2) # but this doesn't work rm(a) adaptIntegrate(function(x, argA=a) f(x, a=argA), lower=0, upper=2, a=0.2) # Use of Curry adaptIntegrate(Curry(f, a=0.2), lower=0, upper=2) Best, Ravi. --- Ravi Varadhan, Ph.D. Assist

Re: [Rd] Suggested change to integrate.Rd (was: Re: 0.5 != integrate(dnorm, 0, 20000) = 0)

2010-12-08 Thread Ravi Varadhan
nswer is any good? The simple and best solution is to understand your integrand as best as you can. I realize that this may be viewed as being too pedantic, but unfortunately, it is also the best advice. Best, Ravi. --- Ravi Varadhan, Ph.D. Assi

Re: [Rd] Competing with one's own work

2010-12-03 Thread Ravi Varadhan
"The decision about whether it belongs in a package or in base R is about who should maintain the code." Ok. I understand it now. Thanks, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and G

Re: [Rd] Competing with one's own work

2010-12-03 Thread Ravi Varadhan
the base distribution? Best, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu -Original Message- F

Re: [Rd] Competing with one's own work

2010-12-03 Thread Ravi Varadhan
have a package for constrained optimization that can handle linear/nonlinear and equality/inequality constraints. John, thanks for raising an important issue. Thanks & Best, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric

Re: [Rd] GPL and R Community Policies (Rcpp)

2010-12-02 Thread Ravi Varadhan
Best, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-proje

Re: [Rd] Wierd nlm behaviour in 2.10.1 and 2.12.0 [Sec=Unclassified]

2010-10-13 Thread Ravi Varadhan
Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: Troy Robertson Date: Wednesday, October 13, 2010 9:

Re: [Rd] Wierd nlm behaviour in 2.10.1 and 2.12.0 [Sec=Unclassified]

2010-10-13 Thread Ravi Varadhan
erM=Rates)$estimate This should work quite robustly under various R versions on different platforms. Ravi. -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Ravi Varadhan Sent: Wednesday, October 13, 2010 9:27 AM To: 'Troy R

Re: [Rd] Wierd nlm behaviour in 2.10.1 and 2.12.0 [Sec=Unclassified]

2010-10-13 Thread Ravi Varadhan
Hi Troy, I think that your problem is poorly scaled. You have variables that vary over several orders of magnitude. This means that any small changes (due to subtle differences between R versions) could cause a big difference in the convergence behavior of the algorithms. So, you are asking for

Re: [Rd] No RTFM?

2010-08-20 Thread Ravi Varadhan
I completely agree with you, John. In my view, there is no need for explicit RTFM or GLOG statements. Best, Ravi. -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of P J JAYNES Sent: Friday, August 20, 2010 4:40 PM To: kw.s...@gmai

Re: [Rd] on the optim function

2010-08-06 Thread Ravi Varadhan
Christophe, This is a good question. It is conventional that most classical optimization schemes (e.g. gradient-descent, quasi-Newton, and Newton-type) methods do not return the "iteration" counter, but they do return the number of times the gradient is computed. These two are equivalent in the s

Re: [Rd] constrained optimization

2010-07-07 Thread Ravi Varadhan
Hi Christophe, I have an algorithm for solving nonlinearly constrained optimization. It is a combination of an interior point (for inequalities) algorithm with an augmented Lagrangian (for equalities). It is coded entirely in R, and hence is a bit slow, but it seems to do the job quite robustly i

Re: [Rd] constrOptim( ): conflict between help page and code

2010-06-22 Thread Ravi Varadhan
nce between the "old" and "new" versions of `constrOptim'. Best, Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins Univ

Re: [Rd] constrOptim( ): conflict between help page and code

2010-06-17 Thread Ravi Varadhan
ing: if (obj > obj.old * sign(mu)) break Ravi. -Original Message- From: Ravi Varadhan [mailto:rvarad...@jhmi.edu] Sent: Thursday, June 17, 2010 10:55 AM To: 'Ravi Varadhan'; 'Duncan Murdoch'; 'John Nolan' Cc: 'r-devel@r-project.org' Subject: RE:

Re: [Rd] constrOptim( ): conflict between help page and code

2010-06-17 Thread Ravi Varadhan
d. It would be desirable if Tom Lumley can commit these changes to constrOptim. In the meanwhile, I can send the function with these upgrades to anyone who is interested. Best, Ravi. -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On

Re: [Rd] constrOptim( ): conflict between help page and code

2010-06-17 Thread Ravi Varadhan
Nolan, You are correct that there is inconsistency. The feasible region should be ui %*% theta - ci > 0, so that log(ui %*% theta - ci) is defined. There is a more serious problem in termination criterion for iterations: if (is.finite(r) && is.finite(r.old) && abs(r - r.old)/(outer.eps

[Rd] Documentation of biplot for princomp

2010-05-31 Thread Ravi Varadhan
ntation does not seem to be consistent with the implementation. Am I missing something here? Thanks & Best, Ravi. -- Ravi Varadhan, Ph.D. Assistant Professor, Center on Aging and Health, Johns Hopkins University School of Medi

Re: [Rd] Improved Nelder-Mead algorithm - a potential replacement for optim's Nelder-Mead

2010-03-06 Thread Ravi Varadhan
algorithm will get lost in a sea of 2200+ packages. Best regards, Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 ema

[Rd] Improved Nelder-Mead algorithm - a potential replacement for optim's Nelder-Mead

2010-03-05 Thread Ravi Varadhan
d into C (I am not proficient in C). Best, Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.

Re: [Rd] lower.tail option in pnorm

2009-12-08 Thread Ravi Varadhan
orm(Xb)), log(1 - pnorm(Xb))) ans2 <- apply(cbind(Xb, Resp), 1, function(x) pnorm(x[1], lower.tail=x[2], log.p=TRUE)) all.equal(ans1, as.numeric(ans2)) Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriat

Re: [Rd] bug in '...' of constrOptim (PR#14071)

2009-11-18 Thread Ravi Varadhan
written an extension of constrOptim that can use numerical gradients, and can also handle nonlinear constraints. Hope this helps, Ravi. ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health D

Re: [Rd] bug in '...' of constrOptim (PR#14071)

2009-11-18 Thread Ravi Varadhan
ntrol' argument. So, apart from `control' and `hessian' you cannot pass any other argument to optim. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Ge

Re: [Rd] Buglet in optim() SANN

2009-10-26 Thread Ravi Varadhan
d be forewarned. Best, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410) 614-9625 Email: rvarad...@jhmi.edu

Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)

2009-08-06 Thread Ravi Varadhan
difference scheme. Thanks very much to all, especially to, Martin Maechler. Best, Ravi. -Original Message- From: Martin Maechler [mailto:maech...@stat.math.ethz.ch] Sent: Wednesday, August 05, 2009 3:35 AM To: John Nolan Cc: Ravi Varadhan; hwborch...@googlemail.com; r-de...@stat.math.ethz.

Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)

2009-08-05 Thread Ravi Varadhan
ards, Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: John Nolan Date: Tuesday, Augu

Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)

2009-08-04 Thread Ravi Varadhan
rs if this fascinating idea of "complex-step derivative" could not be implemented in R. Thanks, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric

Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)

2009-08-04 Thread Ravi Varadhan
e. Thank you. Best regards, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410) 614-9625 Email: rvarad...@jhmi

[Rd] Inaccurate complex arithmetic of R (Matlab is accurate)

2009-08-03 Thread Ravi Varadhan
step gradient drastically. Hans and I were wondering if there is a way to obtain accurate "small" imaginary part for complex arithmetic. I am using Windows XP operating system. Thanks for taking a look at this. Best regards, Ravi. ______

[Rd] Homotopy package in R - Developmental help needed. Was: RE: [R] newtons method

2009-05-14 Thread Ravi Varadhan
ve to get help from you and anyone else on translating HOMPACK into an R package. If you or anyone else is interested, please send me an email. Best, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Cent

Re: [Rd] Adding a Matrix Exponentiation Operator

2008-04-11 Thread Ravi Varadhan
ld this be of interest to the R group? Best, Ravi. ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410

Re: [Rd] multiplying multidimensional arrays (was: Re: [R] Manipulation involving arrays)

2006-07-17 Thread RAVI VARADHAN
; > I suggest that %*% be so extended to multidimensional arrays. Note > that this is upwardly compatible and all existing cases would continue > to work unchanged. > > On 7/16/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > > The double loop is the same as: > &