Displaying 2 results from an estimated 2 matches for "mymu".
Did you mean:
mmu
2012 Mar 22
2
Quicker way to apply values to a function
Hi all,
myint=function(mu,sigma){
integrate(function(x) dnorm(x,mu,sigma)/(1+exp(-x)),-Inf,Inf)$value
}
mymu=seq(-3,3,length(1000))
mysigma=seq(0,1,length(500))[-1]
k=1
v=c()
for (j in 1:length(mymu)) {
for (i in 1:length(mysigma)) {
v[k]=myint(mymu[j],mysigma[i])
k=k+1
}
}
Basically, I want to investigate for what values of mu and sigma, the
integral is divergent.
Is there another way to do thi...
2004 Feb 03
1
Error in f(x, ...) : subscript out of bounds
...ret[(x[lenR]):(nn+x[lenR])])^2 else rsq <- NA
sigsq[length(gsvR$ret)] <- 22 * sum(wd * rsq)
sigsq <- na.omit(sigsq)
sigsq <- sigsq[-1]
# Above this line can be specified differently
Ret <- gsvR$ret[1:length(sigsq)]
mymu <- (theta[1]+theta[2]*(sigsq))
n <- length(wd)#/22
ll <- numeric(length(sigsq))
for (j in 1:length(sigsq)) {
ll[j] <- -(n/2) * log(2*pi) - (n/2) * log(sigsq[j]) - 0.5 *
sum(((Ret - mymu[j])^2)/(sigsq[j]))
}
l <...