Hi Petr,
Thanks for confirming that the integral is bounded. I was thinking about the
same thing.
However, this requires that 'sigma' is positive.
The actual problem occurred in my optimization routine, where i have set the
parameter
sigma=exp(para), where para is the logit of a uniform random
On Thu, Mar 22, 2012 at 04:17:20PM -0700, casperyc wrote:
> 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)) {
>
I'd imagine one could solve this problem analytically
(divergence/convergence *almost certainly* [hint cough!]closed
form value seems hard) but perhaps you want to loop over a matrix
instead:
v <- matrix(NA, ncol = length(mymu), nrow = length(mysigma))
rownames(v) <- mysigma
colnames(v) <- mym
3 matches
Mail list logo