Re: [R] Vorticity and Divergence

2008-09-09 Thread Ravi Varadhan
2 - X[1] * X[2] > vorticity(c(2,1)) [1] -5 > divergence(c(2,1)) [1] 5 > Does this help? Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicin

Re: [R] Convex optimization in R?

2008-09-11 Thread Ravi Varadhan
urther extended for convex functions, if one can come up with a smooth function that majorizes the convex objective function. This can be easily done for the absolute value function. Ravi. ---- --- Ravi Varadhan, P

Re: [R] Computing Mean Lifetime from Hazard

2008-09-26 Thread Ravi Varadhan
using the smoothed version, or compute the areas using tapezoidal or simpson's rule (if data is equally spaced). Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Divisi

Re: [R] Computing Mean Lifetime from Hazard

2008-09-26 Thread Ravi Varadhan
Hi, there was a typo in the last formula of my previous email. The correct formula is: mean life time = int_{0} ^{\inf} u * f(u) du Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and

Re: [R] Bivariate normal

2008-10-01 Thread Ravi Varadhan
I think it is meaningful to ask for a non-trivial Pr (X < x, Y=y) when you are writing down the likelihood for parameter estimation. This is commonly the case in likelihood estimation in bivariate failure time models. If one interprets Pr(Y=y) as the density evaluated y then: Pr(Xhttp://www.jh

Re: [R] In the OPTIM message....

2008-10-02 Thread Ravi Varadhan
; ?optim 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/aginga

Re: [R] When to set small values to 0?

2008-10-03 Thread Ravi Varadhan
the approaximation, if you know that. If these thresholds are too high to be appropriate for your objective, then you can increase the accuracy of your numerical approximation and obtain a smaller threshold. Ravi. Ravi

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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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

[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] 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] 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] 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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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
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] 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-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] 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] how to randomly generate a n by n positive definite matrix in R ?

2008-02-07 Thread Ravi Varadhan
ev=1:5) eigen(pdmat)$val 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.j

Re: [R] .fortran code

2008-02-07 Thread Ravi Varadhan
just calling routines that each calls a number of other subroutines. So, unless you are willing to spend a great deal of time, you may not be any wiser at the end of all this. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant P

Re: [R] .fortran code

2008-02-08 Thread Ravi Varadhan
indows, for example): C:\Program Files\R\R-2.6.1/src/library/mypkg/src For building R from source check the R-FAQ. Hope this helps, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Healt

Re: [R] overdispersion + GAM

2008-02-11 Thread Ravi Varadhan
ics 1993, p. 623-630), which discusses numerous examples of overdispersion in binary data. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Ger

Re: [R] [OT] good reference for mixed models and EM algorithm

2008-02-11 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/People/Faculty/Varadhan.

Re: [R] Error 'singular gradient' in nonlinear model fitting

2008-02-15 Thread Ravi Varadhan
Try a different set of starting values for alpha & beta. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hop

Re: [R] renaming objects

2008-03-03 Thread Ravi Varadhan
quot;thinks" that it has been modified ??? 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]

Re: [R] loop

2008-03-05 Thread Ravi Varadhan
Try this: m <- seq(-1,1,0.1) x1 <- vector(length=length(m)) x2 <- vector(length=length(m)) for(i in m){ x1[i] <- i x2[i] <- i^2 } dat <- data.frame(x1,x2) Ravi. ---- --- Ravi Varadhan

Re: [R] box-constrained

2008-03-05 Thread Ravi Varadhan
er than multiplicative, it has better numerical conditioning. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins Unive

Re: [R] differentiating a numeric vector

2008-03-05 Thread Ravi Varadhan
lt;- plot(fit, drv=2) # plot and store second derivative Hope this helps, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns

Re: [R] differentiating a numeric vector

2008-03-05 Thread Ravi Varadhan
Hi, If you didn't receive the attachment properly, here it is again. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology

Re: [R] Numerical Integration in 1D

2008-03-07 Thread Ravi Varadhan
unction(n) {integrate(fx, lower=0, upper=Inf, n=n)$val} > grad(x=3, func=gf) [1] 7.536706 > > grad(x=10, func=gf) [1] 8534040 > Best, Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging an

Re: [R] Numerical Integration in 1D

2008-03-07 Thread Ravi Varadhan
n)$val} library(numDeriv) fx <- function(x, n) exp(-x) * x^n gf <- function(n) {integrate(fx, lower=0, upper=Inf, n=n)$val} > grad(x=6, func=gf) [1] 1348.405 > > df(6) [1] 1348.405 > Ravi. ----

Re: [R] triple integral: adapt package question

2008-03-07 Thread Ravi Varadhan
unctn = fxyz, eps=1.e-03) This approach can be very inefficient depending upon how big the 3-dim hyper-rectangle is compared to the actual region over which the integrand is non-zero. Ravi. ---- --- Ravi Varadhan, Ph.D.

Re: [R] Types of quadrature

2008-03-12 Thread Ravi Varadhan
number as a surrogate for Inf. What is the specific problem or distribution that you are having trouble with in using integrate()? Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health

Re: [R] default values

2008-03-12 Thread Ravi Varadhan
You just need to return the values computed when a==0 and when a!=0. a=0 f=function(x,y,z=0) { if (a==0) return(x[1]+x[2]+y) if (a!=0) return(x[1]+x[2]+y+z) } > f(1:2,3) [1] 6 > Ravi. --- Ravi Va

[R] Use of ellipses ... in argument list of optim(), integrate(), etc.

2008-03-13 Thread Ravi Varadhan
hank you very much. 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://www.jhsp

Re: [R] Types of quadrature

2008-03-13 Thread Ravi Varadhan
ontact the package developer to provide an option for computing 1 - pghyp by specifying an option such as lower.tail=FALSE, as it is done with pnorm(). This would also solve your problem. Hope this helps, Ravi. ----

Re: [R] Use of ellipses ... in argument list of optim(), integrate(), etc.

2008-03-13 Thread Ravi Varadhan
Thank you, Vince. 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

Re: [R] Use of ellipses ... in argument list of optim(), integrate(), etc.

2008-03-13 Thread Ravi Varadhan
after the ellipsis. 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

[R] How to reverse colors in filled.contour?

2008-03-18 Thread Ravi Varadhan
eatly appreciated. Thanks very much. 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 P

[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] 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] 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] 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.

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] 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 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] 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] 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] RE : Must be easy, but haven't found the function (numerical integration)

2007-09-18 Thread Ravi Varadhan
Here is a simple trapezoidal rule integrator: x <- time y <- value area <- sum(diff(x)*(y[-1]+y[-length(y)]))/2 Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Di

Re: [R] optimize() stuck in local plateau ?

2007-10-01 Thread Ravi Varadhan
7997001 [1] -0.8000667 0.4000334 [1] -0.7998402 0.7998402 [1] -0.7999802 0.7999802 [1] -0.8000209 0.4000104 [1] -0.7999802 0.7999802 $maximum [1] -0.7999802 $objective [1] 0.7999802 Best, Ravi. ---- --- Ravi Var

Re: [R] Reenviar: variables selection in Aalen and Cox model

2007-10-01 Thread Ravi Varadhan
Check out the function coxpath() in the package "glmpath". This is a better approach than doing stepwise covariate selection. Best, Ravi. ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on

Re: [R] optimize() stuck in local plateau ?

2007-10-01 Thread Ravi Varadhan
The local maximum (x* = 0.106) found by the golden-section search does lie in the interval [x_1, x_2]. So, it is consistent with the explanation on the help page. --- Ravi Varadhan, Ph.D. Assistant Professor, The

Re: [R] Summary vs fivenum results for Q3

2007-10-09 Thread Ravi Varadhan
Please read the relevant help pages: ?fivenum ?boxplot.stats Hint: Length of your data vector is an "even" number. Ravi. ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health D

Re: [R] identify number of sequences from a vector

2007-10-09 Thread Ravi Varadhan
Try: help.search("run") 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

Re: [R] help with nls and Hill equation

2007-10-16 Thread Ravi Varadhan
rally has more robust convergence than the default "Gauss-Newton" with a Marquardt-type modification. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatr

Re: [R] underdetermined system

2007-10-16 Thread Ravi Varadhan
vailable in R. 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/a

Re: [R] underdetermined system

2007-10-16 Thread Ravi Varadhan
of course, has a smaller norm than (0, 0.4). 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: [R] underdetermined system

2007-10-16 Thread Ravi Varadhan
ls.min(x,y) [,1] [1,] 0.26 [2,] 0.76 > > 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-261

Re: [R] Observations on SVD linpack errors, and a workaround

2007-10-17 Thread Ravi Varadhan
the "badx" object from your website into my R session? 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 E

Re: [R] Multi-objective optimization

2007-10-17 Thread Ravi Varadhan
mportance of F to G. 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

Re: [R] Multi-objective optimization

2007-10-17 Thread Ravi Varadhan
necessarily exist, one needs to define a scalar function that strikes a compromise between f and g. Ravi. ---- --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicin

Re: [R] Observations on SVD linpack errors, and a workaround

2007-10-18 Thread Ravi Varadhan
is already for SVD). 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/agi

Re: [R] Observations on SVD linpack errors, and a workaround

2007-10-18 Thread Ravi Varadhan
different. Thanks for pointing this out. 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] R & learning curves. Was RE: R routines vs. MATLAB/SPSS Routines

2007-10-26 Thread Ravi Varadhan
t steeper, but simply higher. 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/agingand

Re: [R] covariance matrix of the regression coefficients

2007-10-29 Thread Ravi Varadhan
?vcov You can use vcov(lm.obj) to extract the covariance matrix, where "lm.obj" is your fitted object from lm(). Ravi. ------- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health D

Re: [R] Log random number

2007-11-14 Thread Ravi Varadhan
If you want to generate log-normally distributed random numbers, see: ?rlnorm Note: X is said to be log-normally distributed when log(X) is normally distributed. Ravi. --- Ravi Varadhan, Ph.D. Assistant

Re: [R] Number -> Fraction

2007-09-13 Thread Ravi Varadhan
hine precision (i.e. 16 digits) 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 PROTE

[R] How to use ifelse without invoking warnings

2021-10-07 Thread Ravi Varadhan via R-help
Hi, I would like to execute the following vectorized calculation: ans <- ifelse (k >= -1 & k <= n, pbeta(p, k+1, n-k, lower.tail = FALSE), ifelse (k < -1, 0, 1) ) For example: > k <- c(-1.2,-0.5, 1.5, 10.4) > n <- 10 > ans <- ifelse (k >= -1 & k <= n, pbeta(p,k+1,n-k,lower.tail=FALSE), ifels

Re: [R] How to use ifelse without invoking warnings

2021-10-08 Thread Ravi Varadhan via R-help
regards, Ravi From: John Fox Sent: Thursday, October 7, 2021 2:00 PM To: Ravi Varadhan Cc: R-Help Subject: Re: [R] How to use ifelse without invoking warnings External Email - Use Caution Dear Ravi, It's already been suggested that you could disable w

[R] Number of Cores limited to two in CRAN

2023-07-02 Thread Ravi Varadhan via R-help
Hi, I am developing a package where I would like to utilize multiple cores for parallel computing. However, I get an error message when I run R CMD check --as-cran. I read that CRAN limits the number of cores to 2. Is this correct? Is there any way to overcome this limitation? Thank you, Rav

Re: [R] Number of Cores limited to two in CRAN

2023-07-02 Thread Ravi Varadhan via R-help
This is the specific error messsage from R CMD check --as-cran Error in .check_ncores(length(names)) : 16 simultaneous processes spawned Calls: prepost -> makeCluster -> makePSOCKcluster -> .check_ncores Execution halted Thanks, Ravi ____ From: Ravi

Re: [R] Number of Cores limited to two in CRAN

2023-07-02 Thread Ravi Varadhan via R-help
Dear Henrik, Thank you! This is quite helpful, especially your longer blog post. Best regards, Ravi From: Henrik Bengtsson Sent: Sunday, July 2, 2023 4:33 AM To: Ravi Varadhan Cc: R-Help Subject: Re: [R] Number of Cores limited to two in CRAN External

<    2   3   4   5   6   7