Archive for October, 2006

Ashley? Ugly?

Friday, October 27th, 2006 -- By Jade

?????????, ?????????????. ?????, ??????, ??????????. ??????????????, ?????????????, ???bye bye??.

?, ?????, ??Ashley???Ugly….sigh! ?????.

???????, ????.

????????????, ?, 10???????, ??????????. ??????????, ???????. ????????????. ??4????????, ????, ????. ??????????????????????: ??, ????. ????????, ?????????, ???.

????, ???????, ?????????????????, ?????????????(??,??????). ???????, ?????????. ???????????, ??10?????????????. ????????, ?????. ??????????, ???????????????, ??????????.

?5???????????, ???, ????. ???, ???, ???. ?????????. ?! ??. ??????, ??????????, ???????.???????????????, ??????????????.
???, ???, ????.

???, ???????. ???????. ????????????.
???, ??, ???????.

???, ?????. ?????, ????. ???????????. ?????????
??,????????, ??????????????????. ????. ???????????.

??, ??????????????, ????, ????????????????, ??????????.

?????????????.

??, ????2?????????????” ??” ?. ??, ?????????, ???????????: ??(??).??????, ???. ??????. ?????, ???, ?????????????. ?????????, ????????.

??, ???????, ????????????????????, ???????. ???????, ?????. ???????????, ??????????????.

???????????????. ?????, ???????. ???????.

????????????????????, ???????. ?????. ???Natalie, ??????????.

??? ?????????

Thursday, October 26th, 2006 -- By Jade

?????????????????????????????????????

?????????????? ??????????????2????2000?4??????8??????????????????????????????????

6???????????????????????????????????

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????2??????????????????????????????????????

???????????????????????????235?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????*????????????????????????????????????????????????????1,200?

??????,????,??????.??, ????????, ??????, ????, ???????????. ????????, ????????, ??:??,??????????? ??????, ??????: ??????700?, ??????@#$%

???, ???, ???????????. ???????????. ??????, ???,? ????, ???????, ???????????. ???????????. ??????, ?????????????. ???, ????????: ??, ????, ????????, ???????. ???, ???????, ??: ???, ?????????. ???300?, ??????. ????????. ????????. ???????, ????????, ???????…..???????????, ????????, ????300??. ?, ???, ??. ???????????????.

????????…..?????????, ??????. ?????????, ????, ????,??????: ???????, ???. ???????: ???. ????????????????, ????

?, ???: ?????, ??, ????????

??6?, ????????????. ??LP????, ??????. ???, ???????????????. ??????????. ??????????, ?????. ???, ???????? ?????????????? ???????????????? ???????????????. ????: ???????????. ??, ??????????????????????. ??????, ??????????. ????????, ??????????. ??, ??????, ??????, ??5??. ??,???????

??, ??????????.

??, ????, ?2?????????????780RMB. ??(???)??1??1??, ??. ?????, ??, ??600????.

WINBUGS and SAS

Thursday, October 26th, 2006 -- By ET

Recently I need to work on a very complicated hierarchical nonlinear model, the estimation requires complex estimation procedures. Therefore I resorted to the so called MCMC technique (Markov Chain Monte Carlo).

Winbugs is very powerful, and I absolutely like it. The problem with winbugs is that I need to use several softwares and go through a complicated process to test different models, different initial values, and the parameters to be estimated goes from 160 to more than 300.

First I create my regression datasets in MySQL (sometimes with a little help in ACCESS), then use a PERL script to turn them into winbugs format (I can post this program some time later, it is too ugly at this stage). After that I click the buttons in winbugs to do the study, if you ever used winbugs, you know the pain of clicking them. Due to the large number of parameters, the iterations are quite time consuming. I’m a cautious person, so I usually run 10,000 burn-ins, then use 50,000 iterations to calculate the estimates. After that, I have to select the text in the log window and paste the result to Excel, clean up the format and import to ACCESS or MySQL. Match the result with my regression covariates and export to SAS. In SAS, I do some simple regression and bootstrap analysis of the result. Usually, I will have some idea to test the next model, then I have to go over the whole process again from the beginning.

If you think this is a pain, you should see how I first used winbugs, I did not know how to estimate the 160 parameters, so I run 80 times of the model, each time obtain two values.

Today, I finally decided to put an end to this manual way of doing research. So I searched ways to do it combining WINBUGS and SAS. There are quite a few useful links on WINBUGS website regarding SAS. But they are relatively independent. I hope to write this small article to provide a unified way of using WINBUGS with SAS.

First of all, to automate the estimation, I need to be able to convert SAS datasets to winbugs format then submit my models within SAS, and without having to click on the winbugs window. The results should be read back to SAS.

SUSBug.sas

The best candidate to submit the winbugs command, and gets it translated to a script is provided here by S.M. Mwalili. The documentation is given here. The idea is to submit a command of the following format:

%SasBugs(Work = c:/BugsSAS/schools/, Chains = 3, Burn_in =3000, Updates = 9000, Parameters = mu,sigma.theta theta, Coda = T, Dens = F, debug = F);

The problem with this solution is that you have to have everything (the model, the data, the init values) readily saved in winbugs format in that WORK directory. The model can be put there easily, but it still is a headache to convert and generate the data file. Another issue is that this procedure does not help to read back the results.

Rodney Sparapani’s and Matt Hayat’s SAS macros for BUGS

To convert between SAS and winbugs data format, we need some other macros available here. (Documentation)

_LEXPORT: Export a SAS dataset to a “list” data file
CODA2SAS: Converting CODA files to a SAS dataset

BUGStoSAS: converting BUGS output files to a sas dataset (Documentation)
SAStoCODA: Converting a sas dataset to CODA input files (Documentation)

Installation Instructions:

  1. unzip them into a directory that I’ll call SASMACRO, but you can call it anything that you want
  2. add this line to your SAS configuration file, sasv8.cfg or sasv9.cfg
    -insert sasautos ‘SASMACRO’
  3. several people have written to me about their broken SAS installations; if SAS can’t find it’s own SAS macros, like LOWCASE, try adding this (Unix):
    -insert sasautos ‘!SASROOT/sasautos’
    or this (Windows):
    -insert sasautos ‘!SASROOT\core\sasmacro’
  4. now, call the SAS macros from your SAS program like:
    %_decoda(out=dataset, chains=2, infile=coda);
    %_limport(infile=alc.tbl, file=import.sas, out=alc);
    %_lexport(file=alc.txt, data=alc, var=status alcgrams);
    %_sexport(data=matrix, var=col1-col5, file=m.struct);

Zhiyong Zhang’s SAS WINBUGS pages

Zhiyong Zhang at Virginia Tech improved the Rodney’s macros and made them available here.

Two files got modified. The first one is _sexport.sas. It was changed to output the sample size (N) and number of variables (T) in the WinBUGS format data file. The second one is coda2sas.sas. It was modified to generate the history plot for each parameter.

Here gives a few links at to other resources here.

A good summary about how to implement the whole thing is in a PDF file here.

				

???????

Monday, October 23rd, 2006 -- By Jade

??????????????? ????????????????????????? ??????????????

?????????????????????????????????????????????????????????????????????? ??????????? ????????????????????????????????????????

?????2?????????? ???? ????????????? ??????????????????????????????????????????????? ????????????????????????????

????????????????????????fans???

????????????????????????????????????????????????????????????????????????????????????????????????????????2????????????????????fan????????????????? ??????????, just kiding?

??????????????????????????????????????????????

overheard…

Monday, October 16th, 2006 -- By ET

“Civilization advances by extending the number of important operations that we can do without thinking about them.”

-Alfred North Whitehead, 1911

Nobel Peace Prize 2006

Friday, October 13th, 2006 -- By ET

is given to Muhammad Yunus and Grameen Bank for their efforts to create economic and social development from below.

In the press release from sweden:

Loans to poor people without any financial security had appeared to be an impossible idea. From modest beginnings three decades ago, Yunus has, first and foremost through Grameen Bank, developed micro-credit into an ever more important instrument in the struggle against poverty. Grameen Bank has been a source of ideas and models for the many institutions in the field of micro-credit that have sprung up around the world.

The fundamental idea of this micro-credit mechanism is actually quite intriguing from the perspective of economics.

First of all, it puts trust into people who have no ways to show their trustworthiness. This demands a great leap of faith in people. In general financing situations, the lending party uses all kinds of means to ensure that when anything goes wrong, the borrowing party is liable and can be hold responsible for the problem. Usually, the borrowing party has to put his/her assets (house, business or other valuable financial assets like bonds, etc.) down. When the borrowing party does not own anything, a collateral is needed to take up the responsibility. However, in poor economies, a collateral is not so easy to find. Not only it is implausible for individuals to take up all the risk of financing people who own nothing, but these poorest people seldom know any one who are able to offer the help. In a perfectly rational system, offering loans to these people is simply impossible, as there is obvious benefit for people to borrow money, but the cost (at least monetary cost) too them is minimal. Even with a strong legal system, it is simply not economically viable for the banks to loan to these people — suppose you can put anyone who can not repay to jail, the bank still lose the money. This is why I was so amazed to learn about this mechanism when I first read about the idea of the Grameen Bank (from an article written by Jean-Jacques Laffont: Laffont, Jean-Jacques, 2003. “Collusion and group lending with adverse selection,” Journal of Development Economics, Elsevier, vol. 70(2), pages 329-348, April.)

The major consequence of not being able to offer loans to these people is that a great amount of social welfare can not be realized. These people not owning any assets does not mean they do not possess the ability to create social value. Given enough startup funds (and in the cases for the poor, usually not much is needed), they can generate enterprise that may benefit others and most importantly of all, may sustain themselves and their families. People often attribute the power of the small and medium enterprises and the sustainable development of the developed economies to the availability of financial support from loans and venture capitals. Without the $100,000 check written by Larry Ellison on the breakfast table for Google, we will not be able to use the wonderful services now. There are so many examples to show the importance of financing the “talented but poor”.

The Grameen Bank idea implements incentive mechanisms to ensure the repayments in an innovative way. The basic idea is to offer group-lending contracts with joint liability. Traditionally, the role of taking care of the poor lies in the governments, there are many setbacks associated with this appoach. Inefficiency, corruption, mis-management, etc. are not the focus of this article. The point is that centralized decision-making, though theoretically interesting, does not function so well in the real world. The value of Grameen Bank lies in the possibility to use market-based forces to help the poor.

For more information about this, please refer to Wikipedia entry at http://en.wikipedia.org/wiki/Grameen_Bank

???????

Tuesday, October 3rd, 2006 -- By Jade

9?29?????? ????????? ?????????????10?2?? ???????? ?????????? ?????????????????????????????????? ???????????????? ????????? ???????11?20????????????????? 1?????????????

????????????????2??????????????????????????????????????????? ?????????????????????????????4????????????????????????????????????????? ??????? ????????????????????

????? ??????????????????? ???????????????????????????????


BlogTimer
You are visitor number several since September 1, 2001

Copyright Xiaoquan (Michael) Zhang, 2004-2010. All rights reserved.
All trademarks property of their owners.