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
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
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
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
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=
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
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
: 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
>
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
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
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
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
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,
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)
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
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
>
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
, 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
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
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
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
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
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
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
: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
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
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
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
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.
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
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
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
"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
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
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
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
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:
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
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
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
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
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
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
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:
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
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
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
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
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.
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
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
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
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
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.
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
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
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
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.
______
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
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
;
> 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:
> &
79 matches
Mail list logo