Displaying 2 results from an estimated 2 matches for "eury".
Did you mean:
euro
2008 Jun 01
2
optim error - repost
...ith nls and it works (see below), but
I need to do it with optim. Keun-Hyung
# optim
vol<-rep(c(0.03, 0.5, 2, 4, 8, 16, 32), 3)
time<-rep(c(2,4,8),each=7)
p.mated<-c(0.47, 0.48, 0.43, 0.43, 0.26, 0.23, NA, 0.68, 0.62, 0.64, 0.58,
0.53, 0.47,
0.24, 0.8, 0.79, 0.71, 0.56, 0.74, 0.8, 0.47)
eury<-data.frame(vol=vol, time=time, p.mated=p.mated)
eury<-na.omit(eury); eury
p0<- c(f=0.87, b=0.1, d=10)
eury.fit <- function (f, time, vol)
{
f<-p[1]; b<-p[2]; d<-p[3]
p.mated = p[1] * ( (1 -
exp(-p[2]*time))-(p[2]/(p[2]-(p[3]/vol)))...
2008 Jun 01
2
optim error
...someone help me out with this?
Thanks. Keun-Hyung
> vol<-rep(c(0.03, 0.5, 2, 4, 8, 16, 32), 3)
> time<-rep(c(2,4,8),each=7)
> p.mated<-c(0.47, 0.48, 0.43, 0.43, 0.26, 0.23, "null", 0.68, 0.62, 0.64,
0.58, 0.53, 0.47,
+ 0.24, 0.8, 0.79, 0.71, 0.56, 0.74, 0.8, 0.47)
> eury<-as.data.frame(cbind(vol, time, p.mated))
> eury<-eury[-7,]; eury
vol time p.mated
1 0.03 2 0.47
2 0.5 2 0.48
3 2 2 0.43
4 4 2 0.43
5 8 2 0.26
6 16 2 0.23
8 0.03 4 0.68
9 0.5 4 0.62
10 2 4 0.64
11 4 4...