Re: [R] generating phi using function()

2015-03-30 Thread Daniel Nordlund
ce the formula shown in the attached file where the exponents are w1 and w2, respectively. Thanks for your help From: jlu...@ria.buffalo.edu [mailto:jlu...@ria.buffalo.edu] Sent: 30 March 2015 16:01 To: T.Riedle Cc: r-help@r-project.org; R-help Subject: Re: [R] generating phi using function

[R] generating phi using function()

2015-03-30 Thread T.Riedle
ched file where the exponents are w1 and w2, respectively. Thanks for your help From: jlu...@ria.buffalo.edu [mailto:jlu...@ria.buffalo.edu] Sent: 30 March 2015 16:01 To: T.Riedle Cc: r-help@r-project.org; R-help Subject: Re: [R] generating phi using function() Your function phi has 5 argume

Re: [R] generating phi using function()

2015-03-30 Thread JLucke
> phi(c(1, 1), 44L, 1) Error in phi(c(1, 1), 44L, 1) : argument "k" is missing, with no default > "T.Riedle" Sent by: "R-help" 03/29/2015 08:59 AM To "r-help@r-project.org" , cc Subject [R] generating phi using function() Hi e

Re: [R] generating phi using function()

2015-03-29 Thread Daniel Nordlund
The argument 'K' is missing since you are only passing four arguments to the phi() function, but you defined it with five formal parameters. It looks like the argument 'j' is not necessary in the function. It is an unnecessary carry-over from the summation notation and it is never used in th

Re: [R] generating phi using function()

2015-03-29 Thread Jim Lemon
Hi T., Your translation of the formula looks okay, and the error message is about a missing argument. Perhaps you have not included the necessary arguments to "phi" in the call to "mls". Jim On Sun, Mar 29, 2015 at 11:59 PM, T.Riedle wrote: > Hi everybody, > I am trying to generate the formula

[R] generating phi using function()

2015-03-29 Thread T.Riedle
Hi everybody, I am trying to generate the formula shown in the attachment. My formula so far looks as follows: phi <- function(w1, w2, j, k, K){ zaehler <- (k/K)^(w1-1)*(1-k/K)^(w2-1) nenner <- sum( ((1:K)/K)^(w1-1)*(1-(1:K)/K)^(w2-1)) return( zaehler/nenner ) } Unfortunately something must be w