similar to: numericDeriv alters result of eval in R 4.0.1

Displaying 20 results from an estimated 1000 matches similar to: "numericDeriv alters result of eval in R 4.0.1"

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];
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,
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
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
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
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,
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
2018 Sep 12
2
Environments and parallel processing
While using parallelization R seems to clone all environments (that are normally passed by reference) that are returned from a child process. In particular, consider the following example: library(parallel) env1 <- new.env() envs2 <- lapply(1:4, function(x) env1) cl<-makeCluster(2, type="FORK") envs3 <- parLapply(cl, 1:4, function(x) env1) envs4 <- parLapply(cl, 1:4,
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
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
2009 May 08
2
partial mantel tests "Ecodist"
Hi all, I'm searching for a little clarification on partial mantel tests (ecodist package) I've a distance matrix (x,y), and several others containing environmental/chemical variables. Based on the help file, and the package instructions I've managed to implement the tests as; var1 ~ env1 + space to partial out the effect of space and test the relationship between the
2012 May 27
2
Unable to fit model using “lrm.fit”
Hi, I am running a logistic regression model using lrm library and I get the following error when I run the command: mod1 <- lrm(death ~ factor(score), x=T, y=T, data = env1) Unable to fit model using ?lrm.fit? where score is a numeric variable from 0 to 6. LRM executes fine for the following commands: mod1 <- lrm(death ~ score, x=T, y=T, data = env1) mod1<- lrm(death ~
2010 Aug 05
1
plot points using vis.gam
Hello, I'm trying to illustrate the relationships between various trait and environment data gathered from a number of sites. I've created a GAM to do this: gam1=gam(trait~s(env1)+s(env2)+te(env1,env2)) and I know how to create a 3D plot using vis.gam. I want to be able to show points on the 3D plot indicating the sites that the data came from. I can do this on a 2D plot when there is one
2015 Sep 29
3
making object.size() more meaningful on environments?
Hi, Currently object.size() is not very useful on environments as it always returns 56 bytes, no matter how big the environment is: env1 <- new.env() object.size(env1) # 56 bytes env2 <- new.env(hash=TRUE, size=75000000L) object.size(env2) # 56 bytes env3 <- list2env(list(a=runif(25000000), L=LETTERS)) object.size(env3) # 56 bytes This makes it pretty useless on
2010 Jul 06
0
Help needed with numericDeriv and optim functions
Hello All: I have defined the following function (fitterma as a sum of exponentials) that best fits my cumulative distribution. I am also attaching the "xtime" values that I have. I want to try two things as indicated below and am experiencing problems. Any help will be greatly appreciated. Best, Parmee ----------------------- *fitterma <- function(xtime) { * *a <-
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.
2008 Oct 12
2
numeric derivation
Hello, I don't understand the description / help-text for the numericDeriv() function. Why is there a new environment used? And what is meant with an environment here? Is it similar or the same as a local workspace, like an environment in functional languages? And why is it needed here? numericDeriv could just calculate the difference bewtween two values and divide this difference by the
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
2015 Sep 29
1
making object.size() more meaningful on environments?
Hi Gabe, On 09/29/2015 02:51 PM, Gabriel Becker wrote: > Herve, > > The problem then would be that for A a refClass whose fields take up N > bytes (in the sense that you mean), if we do > > B <- A > > A and B would look like the BOTH take up N bytes, for a total of 2N, > whereas AFAIK R would only be using ~ N + 2*56 bytes, right? Yes, but that's still a *much*
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