Displaying 2 results from an estimated 2 matches for "mean_mc_1".
2017 Aug 10
1
"Help On optim"
...:((2*l))]*
* coeff.vector=parametersDf[(2*l+1):(3*l)]*
* val_df=data.frame()*
* sum_prob=0*
* for (j in 1:l){*
*
val=(coeff.vector[i,j]*(dnorm(x,mu.vector[i,j],sqrt(var.vector[i,j]))))*
* sum_prob=sum_prob+val*
* } *
* return(sum_prob)*
*}*
*#segment1*
*val1=optim(parametersDf$mean_mc_1[1],** fn=xnorm,*
* method = "BFGS")*
*I am not getting right result from optim function. Is there something I
can do?*
*Thanks in Advance for the help *
[[alternative HTML version deleted]]
2017 Aug 11
0
Problem in retrieving list parameters
Hello,
I am having some problem in retrieving the list elements
Code
Mean_of_mc is a list as described below
mean_mc_1 mean_mc_2 mean_mc_3
mean_mc 0.9577246 2.000516 2.962521
mean_mc 7.957725 9.000516 9.962521
optim(par=c(lVal=2, mu=Mean_of_mc),
fn=xnorm,
method = "BFGS", control=list(fnscale=-1))
xnorm= function(par)
{
print(par)
x=par['parl']
l=par['lVal...