Hello R helpers,
I need to evaluate the Hypergeometric Function of the 2nd kind (Tricomi
confluent hypergeometric function). Therefore I'm using the kummerU
function from the fAsianOptions package. It seems to me that kummerU is
giving wrong results. Here's an example:
library("fAsianOptions")
ku
desired results (res_1, res_2) again in a list. I
tried mapply, but I don't get it running. Can anybody help?
Thanks and best regards,
Carlos
--
-----
Carlos Nasher
Buchenstr. 12
22299 Hamburg
tel:+49 (0)40 67952962
mobi
umber of zeroes not max number of
> consecutive zeroes.
>
> Regards
> Petr
>
>
> > -Original Message-
> > From: arun [mailto:smartpink...@yahoo.com]
> > Sent: Friday, November 01, 2013 2:17 PM
> > To: R help
> > Cc: PIKAL Petr; Carlos Nas
If I apply your function to my test data:
ID <- c(1,1,1,2,2,3,3,3,3)
x <- c(1,0,0,0,0,1,1,0,1)
data <- data.frame(ID=ID,x=x)
rm(ID,x)
f2 <- function(x) {
max( rle(x == 0)$lengths )
}
with(data, tapply(x, ID, f2))
the result is
1 2 3
2 2 2
which is not what I'm aiming for. It should be
1 2 3
er of consecutive zeros?
Different approaches are also welcome. Since the real dataframe is quite
large, a fast solution is appreciated.
Best regards,
Carlos
--
---------
Carlos Nasher
Buchenstr. 12
22299 Hamburg
tel:+49 (0)40 679529
xp(lgamma(r+x)-lgamma(r)+r*(log(alpha_zero)-log(alpha_zero+T))-x*log(alpha_zero+T)+s*(log(beta_zero)-log(beta_zero+T)))+exp(lgamma(r+x)-lgamma(r)+r*log(alpha_zero)+log(s)+s*log(beta_zero)+log(integral$V1))
> f <- -sum(log(L))
> return (f)
> }
>
>
> Best
>
> Simon
&
5, -0.02, -0.02)
fit <- nmkb(par=params, fn=Likelihood_cov, lower=c(0.0001, 0.0001, 0.0001,
0.0001, -Inf, -Inf), upper=c(Inf, Inf, Inf, Inf, Inf, Inf), x=data$x,
tx=data$tx, T=data$T, IS=IS)
##########
Maybe you could give me a h
, beta=10))
'Error in grad.default(objectivefunction, coef) :
function returns NA at
1e-040.001013016911639890.0003166929388711890.000935163594829395 distance
from x.
In addition: Warning message:
In optimx(par = c(0.5, 10, 0.7, 10), fn = function (p) :
Gradient not computable after method Nelder-Mead'
Best regard
unlist(integral2, use.names=FALSE)
But this doesn't work properly. I'd glad if you have any hints how to get
this done.
Many thanks and best regards,
Carlos
--
-----
Carlos Nasher
Buchenstr. 12
22299 Hamburg
tel:
Dear R Helpers,
I'm struggling with a data preparation problem. I feel that it is a quite
easy task but I don't get it done. I hope you can help me with that.
I have a data frame looking like this:
ID <- c(1,1,1,2,2,3,3,3,3)
T <- c(1,2,3,1,4,3,5,6,8)
x <- rep(1,9)
df <- data.frame(ID,T,x)
>df
I
10 matches
Mail list logo