Displaying 1 result from an estimated 1 matches for "mleop4".
Did you mean:
loop4
2002 Feb 15
1
outer()
Hi all,
I tried to use outer() but it gave me wrong answer. Anyone can tell me
why? Thank you for your time.
> outer(a[1],b[1:2],f)
[,1] [,2]
[1,] 6903.15 6903.15
where
> a
[1] 0.5 2.0 4.0
> b
[1] -0.5 -1.5
> f
function(a1,b1){mleop4.fun(c(a1,b1,A[1],B[1],f1[1],f2[1],g[1],h[1]))}
The answer should be 6869.808, 6809.302
as shown below:
> outer(a[1],b[1],f)
[,1]
[1,] 6869.808
> outer(a[1],b[2],f)
[,1]
[1,] 6809.302
Or
> f(a[1],b[1])
[1] 6869.808
> f(a[1],b[2])
[1] 6809.302
>
Nancy
-.-.-....