Re: [R] good numerical optimization to use in R?

2009-05-21 Thread Ravi Varadhan
inequality constraints - Rdonlp2 See the CRAN Task View: Optimization and Mathematical Programming for more information. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of

Re: [R] Optimization algorithm to be applied to S4 classes - specifically sparse matrices

2009-05-15 Thread Ravi Varadhan
c(low, -upp)[vec] ans <- lsei(A = A, B = y, G = Cmat, H = b0) ans 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

Re: [R] newtons method

2009-05-12 Thread Ravi Varadhan
check whether I have found all the roots. 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-

Re: [R] Citing R/Packages Question

2009-05-11 Thread Ravi Varadhan
. --- 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: [R] Partial Derivatives in R

2009-05-10 Thread Ravi Varadhan
If you want `numerical' partial derivatives, check out: require(numDeriv) ?grad Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins Unive

Re: [R] NLMINB() produces NaN!

2009-05-06 Thread Ravi Varadhan
ale = -1)). If this still does not work, try the function spg() in the "BB" package. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicin

Re: [R] FOURIER INTEGRALS IN R

2009-05-05 Thread Ravi Varadhan
inttegral arise? It must have been studied well using asymptotic approximation and such. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and

Re: [R] Nelson-Aalen estimator of cumulative hazard

2009-05-04 Thread Ravi Varadhan
t; 0 h2 <- cumsum(fit2$n.event[jump]/fit2$n.risk[jump]) > min(abs(h1$hazard - h2)) [1] 1.387779e-17 Best, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Ho

[R] Nelson-Aalen estimator of cumulative hazard

2009-05-03 Thread Ravi Varadhan
uot;Cancer" | status=="CVD" | status=="Other") ~ 1, data=gb) jump <- fit2$n.event > 0 h2 <- cumsum(fit2$n.event[jump]/fit2$n.risk[jump]) plot(h1$time, h1$hazard - h2) Thank you, Ravi. Ravi

Re: [R] Optim function in the loop

2009-05-03 Thread Ravi Varadhan
Hi, It is not clear to me what you are trying to do, but you should try `while' instead of `if': count <- 1 while (count > 0) { . . # yuor code here . } Ravi. ____ Ravi Varadhan, Ph.D. Assistant Profes

Re: [R] Optim and hessian

2009-04-29 Thread Ravi Varadhan
hess <- hessian(x=ans$par, func=fr) hess Hope this helps, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology

Re: [R] Stochastic Gradient Ascent for logistic regression

2009-04-26 Thread Ravi Varadhan
homework assignment. If so, you should acknowledge that you got help from the R group. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University

Re: [R] Stuck using constrOptim

2009-04-23 Thread Ravi Varadhan
. 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

Re: [R] Stuck using constrOptim

2009-04-23 Thread Ravi Varadhan
might help. 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.

Re: [R] Stuck using constrOptim

2009-04-23 Thread Ravi Varadhan
The information you have provided is not enough. Please read the posting guide on how ask for help. Provide a reproducible example so we can help you. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The

Re: [R] large factorials

2009-04-23 Thread Ravi Varadhan
. What is the real problem that you are trying to solve? Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University

Re: [R] Help using spg optimization in BB package

2009-04-22 Thread Ravi Varadhan
spg(par=c(0, 0), fn=fr.pen) # Note: this starting value will fail for the "projection method" due to division by zero Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health

Re: [R] Help using spg optimization in BB package

2009-04-22 Thread Ravi Varadhan
r" and "upper" as arguments, even if you don't use them spg(par=c(0.5, 0.5), fn=fr, project=proj) Hope this helps, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Healt

Re: [R] Help using spg optimization in BB package

2009-04-22 Thread Ravi Varadhan
You can try defining a "projection" function as follows: project <- function(x) x / sum(x) This should work fine. Let me know if you have any trouble. Ravi. ---- --- Ravi Varadhan, Ph.

Re: [R] Two or more dimensional root (Zero) finding

2009-04-20 Thread Ravi Varadhan
ne 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...

Re: [R] issue with L-BFGS-B in optim (optim just hangs)

2009-04-17 Thread Ravi Varadhan
solve your problem, assuming that is your problem. Ravi. ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph:

Re: [R] issue with L-BFGS-B in optim (optim just hangs)

2009-04-15 Thread Ravi Varadhan
re-run optim() or nlminb() or spg(). 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...@jh

Re: [R] nls factor

2009-04-15 Thread Ravi Varadhan
y(nls.coef, 2, summary) 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) 61

Re: [R] Forcing the extrapolation of loess through the origin

2009-04-14 Thread Ravi Varadhan
), col=4, lty=3) Note that the constraint does "significantly" alter the loess smooth close to the origin, as it should. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Heal

Re: [R] Jacobian

2009-04-14 Thread Ravi Varadhan
  y <- seq(0, 1, length=5) *2*pi    z <- cbind(x, y) jac <- vector("list") for (i in 1:nrow(z)) { jac[[i]] <- jacobian(func=func2, x=z[i, ]) } jac Ravi. ---

Re: [R] problems with integrate ... arguments

2009-04-09 Thread Ravi Varadhan
(x, ...) ) > integrate(f2, 0.5, 1, const=testval) 1.845111 with absolute error < 2.0e-14 Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins

Re: [R] problems with integrate ... arguments

2009-04-09 Thread Ravi Varadhan
e-14 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 Morey Date: Thursday, Apri

Re: [R] MLE for bimodal distribution

2009-04-08 Thread Ravi Varadhan
used as an "off-the-shelf" accelerator without needing any problem-specific input. Best, Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins

Re: [R] MLE for bimodal distribution

2009-04-08 Thread Ravi Varadhan
tiple starting values. Be warned that EM convergence can be excruciatingly slow. Acceleration methods can be of help in large simulation studies or for bootstrapping. Best, Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Divisi

Re: [R] MLE for bimodal distribution

2009-04-08 Thread Ravi Varadhan
ll optim(par=as.numeric(start0), fn=fcn, method="L-BFGS-B", lower=c(-Inf, 0, -Inf, 0, 0), upper=c(Inf, Inf, Inf, Inf, 1)) Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Ger

Re: [R] Newton method again

2009-04-07 Thread Ravi Varadhan
) ?dfsane 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: Roslina Zakaria Date: Tuesday, April 7, 2009 10:35

Re: [R] get optim results into a model object

2009-04-07 Thread Ravi Varadhan
]) [1] 1 > I know the difference is insignificant, in this example, but in general, using a large weight for the first equation is a good idea. Best, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Cent

Re: [R] get optim results into a model object

2009-04-07 Thread Ravi Varadhan
e-05 > Note that the sum of squared residuals from lm() is smaller than your value from optim(). Although, this approach works well in your example, it does not guarantee that the coefficients are between 0 and 1. Ravi. ------

Re: [R] approximation function

2009-04-06 Thread Ravi Varadhan
smoother, such as, for example, smooth.spline() or loess(). Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvara

Re: [R] embed?

2009-04-03 Thread Ravi Varadhan
87 [8,]98 [9,] 109 > This is allso known as Ruelle-Takens embedding in non-linear dynamical systems, where this device is helpful in detecting the existence of a low-dimensional attractor of the time-series. Ravi. --

Re: [R] Geometric Brownian Motion Process with Jumps

2009-04-03 Thread Ravi Varadhan
on gradients, such as Nelder-Mead. Can you provide a reproducible example, which would help us dig deeper into your problem? Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health

Re: [R] Geometric Brownian Motion Process with Jumps

2009-04-03 Thread Ravi Varadhan
on gradients, such as Nelder-Mead. Can you provide a reproducible example, which would help us dig deeper into your problem? Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Ravi Varadhan
this area. 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-

Re: [R] Need Advice on Matrix Not Positive Semi-Definite with cholesky decomposition

2009-04-01 Thread Ravi Varadhan
ness" you would like to 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...@

Re: [R] constraint optimization: solving large scale general nonlinear problems

2009-03-29 Thread Ravi Varadhan
-constraints on x and/or b) including optim() or spg() in the "BB" package. Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University

Re: [R] Find inflection points using smooth.spline

2009-03-29 Thread Ravi Varadhan
f=d2, interval=c(0.1, 0.5)) # first inflection point uniroot(f=d2, interval=c(0.5, 0.9)) # second inflection point Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Joh

Re: [R] constraint optimization: solving large scale general nonlinear problems

2009-03-27 Thread Ravi Varadhan
e, what type of discontinuity do you have (e.g. f(.) is continuous, but its gradient is not, or f(.) itself has jump discontinuites)? Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of

Re: [R] constraint optimization: solving large scale general nonlinear problems

2009-03-27 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: Ravi Varadhan Date: Friday, March 27, 2

Re: [R] constraint optimization: solving large scale general nonlinear problems

2009-03-27 Thread Ravi Varadhan
(with multiple starts or some other search technique) and choose the one that maximizes f(x). Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins Universit

Re: [R] about the Choleski factorization

2009-03-27 Thread Ravi Varadhan
equal(x, t(L) %*% L) A <- matrix(rnorm(36), 6, 6) A <- A %*% t(A) L <- loch(x) all.equal(x, t(L) %*% L) Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of M

Re: [R] about the Choleski factorization

2009-03-27 Thread Ravi Varadhan
equal(x, t(L) %*% L) A <- matrix(rnorm(36), 6, 6) A <- A %*% t(A) L <- loch(x) all.equal(x, t(L) %*% L) Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of M

Re: [R] about the Choleski factorization

2009-03-27 Thread Ravi Varadhan
traditional Cholesky factorization can do for a symmetric, positive-definite matrix (mainly, solve a system of equations). Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School o

Re: [R] Competing risks Kalbfleisch & Prentice method

2009-03-27 Thread Ravi Varadhan
vide such compactness as you have to model all the cause-specific hazards. Best, Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins Unive

[R] Hazard rate estimation by smoothing baseline cumulative hazard from Cox model - Was: RE: Competing risks Kalbfleisch & Prentice method

2009-03-26 Thread Ravi Varadhan
this were possible. I am wondering why Terry Therneau's "survival" package doesn't have this option. Best, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Divi

Re: [R] Competing risks Kalbfleisch & Prentice method

2009-03-26 Thread Ravi Varadhan
ifferent approach that relaxes this assumption (it also uses a different estimation approach), but I don't know if there is an R implementation for that. Thanks, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professo

Re: [R] intelligent optimizer (with domain restrictions?)

2009-03-25 Thread Ravi Varadhan
such as dfsane() in the the package "BB" or nleqslv() in "nleqslv". It is not clear to me how you end up with a scalar objective function to minimize (do you consider the L2-norm of the residuals?). Ravi. ____

Re: [R] very fast OLS regression?

2009-03-25 Thread Ravi Varadhan
ast. 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: Bert Gunter Date: Wednesday, March 25, 20

Re: [R] very fast OLS regression?

2009-03-25 Thread Ravi Varadhan
the minimum length by using Moore-Penrose inverse: > require(MASS) > ans.min <- c(ginv(x) %*% y) > ans.min [1] 2 2 2 > You can verify that ans.min has a smaller L2-norm than ans, and it is unique. Hope this helps, Ravi. ___

Re: [R] Green and Byar (1980) Prostate Cancer Data set from Andrews and Herzberg - Data

2009-03-24 Thread Ravi Varadhan
. 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: David Winsemius Date: Tuesday, March 24, 2009 10:54 pm Subject

Re: [R] Green and Byar (1980) Prostate Cancer Data set from Andrewsand Herzberg - Data

2009-03-24 Thread Ravi Varadhan
lts in journal articles because the data sets and their sources are sloppily documented. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontol

Re: [R] Green and Byar (1980) Prostate Cancer Data set from Andrews and Herzberg - Data

2009-03-24 Thread Ravi Varadhan
I just found it. Please disregrad my email. 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

[R] Green and Byar (1980) Prostate Cancer Data set from Andrews and Herzberg - Data

2009-03-24 Thread Ravi Varadhan
in A & H exist? 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

Re: [R] Iterative Proportional Fitting, use

2009-03-23 Thread Ravi Varadhan
sum(rowmarg), margin=list(1,2), start=mat, fit=TRUE, eps=1.e-05, iter=100)$fit newmat apply(newmat, 1, sum) apply(newmat, 2, sum) Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Heal

Re: [R] Difference between gam() and loess().

2009-03-20 Thread Ravi Varadhan
t be to get Trevor Hastie or Bill Cleveland to help you out. But, before that: why is this an issue, Rolf? Is it important that these two results be identical? Best, Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Div

Re: [R] Non-Linear Optimization - Query

2009-03-18 Thread Ravi Varadhan
he R users for "directly" solving nonlinear systems. Now, there are two solid alternatives. Best, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geri

Re: [R] Likelihood of a ridge regression (lm.ridge)?

2009-03-18 Thread Ravi Varadhan
ys). 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: joris meys Date: Tuesday, March 17, 2009 7:37 pm Subject: [R] Likel

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Ravi Varadhan
lier f[2] <- 1 + 2 * x[2] * x[3] f[3] <- x[1]^2 + x[2]^2 - 1 # the equality constraint f } dfsane(par=rep(0, 3), fn=f2) Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health D

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Ravi Varadhan
the penalty } ans 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.edu We

Re: [R] Non-Linear Optimization - Query

2009-03-17 Thread Ravi Varadhan
guidance. 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: Paul Smith Date: M

Re: [R] Uniroot and Newton-Raphson Anomaly

2009-03-16 Thread Ravi Varadhan
systems to solve a univariate problem, but it seems to work. Hope this helps, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopk

Re: [R] stats lm() function

2009-03-12 Thread Ravi Varadhan
Look at: ?update For example: lm.obj <- lm (y ~ x1 + ... + x300) lm.obj1 <- update(lm.obj, . ~ . - x1) lm.obj2 <- update(lm.obj1, . ~ . - x2) Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of

Re: [R] avoiding termination of nls given convergence failure

2009-03-12 Thread Ravi Varadhan
?try For example, for (i in 1:n) { try (fit <- nls(...), silent=TRUE) if (class(fit) != "try-error") dowhateverthatneedstobedonewiththeresults else fit <- NA } Ravi. ---- --- Ravi Varadhan,

Re: [R] Cholesky Decomposition in R

2009-03-11 Thread Ravi Varadhan
You got an "A+" on the homework, Doug! I got a "C-" for suggesting svd(), which clearly doesn't yield a lower (or upper) triangular factorization. Ravi. ---- --- Ravi Varadhan, Ph.D. Assist

Re: [R] Cholesky Decomposition in R

2009-03-10 Thread Ravi Varadhan
.02357989 $v [,1] [,2][,3] [1,] 0.08585595 -0.2420411 0.96645997 [2,] 0.40826313 -0.8763116 -0.25573252 [3,] 0.90881790 0.4165261 0.02357989 > Ravi. ---- --- Ravi Varadhan, Ph.D. Ass

Re: [R] multivariate integration and partial differentiation

2009-03-07 Thread Ravi Varadhan
Deriv" 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 - Original Message

Re: [R] NonLinear Programming in R - QUERY

2009-03-07 Thread Ravi Varadhan
Try the package "Rdonlp2", which can handle general, nonlinear, equality and inequality constraints for smooth optimization problems. Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Me

Re: [R] Newton-Raphson method and Quasi Newton

2009-03-02 Thread Ravi Varadhan
Check out: ?optim ?nlminb 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

Re: [R] Competing risks adjusted for covariates

2009-02-27 Thread Ravi Varadhan
Check out the crr() function in the same package: library(cmprsk) ?crr Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502

Re: [R] Tracing gradient during optimization

2009-02-24 Thread Ravi Varadhan
. --- 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

Re: [R] Tracing gradient during optimization

2009-02-24 Thread Ravi Varadhan
ontrol the frequency of output, i.e. settig triter=1, will give you the fn and gr values at each iteration. library(BB) ?spg Hope this helps, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on

Re: [R] r: intergrate behaviour

2009-02-23 Thread Ravi Varadhan
s-Legendre quadrature. 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

[R] Diagnostics for single-observation deletion in Cox models

2009-02-20 Thread Ravi Varadhan
, 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

Re: [R] Source code for nlm()

2009-02-19 Thread Ravi Varadhan
information from the second reference). 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

[R] Source code for nlm()

2009-02-19 Thread Ravi Varadhan
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/agingandh

Re: [R] Optim

2009-02-12 Thread Ravi Varadhan
. --- 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

Re: [R] uniroot() problem

2009-02-09 Thread Ravi Varadhan
36.29 at x=0. If the singularity at x=0 is not an essential one, you may be able to anayticallty remove this singularity. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health

Re: [R] Non-linear optimisation

2009-02-05 Thread Ravi Varadhan
ve more general equality/inequality constraints 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

Re: [R] optimal control, maximization with several variables?

2009-02-05 Thread Ravi Varadhan
I assume that you are looking to solve, in R, the constrained optimization problem: H (u1, u2) = a*u1+b*u2+c*f1(u2)+lambda*(x') with constraints: 0 Date: Thursday, February 5, 2009 8:47 am Subject: [R] optimal control, maximization with several variables? To: R-help@r-project.org >

Re: [R] StepAIC with coxph

2009-01-28 Thread Ravi Varadhan
largest model, i.e none of the variables in the largest model should have any missing values. Then run stepAIC on this dataframe. Best, Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and

Re: [R] constrainOptim

2009-01-28 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: June Wong Date: Wednesday, Janu

Re: [R] optim() and ARIMA

2009-01-27 Thread Ravi Varadhan
able to come up with multiple (sensible) starting values. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University

Re: [R] How to get solution of following polynomial?

2009-01-12 Thread Ravi Varadhan
rn the function values at all the points in the vector. "sapply" is an easy way to do this. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medic

Re: [R] How to get solution of following polynomial?

2009-01-11 Thread Ravi Varadhan
nction(p) x1 <-seq(-5, 5, length=100) plot(x1, fn(x1),type="l") lines(x1, pfunc(x1), col=2, lty=2) solve(p) # gives you the roots (some are, of course, complex) Hope this helps, Ravi. ____ Ravi Varadhan, Ph.D. Ass

Re: [R] Implementing a linear restriction in lm()

2008-12-25 Thread Ravi Varadhan
del2, model1) 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: Serguei Kaniovski Date: Wednesday, December 24,

Re: [R] Non-finite finite difference error

2008-12-24 Thread Ravi Varadhan
n both the shape and the rate parameter (hence a different optimziation algorithm will be used in "optim"). Best, Ravi. ____ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology Scho

Re: [R] Principal Component Analysis - Selecting components? + right choice?

2008-12-11 Thread Ravi Varadhan
ute everything to the model fit, while the remaining PCs will contribute zilch. They illustrate this phenomenon with a "real" data set from a classic text on regression, Draper and Smith. Ravi. ---- --- Ravi V

Re: [R] Pre-model Variable Reduction

2008-12-09 Thread Ravi Varadhan
selection, the criterion that is optimized is never explicitly considered. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hop

Re: [R] Discrepancy in the PBC data set

2008-11-24 Thread Ravi Varadhan
cites F&H for the data). 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

Re: [R] optimization problem

2008-11-24 Thread Ravi Varadhan
]. 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.jhsph.edu/agingandhealth/Peop

Re: [R] Discrepancy in the regression coefficients for Cox regression - PBC data set

2008-11-21 Thread Ravi Varadhan
Terry Therneau knows the answer?! 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.jhsph.edu/agin

Re: [R] Discrepancy in the regression coefficients for Cox regression - PBC data set

2008-11-21 Thread Ravi Varadhan
6 vs 0.86. In any case, the point is not whether the differences in coefficient affect interpretation of the model, but to understand why there are differences in the results. Best, Ravi. ---- --- Ravi Varadhan, Ph.

[R] Discrepancy in the regression coefficients for Cox regression - PBC data set

2008-11-21 Thread Ravi Varadhan
lihood? Can anyone help me figure out why this diescrepancy exists? Thanks very much, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology

Re: [R] Regression versus functional/structural relationship?

2008-10-30 Thread Ravi Varadhan
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: [EMAIL PROTECTED] Webpage: http:

[R] Regression versus functional/structural relationship?

2008-10-29 Thread Ravi Varadhan
Thank you, 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: [

Re: [R] optim bug/help?

2008-10-23 Thread Ravi Varadhan
en( solve(ans$hess) )$val Hope this is helpful, 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: (41

<    1   2   3   4   5   6   7   >