Displaying 20 results from an estimated 7097 matches for "derivatives".
2001 Apr 06
2
symbolic manipulations
Hi All,
I copied code from an Splus manual to take symbolic derivatives:
my.deriv <- function( mathfunc, var )
{
tmp <- substitute(mathfunc)
name <- deparse(substitute(var))
D(tmp, name)
}
(The code also w...
2012 Jan 03
1
higher derivatives using deriv
...SE,
...)
This doesn't seem to include an "order of derivative" argument, in fact, in
the examples section,
it is outlined, how one can build a higher deriv. function oneself...
Any hints are much appreciated!
alex
--
View this message in context: http://r.789695.n4.nabble.com/higher-derivatives-using-deriv-tp4256118p4256118.html
Sent from the R help mailing list archive at Nabble.com.
2012 Mar 16
2
[LLVMdev] tablegen question
Trying to resolve some general tablegen questions.
Consider the test case for Tablegen called eq.td
class Base<int V> {
int Value = V;
}
class Derived<string Truth> :
Base<!if(!eq(Truth, "true"), 1, 0)>;
def TRUE : Derived<"true">;
def FALSE : Derived<"false">;
If I process this through tablegen I get:
------------- Classes
2012 Mar 15
1
eigenvalues of matrices of partial derivatives with ryacas
Hello,
I am trying to construct two matrices, F and V, composed of partial
derivatives and then find the eigenvalues of F*Inverse(V). I have the
following equations in ryacas notation:
> library(Ryacas)
> FIh <- Expr("betah*Sh*Iv")
> FIv <- Expr("betav*Sv*Ih")
> VIh <- Expr("(muh + gamma)*Ih")
> VIv <- Expr("muv*Iv...
2009 May 10
4
Partial Derivatives in R
Quick question:
Which function do you use to calculate partial derivatives from a model
equation?
I've looked at deriv(), but think it gives derivatives, not partial
derivatives. Of course my equation isn't this simple, but as an example,
I'm looking for something that let's you control whether it's a partial or
not, such as:
somefunction(y~a+bx, wi...
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)))
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
#
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
2012 Mar 23
0
[LLVMdev] tablegen question
>From my understanding, NAME is a special builtin entry and dedicated for
things related multiclass,
So, is the following rewrite what you want?
class Base<int V> {
int Value = V;
}
class Derived<string Truth> :
Base<!if(!eq(Truth, "true"), 1, 0)>;
multiclass Derived_m<string T> {
def #NAME# : Derived<T>;
}
defm TRUE :
2012 Nov 06
2
Question on callNextMethod
I don't understand why I get the following results. I define two classes
'Base' and 'Derived', the latter of which 'contains' the first. I then
define a generic method 'test' and overload it for each of these classes. I
call 'callNextMethod()' in the overload for Derived. From the output, it
appears that the overload for Base gets called twice. Why is
2005 Aug 26
0
[LLVMdev] Mapping of class derivated and interfaces
> Hi! i'm tring to figure out how classes and dependencies
> can be mapped to llvm.
> [snip]
> how do i encode a function that takes "base" type
> so that it also takes "derived" ?
You'll notice that your function doesn't take an object of type base,
but a pointer to it. This is important - in a language such as LLVM
where actual structures can be
2017 Mar 19
2
outer not applying a constant function
...stg <- outer(xg, yg, function(x,y) 1.0)
Error in outer(xg, yg, function(x, y) 1) :
dims [product 16] do not match the length of object [1]
Of course there are simpler ways to construct a constant matrix, that is not my point.
It happens for me in the context of generating matrices of partial derivatives, and if on of these partial derivatives happens to be constant it fails.
So e.g this works:
library(Deriv)
f <- function(x,y) (x-1.5)*(y-1)*(x-1.8)+(y-1.9)^2*(x-1.1)^3
fx <- Deriv(f,"x")
fy <- Deriv(f,"y")
fxy <- Deriv(Deriv(f,"y"),"x")
fxx <...
2005 Aug 25
5
[LLVMdev] Mapping of class derivated and interfaces
Hi! i'm tring to figure out how classes and dependencies can be mapped to llvm.
I've read on docs that nesting can be used:
class base { int Y; };
class derived : base { short Z; };
becomes:
%base = type { int }
%derived = type { %base, short }
That's ok, but now the question is: how do i encode a function that
takes "base" type so that it also takes "derived"
2005 Aug 04
2
Adding "sum" to derivatives table
Hi,
Trying this:
deriv(expression(sum(x)), "x")
Gives the error message:
Function 'sum' is not in the derivatives table
I'd like to add it, is this difficult? If not, where is the derivatives
table?
However, give how basic "sum" is, I suspect it would have been added if
it were straightforward. Do functions in the derivatives table need to
be vectorized? i.e. given a vector of length n, t...
2010 Jul 29
2
how to get higher derivatives with "deriv"
...rouble implementing a function which computes the k-th derivative of a specified function f and returns it as a function. I tried to adapt what I found under ?deriv but could not get it to work. Here is how it should look like:
## specify the function
f <- function (x,alpha) x^alpha
## higher derivatives
DD <- function(expr, variable, order = 1) {
if(order < 1) stop("'order' must be >= 1")
if(order == 1) deriv(expr, variable)
else DD(deriv(expr, variable), variable, order - 1)
}
## compute the second derivative of f
f.prime.prime <- DD(f,"x",2)
##...
2005 Aug 26
3
[LLVMdev] Mapping of class derivated and interfaces
> In any case when you
> want to obtain a base pointer to a "derived" object (where derivation
> is implemented as you showed - with nesting) it's simply a matter of
> using getelementptr to obtain a pointer to the nested base object and
> using that.
Umm ok, but i've the strange feeling that i'm missing something..
First a simple question: getelementptr with
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
2005 Jul 19
2
Taking the derivative of a quadratic B-spline
...mates.
The reason I don't want to use smooth.spline is that there is no way
to impose constraints (e.g. >=0, <=1, and monotonicity) as there is
with COBS. However, since COBS doesn't have the 'deriv =' option, the
only way I can think of doing it with COBS is to evaluate the
derivatives numerically.
Regards,
Jim McDermott
2004 Sep 10
4
Re: nice idea
Okay, I deleted most of this thread, so I was waiting for another message to
respond to, so unfortunately this will be out of place in the thread.
This is in response to Miroslav's idea about variable block sizes. I may be a
bit out of my league here as I'm just starting to look at how the actual
encoding gets done. But it seems to me that you could make a decent guess
about when
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))