Re: [R] outer function problems
I don't know that this is your problem, but I see a potential scoping issue: It is not obvious to me where Dk is getting n0 and w. I've solved this kind of problem in the past by declaring n0 and w as explicit arguments to Dk and then passing them explicitly via ... in outer. In general, I prefer to avoid accessing globals from within functions. This may not help you here, but it might help in the future. hope this helps. spencer graves Scott Norton wrote: I'm pulling my hair (and there's not much left!) on this one. Basically I'm not getting the same result t when I step through the program and evaluate each element separately than when I use the outer() function in the FindLikelihood() function below. Here's the functions: Dk- function(xk,A,B) { n0 *(A*exp(-0.5*(xk/w)^2) + B) } FindLikelihood - function(Nk) { A - seq(0.2,3,by=0.2) B - seq(0.2,3,by=0.2) k -7 L - outer(A, B, function(A,B) sum( (Nk*log(Dk(seq(-k,k),A,B))) - Dk(seq(-k,k),A,B) )) return(L) } where Nk - c(70 , 67 , 75 , 77 , 74 ,102, 75, 104 , 94 , 74 , 78 , 79 , 83 , 73 , 76) Here's an excerpt from my debug session.. Nk [1] 70 67 75 77 74 102 75 104 94 74 78 79 83 73 76 debug(FindLikelihood) L-FindLikelihood(Nk) debugging in: FindLikelihood(Nk) debug: { A - seq(0.2, 3, by = 0.2) B - seq(0.2, 3, by = 0.2) k - 7 L - outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), A, B))) - Dk(seq(-k, k), A, B))) return(L) } Browse[1] n debug: A - seq(0.2, 3, by = 0.2) Browse[1] n debug: B - seq(0.2, 3, by = 0.2) Browse[1] n debug: k - 7 Browse[1] n debug: L - outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), A, B))) - Dk(seq(-k, k), A, B))) Browse[1] sum((Nk * log(Dk(seq(-k, k),0.2,0.2))) - Dk(seq(-k, k), 0.2, 0.2)) # WHY DOES THIS LINE GIVE ME THE CORRECT RESULT WHEN I SUBSTITUTE 0.2, 0.2 FOR A AND B [1] 2495.242 Browse[1] outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), + A, B))) - Dk(seq(-k, k), A, B))) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48# BUT ELEMENT (1,1) WHICH SHOULD ALSO BE (A,B) = (0.2, 0.2), GIVES THE INCORRECT RESULT [2,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [3,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [4,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [5,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [6,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [7,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [8,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [9,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [10,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [11,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [12,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [13,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [14,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [15,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [,9][,10][,11][,12][,13][,14][,15] [1,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [2,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [3,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [4,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [5,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [6,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [7,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [8,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [9,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [10,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [11,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [12,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [13,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [14,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [15,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 Browse[1] As commented above, when I evaluate a single A,B element (i.e. A=0.2, B=0.2) I get a different result than when I use OUTER() which should also be evaluating at A=0.2, B=0.2?? Any help appreciated. I know I'm probably doing something overlooking something simple, but can anyone point it out??? Thanks! -Scott Scott Norton, Ph.D. Engineering Manager Nanoplex Technologies, Inc. 2375 Garcia Ave. Mountain View, CA 94043 www.nanoplextech.com [[alternative HTML version
Re: [R] outer function problems
Scott - I agree with Spencer Graves that there's a scoping issue here: Where does function Dk() pick up the values for n0 and w, and does it get them from the SAME place when it's called from inside FindLikelihood() as from outside ? But more important is this one: All arithmetic on vectors or matrices is done element by element; every matrix or array is treated as a vector (no 'dim' attribute) during this process, and the elements of shorter vectors are recycled as necessary (quoting from help(Arithmetic)). Therefore, Dk(seq(-k,k), 0.2, 0.2) should return a vector of length (2 * k + 1), and Nk * log(Dk()) # (I omit the arguments to Dk() here.) should produce a vector of length max(length(Nk), 2 * k + 1) in which element 1 of Nk is paired with xk = -k, element 2 of Nk is paired with xk = (-k + 1), et cetera. This product then has a vector of length (2 * k + 1) subtracted from it and the resulting vector is summed. Now, maybe you have promised to only call FindLikelihood() with an argument Nk of length 15 = (2 * k + 1), in which case all the lengths match and element i from Nk is always paired with the value (i - 8) in the first argument of Dk(), but there's certainly a lack of defensive programming here. An alternate way to calculate the grid of likelihood values which seems to be your intention is to explicitly build four four-dimensional arrays named A, B, xk and Nk, all with the same dimensions, and with the values changing along only one dimension in each array. Then do whatever arithmetic you want with these four arrays (such as the expressions inside Dk() and FindLikelihood() and collapse the result by summing over rows or slices or whatever at the end. The functions array(), aperm(), matrix() and '%*%' are useful in this process. This business of four or five-dimensional arrays is one I use routinely. The result is equivalent to as.vector(outer( ...)), but it forces you to think carefully about the various dimensions. HTH - tom blackwell - u michigan medical school - ann arbor - On Mon, 27 Oct 2003, Scott Norton wrote: I'm pulling my hair (and there's not much left!) on this one. Basically I'm not getting the same result t when I step through the program and evaluate each element separately than when I use the outer() function in the FindLikelihood() function below. Here's the functions: Dk- function(xk,A,B) { n0 *(A*exp(-0.5*(xk/w)^2) + B) } FindLikelihood - function(Nk) { A - seq(0.2,3,by=0.2) B - seq(0.2,3,by=0.2) k -7 L - outer(A, B, function(A,B) sum( (Nk*log(Dk(seq(-k,k),A,B))) - Dk(seq(-k,k),A,B) )) return(L) } where Nk - c(70 , 67 , 75 , 77 , 74 ,102, 75, 104 , 94 , 74 , 78 , 79 , 83 , 73 , 76) Here's an excerpt from my debug session.. Nk [1] 70 67 75 77 74 102 75 104 94 74 78 79 83 73 76 debug(FindLikelihood) L-FindLikelihood(Nk) debugging in: FindLikelihood(Nk) debug: { A - seq(0.2, 3, by = 0.2) B - seq(0.2, 3, by = 0.2) k - 7 L - outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), A, B))) - Dk(seq(-k, k), A, B))) return(L) } Browse[1] n debug: A - seq(0.2, 3, by = 0.2) Browse[1] n debug: B - seq(0.2, 3, by = 0.2) Browse[1] n debug: k - 7 Browse[1] n debug: L - outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), A, B))) - Dk(seq(-k, k), A, B))) Browse[1] sum((Nk * log(Dk(seq(-k, k),0.2,0.2))) - Dk(seq(-k, k), 0.2, 0.2)) # WHY DOES THIS LINE GIVE ME THE CORRECT RESULT WHEN I SUBSTITUTE 0.2, 0.2 FOR A AND B [1] 2495.242 Browse[1] outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), + A, B))) - Dk(seq(-k, k), A, B))) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48# BUT ELEMENT (1,1) WHICH SHOULD ALSO BE (A,B) = (0.2, 0.2), GIVES THE INCORRECT RESULT [2,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [3,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [4,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [5,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [6,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [7,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [8,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [9,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [10,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [11,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [12,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [13,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [14,] 58389.48 58389.48
RE: [R] outer function problems
Thanks Spencer and Tom for your help! Besides the other errors, I realized last night that I'm making a fundmental error in my interpretation of the outer function. The following short code snippet highlights my confusion. f-function(A,B) { sum(A+B) } outer(1:3,2:4,f) [,1] [,2] [,3] [1,] 45 45 45 [2,] 45 45 45 [3,] 45 45 45 I had *thought* that outer() would give: [,1] [,2] [,3] [1,] 3 45 [2,] 4 56 [3,] 5 67 ie. take each combination from A = 1,2,3; B=2,3,4 such as A=1,B=2 put it in the sum function, get [1,1]=3 ... Then grab A[2]=2,B[1]=2, put them in the sum() function to get [2,1]=4, etc... That seems to be the way the instructions explain outer, i.e. element-by-element computation of FUN() Description: The outer product of the arrays 'X' and 'Y' is the array 'A' with dimension 'c(dim(X), dim(Y))' where element 'A[c(arrayindex.x, arrayindex.y)] = FUN(X[arrayindex.x], Y[arrayindex.y], ...)'. Since my interpretation is *definitely* wrong, could someone put in words how OUTER handles the argument vectors and the functional call with reference to the preceding example? Also, what I need to happen in my code is to actually take each combination of elements from vectors, A and B, and feed them repeatedly into a function, generating a matrix of results. How then do I do that? Thanks in advance!!! -Scott Scott Norton, Ph.D. Engineering Manager Nanoplex Technologies, Inc. 2375 Garcia Ave. Mountain View, CA 94043 www.nanoplextech.com -Original Message- From: Spencer Graves [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 8:13 AM To: Scott Norton Cc: [EMAIL PROTECTED] Subject: Re: [R] outer function problems I don't know that this is your problem, but I see a potential scoping issue: It is not obvious to me where Dk is getting n0 and w. I've solved this kind of problem in the past by declaring n0 and w as explicit arguments to Dk and then passing them explicitly via ... in outer. In general, I prefer to avoid accessing globals from within functions. This may not help you here, but it might help in the future. hope this helps. spencer graves Scott Norton wrote: I'm pulling my hair (and there's not much left!) on this one. Basically I'm not getting the same result t when I step through the program and evaluate each element separately than when I use the outer() function in the FindLikelihood() function below. Here's the functions: Dk- function(xk,A,B) { n0 *(A*exp(-0.5*(xk/w)^2) + B) } FindLikelihood - function(Nk) { A - seq(0.2,3,by=0.2) B - seq(0.2,3,by=0.2) k -7 L - outer(A, B, function(A,B) sum( (Nk*log(Dk(seq(-k,k),A,B))) - Dk(seq(-k,k),A,B) )) return(L) } where Nk - c(70 , 67 , 75 , 77 , 74 ,102, 75, 104 , 94 , 74 , 78 , 79 , 83 , 73 , 76) Here's an excerpt from my debug session.. Nk [1] 70 67 75 77 74 102 75 104 94 74 78 79 83 73 76 debug(FindLikelihood) L-FindLikelihood(Nk) debugging in: FindLikelihood(Nk) debug: { A - seq(0.2, 3, by = 0.2) B - seq(0.2, 3, by = 0.2) k - 7 L - outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), A, B))) - Dk(seq(-k, k), A, B))) return(L) } Browse[1] n debug: A - seq(0.2, 3, by = 0.2) Browse[1] n debug: B - seq(0.2, 3, by = 0.2) Browse[1] n debug: k - 7 Browse[1] n debug: L - outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), A, B))) - Dk(seq(-k, k), A, B))) Browse[1] sum((Nk * log(Dk(seq(-k, k),0.2,0.2))) - Dk(seq(-k, k), 0.2, 0.2)) # WHY DOES THIS LINE GIVE ME THE CORRECT RESULT WHEN I SUBSTITUTE 0.2, 0.2 FOR A AND B [1] 2495.242 Browse[1] outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), + A, B))) - Dk(seq(-k, k), A, B))) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48# BUT ELEMENT (1,1) WHICH SHOULD ALSO BE (A,B) = (0.2, 0.2), GIVES THE INCORRECT RESULT [2,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [3,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [4,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [5,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [6,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [7,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [8,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [9,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [10,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [11,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [12,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [13,] 58389.48 58389.48 58389.48 58389.48 58389.48
RE: [R] outer function problems
On Tue, 28 Oct 2003, Scott Norton wrote: Thanks Spencer and Tom for your help! Besides the other errors, I realized last night that I'm making a fundmental error in my interpretation of the outer function. The following short code snippet highlights my confusion. f-function(A,B) { sum(A+B) } outer(1:3,2:4,f) [,1] [,2] [,3] [1,] 45 45 45 [2,] 45 45 45 [3,] 45 45 45 I had *thought* that outer() would give: [,1] [,2] [,3] [1,] 3 45 [2,] 4 56 [3,] 5 67 This is actually a FAQ ie. take each combination from A = 1,2,3; B=2,3,4 such as A=1,B=2 put it in the sum function, get [1,1]=3 ... Then grab A[2]=2,B[1]=2, put them in the sum() function to get [2,1]=4, etc... That seems to be the way the instructions explain outer, i.e. element-by-element computation of FUN() Description: The outer product of the arrays 'X' and 'Y' is the array 'A' with dimension 'c(dim(X), dim(Y))' where element 'A[c(arrayindex.x, arrayindex.y)] = FUN(X[arrayindex.x], Y[arrayindex.y], ...)'. Since my interpretation is *definitely* wrong, could someone put in words how OUTER handles the argument vectors and the functional call with reference to the preceding example? As the description says, outer() constructs *one* call to FUN, replicating all the arguments. As the Details section says 'FUN' must be a function (or the name of it) which expects at least two arguments and which operates elementwise on arrays. Your function f() doesn't. Also, what I need to happen in my code is to actually take each combination of elements from vectors, A and B, and feed them repeatedly into a function, generating a matrix of results. How then do I do that? One general-purpose way is to use mapply outer(a,b, function(ai,bj) mapply(f,ai,bj)) The reason this isn't the default is that it is fairly slow. If your function f() can be vectorised then that will give much better performance. For example, compare outer(a,b, function(ai,bj) mapply(sum,ai,bj)) and outer(a,b, +) on largish a and b. An automatic solution *has to* use a loop, and length(a)*length(b) evaluations of the function. -thomas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] outer function problems
I'm pulling my hair (and there's not much left!) on this one. Basically I'm not getting the same result t when I step through the program and evaluate each element separately than when I use the outer() function in the FindLikelihood() function below. Here's the functions: Dk- function(xk,A,B) { n0 *(A*exp(-0.5*(xk/w)^2) + B) } FindLikelihood - function(Nk) { A - seq(0.2,3,by=0.2) B - seq(0.2,3,by=0.2) k -7 L - outer(A, B, function(A,B) sum( (Nk*log(Dk(seq(-k,k),A,B))) - Dk(seq(-k,k),A,B) )) return(L) } where Nk - c(70 , 67 , 75 , 77 , 74 ,102, 75, 104 , 94 , 74 , 78 , 79 , 83 , 73 , 76) Here's an excerpt from my debug session.. Nk [1] 70 67 75 77 74 102 75 104 94 74 78 79 83 73 76 debug(FindLikelihood) L-FindLikelihood(Nk) debugging in: FindLikelihood(Nk) debug: { A - seq(0.2, 3, by = 0.2) B - seq(0.2, 3, by = 0.2) k - 7 L - outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), A, B))) - Dk(seq(-k, k), A, B))) return(L) } Browse[1] n debug: A - seq(0.2, 3, by = 0.2) Browse[1] n debug: B - seq(0.2, 3, by = 0.2) Browse[1] n debug: k - 7 Browse[1] n debug: L - outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), A, B))) - Dk(seq(-k, k), A, B))) Browse[1] sum((Nk * log(Dk(seq(-k, k),0.2,0.2))) - Dk(seq(-k, k), 0.2, 0.2)) # WHY DOES THIS LINE GIVE ME THE CORRECT RESULT WHEN I SUBSTITUTE 0.2, 0.2 FOR A AND B [1] 2495.242 Browse[1] outer(A, B, function(A, B) sum((Nk * log(Dk(seq(-k, k), + A, B))) - Dk(seq(-k, k), A, B))) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48# BUT ELEMENT (1,1) WHICH SHOULD ALSO BE (A,B) = (0.2, 0.2), GIVES THE INCORRECT RESULT [2,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [3,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [4,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [5,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [6,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [7,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [8,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [9,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [10,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [11,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [12,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [13,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [14,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [15,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [,9][,10][,11][,12][,13][,14][,15] [1,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [2,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [3,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [4,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [5,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [6,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [7,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [8,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [9,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [10,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [11,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [12,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [13,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [14,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 [15,] 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 58389.48 Browse[1] As commented above, when I evaluate a single A,B element (i.e. A=0.2, B=0.2) I get a different result than when I use OUTER() which should also be evaluating at A=0.2, B=0.2?? Any help appreciated. I know I'm probably doing something overlooking something simple, but can anyone point it out??? Thanks! -Scott Scott Norton, Ph.D. Engineering Manager Nanoplex Technologies, Inc. 2375 Garcia Ave. Mountain View, CA 94043 www.nanoplextech.com [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help