Student Support Forum: 'extracting parts of elements from a list' topicStudent Support Forum > General > "extracting parts of elements from a list"

 Next Comment > Help | Reply To Topic
 Author Comment/Response Andy Wilson 03/08/99 06:23am I'd like to extract the parameter values that I get when I use FindMinimum on a Likelihood function. I think it amounts to extracting part of an element from a list. Beyond that, I can't figure out how to do it. Do you have any suggestions? I use the code below to find the minimum of a function of two variables, gm and gsd. I would like to take the values of gm and gsd at the minimum, assign them variable names, and use them in later functions. In[208]:= sally = FindMinimum[-func4,{gm,60,10,100},{gsd,4,2,100}] Out[208]= {110.635,{gm->54.2512,gsd->3.08502}} What I would ultimately like to do is to pull out 54.2512 and name it ''gmmle'' and pull out 3.08502 and name it ''gsdmle'' so that I can use them as variables in a likelihood ratio test. I tried to do this by using In[216]:= lucy = Flatten[sally] Out[216]= {110.635, gm--> 54.2512, gsd--> 3.08502} and then In[219]:= marcy = lucy[[2]] Out[219]= gm--> 54.2512 But here I get stuck. How do I separate the number from ''gm-->''? Thanks in advance for any suggestions you may have. Andy Wilson URL: ,

 Subject (listing for 'extracting parts of elements from a list') Author Date Posted extracting parts of elements from a list Andy Wilson 03/08/99 06:23am Re: extracting parts of elements from a list Forum Modera... 03/09/99 6:42pm
 Next Comment > Help | Reply To Topic