Displaying 20 results from an estimated 600 matches similar to: "Help needed with numericDeriv and optim functions"
2010 Jul 06
2
numerical derivative R help
I fit my CDF to sum of exponentials and now I want to take the numerical
derivative of this function to obtain probability density.I will really
appreciate your help reagrding the error messages I am getting which I don't
understand.
*
*
> fitterma <- function(xtime) {
a <- -0.09144115
b <- -0.01335756
c <- -2.368057
d <- -0.00600052
2010 Jun 23
1
Probabilities from survfit.coxph:
Hello:
In the example below (or for a censored data) using survfit.coxph, can
anyone point me to a link or a pdf as to how the probabilities appearing in
bold under "summary(pred$surv)" are calculated? Do these represent
acumulative probability distribution in time (not including censored time)?
Thanks very much,
parmee
*fit <- coxph(Surv(futime, fustat) ~ age, data = ovarian)*
2010 Apr 01
1
predicted time length differs from survfit.coxph:
Hello All,
Does anyone know why length(fit1$time) < length(fit2$n) in survfit.coxph
output? Why is the predicted time length is not the same as the number of
samples (n)?
I tried: example(survfit.coxph).
Thanks,
parmee
> fit2$n
[1] 241
> fit2$time
[1] 0 31 32 60 61 152 153 174 273 277 362
365 499 517 518 547
[17] 566 638 700 760 791
2005 Nov 16
2
numericDeriv
I have to compute some standard errors using the delta
method and so have to use the command "numericDeriv"
to get the desired gradient. Befor using it on my
complicated function, I've done a try with a simple
exemple :
x <- 1:5
numericDeriv(quote(x^2),"x")
and i get :
[1] 1 8 27 64 125 216
attr(,"gradient")
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] Inf
2020 Jun 16
0
[External] numericDeriv alters result of eval in R 4.0.1
Thanks; definitely a bug. I've submitted it to the bug tracker at
https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17831
Best,
luke
On Mon, 15 Jun 2020, Raimundo Neto wrote:
> Dear R developers,
>
> I've run into a weird behavior of the numericDeriv function (from the stats
> package) which I also posted on StackOverflow (question has same title as
> this email,
2003 Apr 25
2
AW: numericDeriv and ecdf
> On only ten points, what did you expect ? Even with 1000
> observations, estimating a density is difficult, and has
> been the subject of a century of research. Kernel density
> estimates are among the most successful. For your immediate
> application, try plot(density(rnorm(10)), type="l"), etc.
wait, you misunderstood me!
I'd like to see 10 or 9 points with
2012 May 18
1
Help for numericDeriv function
Hi,
I am stuck on something for a couple days, I am almost about to give up.
This looks simple, but I can't figure out. I hope I can get some help here.
I am trying to do some symbolic and numerical derivations. Let me explain
the problem. Let's say, I have a matrix as follows:
> load <- matrix(c(3,0,1,4,1,3),nrow=3,ncol=2,byrow=TRUE)
>
> load
[,1] [,2]
[1,] 3 0
2003 Apr 25
1
numericDeriv and ecdf
Hi All,
following expression:
x <- sort(rnorm(10)); e <- ecdf(x); d <- numericDeriv(e(x),"x");
makes d far from approximation of one dimensional pdf.
What's wrong then here?
Kind regards.
---------------------------------------------------------------------------
Valery A.Khamenya
Bioinformatics Department
BioVisioN AG, Hannover
2003 Apr 28
0
AW: AW: numericDeriv and ecdf
Dear Prof. Brian Ripley,
first of all thank you for your answer, I do appreciate
how do you manage to keep successfully all your
activities and answer posts in this forum!
> An empirical CDF is a step function: it does not have a
> derivative at the jump points, and has a zero
> derivative everywhere else.
of course!
Let me add few words concerning my simple motivation.
1.
2020 Jun 15
2
numericDeriv alters result of eval in R 4.0.1
Dear R developers,
I've run into a weird behavior of the numericDeriv function (from the stats
package) which I also posted on StackOverflow (question has same title as
this email, except for the version of R).
Running the code bellow we can see that the numericDeriv function gives an
error as the derivative of x^a wrt a is x^a * log(x) and log is not defined
for negative numbers. However,
2003 Aug 14
0
Bug in numericDeriv (was: [R] nls confidence intervals) (PR#3746)
Moved from r-help:
On Thu, 14 Aug 2003 09:08:26 -0700, Spencer Graves
<spencer.graves@pdf.com> wrote :
>p.s. The following command in S-Plus 6.1 seems to work fine but
>produces an error in R 1.7.1:
>
>nls(y~a, data=tstDf, start=list(a=1))
>Error in nlsModel(formula, mf, start) : singular gradient matrix at
>initial parameter estimates
This looks like a bug in
2006 Jan 19
1
numericDeriv() giving a vector when multiple variables input
R Help List --
I have defined two time-series-vector-valued-functions, let them be f and g,
and want to find the numeric derivative of f with respect to the variable x
where f depends on x through g:
(d/dx)(f (g(x) )
Moreover, x is a vector
I tried this out the long way (naming every element of the x vector and then
making the 'theta' argument in numericDeriv() the character vector of
2020 Jun 16
1
[External] numericDeriv alters result of eval in R 4.0.1
Dear all
As far as I could trace, looking at the function C function numeric_deriv,
this unwanted behavior comes from the inner most loop in, at the very end
of the function,
for(i = 0, start = 0; i < LENGTH(theta); i++) {
for(j = 0; j < LENGTH(VECTOR_ELT(pars, i)); j++, start += LENGTH(ans)) {
SEXP ans_del;
double origPar, xx, delta;
origPar = REAL(VECTOR_ELT(pars, i))[j];
2007 Feb 13
1
nls: "missing value or an infinity" (Error in numericDeriv) and "singular gradient matrix"Error in nlsModel
Hi,
I am a non-expert user of R. I am essaying the fit of two different functions to my data, but I receive two different error messages. I suppose I have two different problems here... But, of which nature? In the first instance I did try with some different starting values for the parameters, but without success.
If anyone could suggest a sensible way to proceed to solve these I would be
1999 Jul 02
0
Bug in "[.ts" for multivariate ts {Problem with plot.ts, "[" (PR#217)
This message is in MIME format
--_=XFMail.1.3.p0.Linux:990702182137:16900=_
Content-Type: text/plain; charset=us-ascii
There was some discussion a while back on R-devel between Ross Ihaka,
Paul Gilbert and myself about row subsetting in time series. I think
the consensus was that "[.ts" should not try to coerce its result
back to a time series object (which is underlying the problem
2004 Apr 28
4
numericDeriv
Dear All,
I am trying to solve a Generalized Method of Moments problem which
necessitate the gradient of moments computation to get the
standard errors of estimates.
I know optim does not output the gradient, but I can use numericDeriv to
get that. My question is: is this the best function to do this?
Thank you
Jean,
2007 Apr 18
0
[RFC, PATCH 22/24] i386 Consolidate redundant timer code
Isolate some of the non-VMI timer related changes in Linux. This patch
moves the cyc_2_ns conversion code into a common location, eliminating
redundant code in hpet and tsc timer implementations, and introduces
some macros that may be redefined by the sub-architecture to avoid
dependence on APIC routing, CMOS time sync, and testing for broken time
hardware (which presumably, does not happen in a
2007 Apr 18
0
[RFC, PATCH 22/24] i386 Consolidate redundant timer code
Isolate some of the non-VMI timer related changes in Linux. This patch
moves the cyc_2_ns conversion code into a common location, eliminating
redundant code in hpet and tsc timer implementations, and introduces
some macros that may be redefined by the sub-architecture to avoid
dependence on APIC routing, CMOS time sync, and testing for broken time
hardware (which presumably, does not happen in a
2007 Apr 18
0
[RFC, PATCH 23/24] i386 Vmi timer patch
In a virtualized environment, virtual machines will time share the system
with each other and with other processes running on the host system.
Therefore, a VM's virtual CPUs (VCPUs) will be executing on the host's
physical CPUs (pcpus) for only some portion of time.
The VMI exposes a paravirtual view of time to the guest operating systems
so that they may operate more effectively in a
2007 Apr 18
0
[RFC, PATCH 23/24] i386 Vmi timer patch
In a virtualized environment, virtual machines will time share the system
with each other and with other processes running on the host system.
Therefore, a VM's virtual CPUs (VCPUs) will be executing on the host's
physical CPUs (pcpus) for only some portion of time.
The VMI exposes a paravirtual view of time to the guest operating systems
so that they may operate more effectively in a