[R] Summing functions of lists

2010-11-13 Thread Hiba Baroud
Hi I'm trying to sum functions of lists with different lengths. Here is a simplified example of the problem: r=list(1:3,1:5,1:2) r [[1]] [1] 1 2 3 [[2]] [1] 1 2 3 4 5 [[3]] [1] 1 2 x=function(i,j) sum(j*r[[i]])# x is a function of two parameters: i j

[R] nlm is

2010-06-15 Thread Hiba Baroud
Hello, I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]). So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter. My function

[R] Error in nlm : non-finite value supplied by 'nlm'

2010-06-15 Thread Hiba Baroud
Hello, I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]). So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter. My function is