Hi,
You can use the projectLinear argument in BB::spg to optimize with linear
equality/inequality constraints.
Here is how you implement the constraint that all parameters sum to 1.
require(BB)
spg(par=p0, fn=myFn, project="projectLinear", projectArgs=list(A=matrix(1, 1,
length(p0)), b=1,
vect)), b=1, meq=1)))
Ravi
____
From: Ravi Varadhan
Sent: Saturday, May 5, 2018 12:31 PM
To: m.ash...@enduringinvestments.com; r-help@r-project.org
Subject: adding overall constraint in optim()
Hi,
You can use the projectLinear argument in BB::spg to optimize with linear
If AIC is giving you a model that is too large, then use BIC (log(n) as the
penalty for adding a term in the model). This will yield a more parsimonious
model. Now, if you ask me which is the better option, I have to refer you to
the huge literature on model selection.
Best,
Ravi
[[
More principled would be to use a lasso-type approach, which combines selection
and estimation in one fell swoop!
Ravi
From: Ravi Varadhan
Sent: Tuesday, June 6, 2017 10:16 AM
To: r-help@r-project.org
Subject: Subject: [R] glm and stepAIC selects too many
Hi,
Take a look at the package "ic.infer" by Ulrike Gromping.
https://www.jstatsoft.org/article/view/v033i10
Best,
Ravi
Ravi Varadhan, Ph.D. (Biostatistics), Ph.D. (Environmental Engg)
Associate Professor, Department of Oncology
Division of Biostatistics & Bionformatics
verge when you set a small tolerance
for convergence. You may fiddle with the control options for EM algorithm and
see if you can get convergence. If not, you should contact the package authors.
Hope this is helpful,
Ravi
Ravi Varadhan, Ph.D. (Biostatistics), Ph.D. (Environmental Engg)
Associate Pr
Hi,
Ramanujan supposedly discovered that the number, 163, has this interesting
property that exp(sqrt(163)*pi), which is obviously a transcendental number, is
real close to an integer (close to 10^(-12)).
If I compute this using the Wolfram alpha engine, I get:
262537412640768743.25
matters in Rmpfr. Even if it does, the
answer you get is still wrong as you showed.
Thanks,
Ravi
-Original Message-
From: Richard M. Heiberger [mailto:r...@temple.edu]
Sent: Thursday, July 02, 2015 6:30 PM
To: Aditya Singh
Cc: Ravi Varadhan; r-help
Subject: Re: [R] : Ramanujan and the
120), then all the constants, 163, pi, are automatically
of 120 bits precision.
Is this easy to do?
Best,
Ravi
From: David Winsemius
Sent: Friday, July 3, 2015 2:06 PM
To: John Nash
Cc: r-help; Ravi Varadhan
Subject: Re: [R] : Ramanujan and the accuracy o
What about numeric constants, like `163'?
eval(Pre(exp(sqrt(163)*pi), 120))does not work.
Thanks,
Ravi
From: David Winsemius
Sent: Saturday, July 4, 2015 1:12 PM
To: Duncan Murdoch
Cc: r-help; John Nash; Ravi Varadhan
Subject: Re: [R] : Rama
Hi,
You can try a projected gradient approach, which is implemented in the spg()
function in the "BB" package. You have to provide a projection function which
will take an infeasible matrix as input and will give a feasible (i.e.
positive-definite) matrix as output. This kind of matrix projecti
Hi,
I tried your problem with optimx package. I found a better solution than that
found by mle2.
?library(optimx)
# the objective function needs to be re-written
LL2 <- function(par,y) {
lambda <- par[1]
alpha <- par[2]
beta <- par[3]
R = Nweibull(y,lambda,alpha,beta)
-sum(log(R))
}
lems and it is quite difficult to know
a priori which one would be the best for "my" problem. Thus, the benchmarking
capability provided by optimx is a powerful feature.
Ravi
From: Ben Bolker
Sent: Thursday, January 15, 2015 9:29 AM
To: Rav
Hi,
I have a fairly elementary problem that I am unable to figure out. I have a
continuous variable, Y, repeatedly measured at multiple times, T. The variable
T is however is coded as a factor variable having these levels: c("Presurgery",
"Day 30", "Day 60", "Day 180", "Day 365").
When I plot
Thursday, January 22, 2015 10:29 AM
To: Bert Gunter
Cc: William Dunlap; r-help@r-project.org; Ravi Varadhan
Subject: Re: [R] Re-order levels of a categorical (factor) variable
>>>>> Bert Gunter
>>>>> on Wed, 21 Jan 2015 18:52:12 -0800 writes:
> Bill/Rav
Hi,
I would like to run lme() on a number of response variables in a dataframe in
an automatic manner. Bu, when I use eval(parse(text=yname)) to denote the LHS
of the formula in lme(), I get the following error message:
> require(nlme)
> mod2 <- with(subset(labdata2, Transplant_type!=0 &
)
dd <- subset(labdata2, Transplant_type!=0 & time >0)
lme(ff, random=~1|Patient, data=dd, correlation=corAR1(), na.action=na.omit)
Best,
Ravi
Ravi Varadhan, Ph.D. (Biostatistics), Ph.D. (Environmental Engg)
Associate Professor
Department of Oncology
Division of Biostatistics & Bionfor
Yes, this is a very important point. Thank you, Bill.
Best,
Ravi
From: William Dunlap
Sent: Friday, February 13, 2015 4:56 PM
To: Ravi Varadhan
Cc: r-h...@stat.math.ethz.ch
Subject: Re: [R] Unable to use `eval(parse(text))' in nlme::lme
> ff <-
Harold,
Obviously the bottleneck is your objective function fn(). I have speeded up
your function by a factor of about 2.4 by using `outer' instead of sapply. I
think it can be speeded much more. I couldn't figure it out without spending a
lot of time. I am sure someone on this list-serv
Hi,
I would like to compute: A %*% B %*% t(A)
A is a mxn matrix and B is an nxn symmetric, positive-definite matrix, where m
is large relative to n (e.g., m=50,000 and n=100).
Here is a sample code.
M <- 1
N <- 100
A <- matrix(rnorm(M*N), M, N)
B <- crossprod(matrix(rnorm(N*N), N
Hi Ista,
Thank you for the response. I use Windows. Is there a pre-compiled version of
openBLAS for windows that would make it easy for me to use it?
Thanks,
Ravi
-Original Message-
From: Ista Zahn
Sent: Friday, August 10, 2018 12:20 PM
To: Ravi Varadhan
Cc: r-help@r-project.org
Does Microsoft open R come with pre-compiled BLAS that is optimized for matrix
computations?
Thanks,
Ravi
-Original Message-
From: Ista Zahn
Sent: Monday, August 13, 2018 3:18 PM
To: Ravi Varadhan
Cc: r-help@r-project.org
Subject: Re: [R] Fast matrix multiplication
On Mon, Aug 13
In solve.QP(), you don't need to expand the equality into two inequalities. It
can DIRECTLY handle the equality constraints. The first `meq' rows of the
constraint matrix are equality constraints. Here is the excerpt from the
documentation.
meq
the first meq constraints are treated as equali
nction(x, LAI) {
h <- rep(NA, 2)
h[1] <- LAI^x[2] / x[3] + x[1]
h[2] <- 1 - x[1] - LAI^x[2] / x[3]
h
}
Please take a look at the help page. If it is still not clear, you can contact
me offline.
Best,
Ravi
Ravi Varadhan, Ph.D. (Biostatistics), Ph.D. (Environmental Engg)
Associate Profess
2015 3:37 AM
To: Ravi Varadhan
Cc: 'r-help@r-project.org'
Subject: Re: optimizing with non-linear constraints
Ravi Varadhan writes:
> Hi Rainer,
> It is very simple to specify the constraints (linear or nonlinear) in
> "alabama" . They are specified in a function
esday, October 6, 2015 9:20 AM
To: Ravi Varadhan
Cc: 'r-help@r-project.org'
Subject: Bug in auglag?
Hi Ravi,
I would like come back to your offer. I have a problem which possibly is
caused by a bug or by something I don't understand:
My function to be minimised is executed even when an
ered. Any suggestions?
Thank you,
Ravi
Ravi Varadhan, Ph.D. (Biostatistics), Ph.D. (Environmental Engg)
Associate Professor, Department of Oncology
Division of Biostatistics & Bionformatics
Sidney Kimmel Comprehensive Cancer Center
Johns Hopkins University
550 N. Broadway, Suite -E
Baltimore
: Ravi Varadhan; r-help@r-project.org
Subject: Re: [R] Linear regression with a rounded response variable
> On 21 Oct 2015, at 19:57 , Charles C. Berry wrote:
>
> On Wed, 21 Oct 2015, Ravi Varadhan wrote:
>
>> [snippage]
>
> If half the subjects have a value of 5 second
HS? In addition,
is there a better paradigm for doing these type of series of regressions in an
automatic fashion?
Thank you very much,
Ravi
Ravi Varadhan, Ph.D. (Biostatistics), Ph.D. (Environmental Engg)
Associate Professor, Department of Oncology
Division of Biostatistics & Bi
ail.com]
Sent: Tuesday, October 27, 2015 1:50 PM
To: Ravi Varadhan
Cc: r-help@r-project.org
Subject: Re: [R] How to get variable name while doing series of regressions in
an automated manner?
Marc,Ravi:
I may misunderstand, but I think Marc's solution labels the list components but
not nece
t can still happen).
I would strongly suggest that when you are doing simulations, you should
encapsulate the parameter estimation inside a `try' or `tryCatch' statement so
that when there is an error, the simulation keeps going rather than crashing
out.
See the attached code.
Best,
Ravi
It seems like there is substantial finite-sample bias in the MLEs. Either that
or there is some error in your procedure. See attached code.
Ravi
From: Ravi Varadhan
Sent: Wednesday, November 11, 2015 2:33 PM
To: 'denizozo...@gazi.edu.tr' ; r-help@r-project.org
Cc: 'profj
Hi,
While I agree with the comments about paying attention to parameter scaling, a
major issue here is that the default optimization algorithm, Nelder-Mead, is
not very good. It is unfortunate that the optim implementation chose this as
the "default" algorithm. I have several instances wher
mentations of Nelder-Mead.
Best regards,
Ravi
From: ProfJCNash
Sent: Sunday, November 15, 2015 12:21 PM
To: Ravi Varadhan; 'r-help@r-project.org'; lorenzo.ise...@gmail.com
Cc: b...@xs4all.nl; Gabor Grothendieck
Subject: Re: Cautioning optim() user
_percent_of_CD4" and "Fr_II_percent_of_CD4".
How can I use grep() to do this?
More generally, are there any good online resources with examples like this for
the use of grep() and regexp() in R? I didn't find the help pages for these
very user-friendly.
Thank you very
05)
Hope this is helpful,
Ravi
Ravi Varadhan, Ph.D. (Biostatistics), Ph.D. (Environmental Engg)
Associate Professor, Department of Oncology
Division of Biostatistics & Bionformatics
Sidney Kimmel Comprehensive Cancer Center
Johns Hopkins University
550 N. Broadway, Suite -E
Baltimore, MD
te(fun, -Inf, t, nu=nu, exi=exi)$value
return(res)
}
uniroot(myroot, c(-2, 2), nu=2, exi=0.5, alpha=.05)
Ravi
From: Ravi Varadhan
Sent: Friday, January 08, 2016 11:29 AM
To: r-help@r-project.org; 'sstol...@gmail.com'
Subject: Re: Solve an equation including integral
I think t
. Does anyone know of this or
worked with this data set? If so, can someone share it with me?
Thank you very much.
Best,
Ravi
Ravi Varadhan, Ph.D. (Biostatistics), Ph.D. (Environmental Engg)
Associate Professor, Department of Oncology
Division of Biostatistics & Bionformatics
Sidney Ki
6, 63, 59, 62, 60)
# note: there is no need to have the choose(n, y) term in the likelihood
fn <- function(p)
sum( - (y*(p[1]+p[2]*x) - n*log(1+exp(p[1]+p[2]*x))) )
out <- nlm(fn, p = c(-50,20), hessian = TRUE)
out
eigen(out$hessian)
Hope this is helpful,
Ravi
Ravi Varadhan, Ph.D.
Standard error = sqrt(diag(solve(opt$hessian)))
Ravi
From: Alaa Sindi [mailto:alaasi...@icloud.com]
Sent: Wednesday, March 02, 2016 3:22 PM
To: Ravi Varadhan
Cc: r-help@r-project.org
Subject: Re: help in maximum likelihood
Thank you very much prof. Ravi,
That was very helpful. Is there a way
Also take a look at the package "BB" for solving nonlinear systems.
Ravi.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Berend Hasselman
Sent: Saturday, July 19, 2008 7:45 AM
To: r-help@r-project.org
Subject: Re: [R] How to solve systems of nonlinear eq
Hi,
Here is one way you can locate the peaks and troughs of a smoothed function
estimate (using the example data from smooth.spline() demo):
##-- example from smooth.spline()
y18 <- c(1:3,5,4,7:3,2*(2:5),rep(10,4))
xx <- seq(1,length(y18), len=201)
s2 <- smooth.spline(y18) # GCV
d1 <- pred
Hessian may not even exist in a constrained optimization problem, for
example, when the solution is on the boundary of the feasible region. If
your solution is on the interior, you can use the hessian() function in
"numDeriv" package.
Ravi.
-Original Message-
From: [EMAIL PROTECTED] [mai
Hi Shubaa,
Here is one way to do this:
is.between <- function(x, a, b) {
x > a & x < b
}
set.seed(123)
x <- rnorm(5)
is.between(x, -1, 1)
> is.between(x, -1, 1)
[1] TRUE TRUE FALSE TRUE TRUE
>
Ravi.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behal
: Tuesday, August 12, 2008 9:46 AM
To: Ravi Varadhan; Dan Davison; Ravi Varadhan; Dan Davison; Ravi Varadhan;
Dan Davison; Ravi Varadhan; Dan Davison
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [R] Between the values
Thanks Ravi... But was just wond
Hi,
The "Tango project" website (from Brazil) has some R functions to implement
Algencan. I haven't used it, but I would be interested to hear others'
experience if someone has already used it or will be using it.
Ravi.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTE
Hi,
Hessian for a consttarined problem can be tricky, when the converged
parameter vector lies on the boundary, i.e. when one or more of the
constraints are active at convergence. This can be handled by
reparametrization when the constraints are linear, but is difficult
otherwise.
Ravi.
-
k for all theta such that abs(theta) < -pi/2.
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins University
Ph: (
d(-800)
Do you see the problem?
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-261
)
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: [EMAIL PROTECTED]
Webpage: http://www.
This will work:
exp( lgamma(nu/2) - lgamma((nu+1)/2) )
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
Johns Hopkins
s2=ans2) # both answers are identical
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: [EMA
| is minumum
d <- svd(A)
x.min <- c(d$v %*% diag(1/d$d, length(d$d)) %*% t(d$u) %*% b) # min-norm
solution
Hope this helps,
Ravi.
____
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontolo
Hi Emmanuel,
You can obtain standard error estimate from the Hessian matrix evaluated at
the optimum as: sqrt(diag(solve(ans$hessian))), where `ans' is the object
returned by `optim'. However, `optim' does not return the Hessian matrix by
default. So, you need to specify `hessian = TRUE' when you
Emmanuel,
I didn't answer your second question.
You can use the `try' function to capture errors and keep proceeding through
simulations without crashing out:
?try
If `L-BFGS-B' does not work well, you could try the `spg' function in the
"BB" package.
Ravi.
-Original Message-
From:
so that the binomial
model can be estimated.
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-
6)
RtR <- R %*% t(R)
Q <- cov2cor(RtR)
But this does not have the property that the correlations are uniformly
distributed.
Hope this helps,
Ravi.
____
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric M
lt;- matrix(rnorm(N*N), N, N)
A <- amat %*% t(amat) # A is PD
Best,
Ravi
____
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns Hopkins University
Ph. (410) 502-2619
e.
Hope this helps,
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: Richard Valliant
Date: Thursday
s. Fortunately, you do not have any
nonlinear equality constraints, which it does not handle. If you are
interested, I can share this function with you.
Just curious - how big is H? How successful were you with Rdonlp2?
Ravi.
____
You don't need an equation solver. This is basic algebra.
The solution is:
X = (log(prob) - log(1 - prob) + 3.33) / 0.0102
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and H
It should be a matrix with
dimension, Ni x p, where Ni is the number of inequality constraints and p is
the number of parameters. So, in your case it should be a 2N x N matrix.
Read the help carefully.
Ravi.
----
---
R
lated issues.
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
Webpage:
mize' instead.
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
Webpage:
http://www.jhsph.
Use "Nelder-Mead" as the method in optim. This will give you the correct
solution.
m1 <- mle2(mfun, start=svec, vecpar=TRUE, fixed=svec[1:(l-1)], method="Nelder")
Hope this is helpful,
Ravi.
____
Ravi Va
First of all, please send a reproducible code. Your code is wrong and it does
not execute: naming a function called "function" is a bad idea.
Ravi.
____
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Me
.
---
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
Webpage:
http://www.jhsph.edu/agingandhealth/People
.
---
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
May be you should have said:
"Normality tests are standard farce in a host of statistical texts."
Ravi.
-------
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatri
r CPU. Should I use the sum of user and system CPU or is the total elapsed
time a better measure? I would appreciate UseR's feedback on this.
Thanks very much.
Best,
Ravi.
____
Ravi Varadhan, Ph.D.
Assistant Professor,
Divis
Thanks, Gabor. Your reply is helpful, but it still doesn't answer whether I
should use the sum of the first two components of system.time (user + system
CPU) or only the first one (user CPU).
Ravi.
____
Ravi Varadhan,
CPU is not
that different from the total elapsed time.
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
a large dispersion and then decreasing it towards zero. You
could use extrapolation to extrapolate to the limit as \sigma goes
to zero. Of course, you will then round-off the solution at the end. Does
this make sense?
Ravi.
_____
I know that Matlab can solve this problem, but I didn't mention it in my
previous email since OP had asked for "native to R" solutions.
Ravi.
____
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatr
obis lived)!
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
will soon release it as a package (I have
been saying this for several months now!), but I can send it to you if you are
interested.
Hope this helps,
Ravi.
____
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medi
so like to urge the R-gurus to ignore such
postings.
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: rva
here a simple way to accomplish this?
Thanks very much,
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
___
z <- rep(x, each = y)
Hope this helps,
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.
Sorry, I mean to say:
z <- rep(x, y)
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.
ted.
Consequently, the steplength `delta' for the Newton method cannot be
determined.
Ravi.
____
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns H
al instead of profile likelihood
based CI. Here is how you can do it:
sd.logr <- logistf(AgeRange ~ I(Age - mean(Age)), pl=FALSE, data=sd) # this
computes Wald C.I.
summary(sd.logr)
Hope this helps,
Ravi.
____
Ravi V
<- dfsane(par=c(1,1), fn=fn, s=s)
ans$par # solutions for p and q
You can then loop through for each row of s1 and s2 and solve it to get
corresponding p and q.
Ravi.
____
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of
Look at:
identical(pop, pop2) # if you want to do "exact" comparison
Or
all.equal(pop, pop2, tolerance=1.e-10) # if you want to allow for
some small noise
Ravi.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Es
You have to install it from CRAN before you can load it into your session.
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns Hopkins University
Ph. (410) 502-2619
1:nr) {
ans <- dfsane(par=c(1,1), fn=fn, s=smat[i, ], control=list(trace=FALSE))
soln[i, ] <- ans$par
}
soln # your solution
Hope this helps,
Ravi.
-Original Message-
From: Shaoqiong Zhao [mailto:zh...@uwm.edu]
Sent: Friday, March 12, 2010 5:20 PM
To: Ravi Varadhan
Cc: r-help@r-
I have an algorithm that can perform nonlinear optimization, with
linear/nonlinear, equality and/or inequality constraints. From your
description, it seems like this algorithm would work for your problem.
Contact me if you are interested and I will send you the code.
Ravi.
-Original Message-
will see the problem.
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
want to use Moore-Penrose inverse, also known as generalized inverse
or pseudoinverse to overcome this problem. This approach uses
singular-value decomposition (SVD). Take a look at the "corpcor" package.
Ravi.
-----
onal_pages/Varadhan.h
tml
-Original Message-
From: Laura Bonnett [mailto:l.j.bonn...@googlemail.com]
Sent: Friday, June 26, 2009 6:22 AM
To: Ravi Varadhan
Cc: r-help@r-project.org
Subject: Re: [R] crr -
It is a basic linear algebra issue and has nothing to do with statistics
I told you what your problem is and also how to solve it.
Ravi.
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and
Hi,
You are being rude to those who are trying to help you by ignoring their
suggestions and by sending useless, irrelevant information.
Ravi.
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and
rested.
Hope this helps,
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 -
You are describing a "generalized nonlinear least-squares" estimation procedure.
This is implemented in the gnls() function in "nlme" package.
?gnls
Ravi.
____
Ravi Varadhan, Ph.D.
Assistant Professor,
D
ere.
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
Webpage:
http://www.jhsph.edu/agingandhea
s it possible to have a similar feature in
glkerns?
Thanks for any suggestions.
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant Professor, The Center on Aging and Health
Division of Geriatric Medicine and Gerontology
down in r-help
archives.
Hope this helps,
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.e
alls each time in R and Fortran. While the savings may not be
huge for a single function smoothing, it might be substantial for large
numbers of time-series.
Best regards,
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assistant
onstraints you really
have.
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
Webpage:
http://ww
. You would use different
starting values for lamda1 and lambda2, if the scales of the 2 constraints
are very different. If not, you use a single lambda.
Hope this helps,
Ravi.
----
---
Ravi Varadhan, Ph.D.
Assis
1 - 100 of 694 matches
Mail list logo