Do you know how to fix the code in order to get correct standard dev and bias. Your help would be appreciated. parest=estmat[:,];
gamma_mle=parest[1]; c_mle=parest[2]; lm3_mle=parest[3]; lm4_mle=parest[4];
gamma_bias=gammav-gamma_mle; c_bias=cv-c_mle; lm3_bias=lambda3v-lm3_mle; lm4_bias=lambda4v-lm4_mle;
onev=j(nrow(estmat),1,1); devv=(estmat-onev*parest)#(estmat-onev*parest);
varr=devv[+,]/(nrow(estmat)-1); stdev=sqrt(varr);
gamma_sd=stdev[1]; c_sd=stdev[2]; lm3_sd=stdev[3]; lm4_sd=stdev[4];
res1[nc,]=lambda4v||cv||gammav||lambda3v||gamma_bias||gamma_sd||lm3_bias||lm3_sd||c_bias||c_sd||lm4_bias||lm4_sd;
"
... View more
Hello Xia Keshan, I don't think so the reason is what you have mensioned, since I defined a nother function (lf2(x)) and I GOT THE SAME RESULTS. I think the reason is the function itself. Thanks!
... View more
Hello, Attached is the code I'm using to find MLEs. I'm trying to find the bias and standard deviation for given parameters. my problem is: whenever I changed the initial values for the parameters, I get a different answer (output). For example, if I change the initial values ( lambda30, lambda40) from 0.1,0.1 to 0.4,0.4 , respectively, I will get different answers. Could you figure out why? Can you make a refinement for the code? Sincere thanks!
... View more
Thank you professor. I really apreaciate your help. Yes, as you said I want to simulate data but unfortunately the inverse CDF is not in closed form.
... View more
Hello, I'm trying to solve a nonlinear implicit equation with one varible by using the FROOT function. The flowing is my code: proc iml; start f1(x) global(y); f=(2*y - 1 - x**0.5 + (1-x)**0.5); return(f); finish f1; y = rand('Uniform'); interval = {0 1}; z = froot('f1',interval); print z; I got a nice result. For each y, I got z. What I'm trying to do is to generate for example a random sample of 100 random varible z by using 100 y's of random numbers that are uniformly distributed. In other words, can I use the do loop to get 100 z's using 100 y's. If the froot function gives just one solution, what do you recommend in order to solve this equation 100 times with differnt 100 inputs y. THANK YOU!
... View more