similar to: psigamma derivative

Displaying 20 results from an estimated 5000 matches similar to: "psigamma derivative"

2007 Oct 14
1
Extending deriv3()
Hello, I was wondering if the functions deriv3(), deriv() etc. could be extended to handle psigamma() and its special cases (digamma(), trigamma() etc.). From the error message it seems that 'psigamma' needs to be added to the derivatives table. This might be easy since psigamma() has a deriv argument. Additionally, this error message is also obtained when requesting for the Hessian of
2007 Jul 30
2
deriv, loop
Hi, 2 questions: Question 1: example of what I currently do: for(i in 1:6){sink("temp.txt",append=TRUE) dput(i+0) sink()} x=scan(file="temp.txt") print(prod(x)) file.remove("C:/R-2.5.0/temp.txt") But how to convert the output of the loop to a vector that I can manipulate (by prod or sum etc), without having to write and append to a file? Question 2: >
2011 Nov 17
3
Obtaining a derivative of nls() SSlogis function
Hello, I am wondering if someone can help me. I have the following function that I derived using nls() SSlogis. I would like to find its derivative. I thought I had done this using deriv(), but for some reason this isn't working out for me. Here is the function: asym <- 84.951 xmid <- 66.90742 scal <- -6.3 x.seq <- seq(1, 153,, 153) nls.fn <- asym/((1+exp((xmid-x.seq)/scal)))
2012 Jan 03
1
higher derivatives using deriv
Dear everyone, the following is obviously used to compute the nth derivative, which seems to work (deriv(sqrt(1 - x^2),x,n)) However, before using this, I wanted to make sure it does what I think it does but can't figure it out when reading the ?deriv info or any other documentation on deriv for that matter: deriv(expr, namevec, function.arg = NULL, tag = ".expr", hessian = FALSE,
2011 Apr 04
1
Deriving formula with deriv
Dear list, Hi, I am trying to get the second derivative of a logistic formula, in R summary the model is given as : ### >$nls >Nonlinear regression model >model: data ~ logistic(time, A, mu, lambda, addpar) >data: parent.frame() > A mu lambda >0.53243 0.03741 6.94296 ### but I know the formula used is #
2009 Jun 03
2
code for double sum
Hi R-users,   I wrote a code to evaluate double sum as follows:   ff2 <- function(bb,eta,z,k) { r <- length(z) for (i in 1:r) { sm1 <- sum((z[i]*bb/2)*(psigamma((0:k)+eta+1,deriv=0)/(factorial(0:k)*gamma((0:k)+eta+1))))  sm2 <- sum((besselI(z[i]*bb,eta)*log(z[i]*bb/2) - sm1)/besselI(z[i]*bb,eta))  sm2 } ff2(bb,eta,z,10)     but it gave me the following message:   >
2010 Jan 04
1
polygamma or Hurwitz zeta function
Hi, Is there any R library that is capable of handling polygamma function (Hurwitz zeta function also works)? I am aware of digamma(0 and trigamma(), but could not find more advanced versions. I'd appreciate any help. Hakan Demirtas
2003 Oct 17
2
nlm, hessian, and derivatives in obj function?
I've been working on a new package and I have a few questions regarding the behaviour of the nlm function. I've been (for better or worse) using the nlm function to fit a linear model without suppling the hessian or gradient attributes in the objective function. I'm curious as to why the nlm requires 31 iterations (for the linear model), and then it doesn't work when I try to add
2017 Feb 17
4
Wish List: Extensions to the derivatives table
The derivative table resides in the function D. In S+ that table is extensible because it is written in the S language. R is faster but less flexible, since that table is programmed in C. It would be useful if R provided a mechanism for extending the derivative table, or barring that, provided a broader table. Currently unsupported mathematical functions of one argument include expm1, log1p,
2004 Feb 29
1
digamma with negative arguments (PR#6626)
Full_Name: Chanseok Park Version: 1.8.1 OS: linux-gnu Submission from: (NULL) (130.127.112.183) digamma with any negative value does not give a right answer. It gives -1.797693e+308 for any negative arguments. For example, digamma(-1.1) gives -1.797693e+308. The right answer should be 10.15416 This bug can be easily fixed by using the following digamma identity. digamma(x) = digamma(1-x) -
2011 May 27
1
finding derivative of a data series in R
Dear All, I tried following for getting derivative of a polynomial in R i<- -10:10 x<-i*i*i+3*i*i+2 fun_spline<-splinefun(i,x) plot(x,type="l") lines(x,fx_spline(x, deriv=1), col='green') lines(x,fx_spline(x, deriv=2), col='green') Now when I plot 3*i*i + 6*i and 6*i + 6 the plot was not same for first deivative. where as the 2nd derivative was same Is this a
2007 Mar 20
2
Problems about Derivaties
Dear participants to the list, this is my problem: I want to obtain an expression that represents the second derivative of one function. With "deriv3" (package "stats") it is possible to evaluate the second derivative, but I do not know how I can get the (analytical) expression of this derivative. For example: Suppose that I have a function of this form:
2005 Jul 19
2
Taking the derivative of a quadratic B-spline
Hello, I have been trying to take the derivative of a quadratic B-spline obtained by using the COBS library. What I would like to do is similar to what one can do by using fit<-smooth.spline(cdf) xx<-seq(-10,10,.1) predict(fit, xx, deriv = 1) The goal is to fit the spline to data that is approximating a cumulative distribution function (e.g. in my example, cdf is a 2-column matrix with x
2007 Sep 03
2
Derivative of a Function Expression
Hi I am currently (for pedagogical purposes) writing a simple numerical analysis library in R. I have come unstuck when writing a simple Newton-Raphson implementation, that looks like this: f <- function(x) { 2*cos(x)^2 + 3*sin(x) + 0.5 } root <- newton(f, tol=0.0001, N=20, a=1) My issue is calculating the symbolic derivative of f() inside the newton() function. I cant seem to get R to
2003 Dec 18
1
NUMERIC DERIVATE
UseRs, I used the optim function valor.optim <- optim(c(1,1,1),logexp1,method ="BFGS",control=list(fnscale=-1),hessian=T); and I want to calculate the derivates, psi1<-valor.optim$par[1] psi2<-valor.optim$par[2] psi3<-valor.optim$par[3] a0=exp(psi1); a1=exp(psi2)/(20+exp(psi2)+exp(psi3)); a2=exp(psi3)/(20+exp(psi2)+exp(psi3))
2012 Nov 15
1
create function to solve derivative
Readers, A data set comprises A B C 10 6 .2 20 7 .4 30 8 .16 40 9 .0256 My requirement is to obtain the derivative for values of A with respect to B, create a function in R and plot this derivative against another variable (e.g. values in column C). Have searched the mailing list and found reference to a function 'D', but the help accessed via '?D' and '?deriv' does not
2008 Dec 27
1
indexed expression
Hello expeRts, I need generate symbolize the autocovariances matrix of a Gaussian ARMA(1,1), for derivate it and evaluate. I try this codes, but whitout sucess vacv<-NULL vacv[1]<-1-2*phi*theta-theta^2 vacv[2]<-(1-phi*theta)*(phi-theta) vacv[3:n]<-acv[2]*(phi^(1:(n-2))) facv<-list() for(i in 1:2)
2006 Nov 18
1
deriv when one term is indexed
Hi, I'm fitting a standard nonlinear model to the luminances measured from the red, green and blue guns of a TV display, using nls. The call is: dd.nls <- nls(Lum ~ Blev + beta[Gun] * GL^gamm, data = dd, start = st) where st was initally estimated using optim() st $Blev [1] -0.06551802 $beta [1] 1.509686e-05 4.555250e-05 7.322720e-06 $gamm [1] 2.511870 This works fine but I
2005 Jul 05
2
Derivative of a function
Suppose I have a simple function that returns a matrix, such as: test <- function(x){ return(matrix(c(x,x^2,x^3,x^4),2,2)) } so that test returns: [ x x^3 ] [ x^2 x^4 ] Is it possible for me to get the derivative of an expression such as: c(1,0) %*% test() %*% c(0,1) The vectors are used just to "index" the matrix. I don't want a value, but the expression to work with
2005 Sep 25
2
getting variable length numerical gradient
Hi all. I have a numerical function f(x), with x being a vector of generic size (say k=4), and I wanna take the numerically computed gradient, using deriv or numericDeriv (or something else). My difficulties here are that in deriv and numericDeric the function is passed as an expression, and one have to pass the list of variables involved as a char vector... So, it's a pure R programming