Re: [R] S-PLUS code in R

2008-07-26 Thread Fotis Papailias
Dear R-Users, the problem I was facing it's solved. Actually, the code was ok from the first time. You define it as: lw <- function(h, x, im) { peri1 <- per(x) len <- length(x) m <- len/im peri <- peri1[2:(m+1)] z <- c(1:m) freq <- ((2*pi)/len) * z result <- log(sum(f

Re: [R] S-PLUS code in R

2008-07-26 Thread Fotis Papailias
I made some experiments and I conclude that if I change the interval (e.g. say c(-100,100)!!!) then the minimum value changes in respect to the simulated data. So, probably the problem lies in the "optimal" values of the interval? On Sat, Jul 26, 2008 at 1:00 PM, Fotis Papailias <[EMAIL PROTECTE

Re: [R] S-PLUS code in R

2008-07-26 Thread Fotis Papailias
Hi, thanks for your message. You mean to rewrite the function like that: lw <- function(d, x, im) { peri1 <- per(x) len <- length(x) m <- len/im peri <- peri1[2:(m+1)] z <- c(1:m) freq <- ((2*pi)/len) * z result <- log(sum(freq^(2*d-1)*peri))-(2*d)/m * sum(log(freq))

Re: [R] S-PLUS code in R

2008-07-26 Thread Duncan Murdoch
On 26/07/2008 7:40 AM, Fotis Papailias wrote: Dear R-users, I have sent another mail some hour ago about a matlab Code I was trying to translate in R. Actually I have found a simpler code originally written in S-PLUS for the same function. Author's page -> http://math.bu.edu/people/murad/method

[R] S-PLUS code in R

2008-07-26 Thread Fotis Papailias
Dear R-users, I have sent another mail some hour ago about a matlab Code I was trying to translate in R. Actually I have found a simpler code originally written in S-PLUS for the same function. Author's page -> http://math.bu.edu/people/murad/methods/locwhitt/ ===