Skip to content
Back to formatted view

Raw Message

Message-ID: <000701c0263f$d3743f60$0201a8c0@Workgroup>
Date: 2000-09-24T15:55:12Z
From: Yves Gauvreau
Subject: Folding ?

Hi,

I need to write a function that would look something like this:

 S <- function(b=betas){
     expression(b[1] * f(b[2] * x * f(b[3] * x * f(...b[n-1] * x * f(b[n] *
x)))...)
}

Where n is the number of element in b.

Further I need to be able to evaluate S at some x numerically of course and
I need to use "deriv" and produce dS/dx such that I can evaluate it also at
some x.

I tried building the S expression manually to test the deriv (D) function,
evaluate them both and everything work's fine.

My trouble is automating the building of the expression S that is dependent
on the length of b.

Any suggestion are welcome.

Thanks in advance.

Yves Gauvreau

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._