Dear Sir/Madam,

i am learning to use a statistical sampling-modle(arms in HI)
But i have a problem with the "indFunc"(bounds of the convex support).
I have found a good example of c code using "arms" function and try to
program the example in R.
If you are interested, you can find the c code from arms usage(P.155-162)
But i always get the error message:
error at convex.bounds(y.start,dir=1,indFunc,...): x not in the support of
indFunc

the R code :
####simulate intercept mu
#####starting values of mu: mu<-c(0,-2,-4,.....)
for (k in 1:K){
for (t in 1:25){
if(k==1){
          n_MU[t]<-firmsCCC[t]     -----used in the density function(Mudens)
          N_MU[t]<-defCCC[t]       -----used in the density function(Mudens)
          MUl=mu[2]
          MUr=50
        }
      else if(k==2){
          n_MU[t]<-firmsB[t]
          N_MU[t]<-defB[t]
          MUl=mu[3]
         MUr=mu[1]
   }
     else if...
     ...
          }
Muprev<-mu[k]
mu[k]<- arms(Muprev,Mudens,function(xm,...)(xm>MUl)*(xm<MUr),1)
}
#########In the examples of the package the bounds of the convex support are
fest numbers,
######## but here the bounds MUl and MUr are variable and they are updated
after every iteration, what i have
never found in other cases.

best regards!!!!

Yuan Hu

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to