Nov 13

Finite mixture models in Matlab

Tag: Uncategorizedadmin @ 11:29 am

Here are some options for estimating finite mixture models in Matlab. Some allow simple univariate analysis while others allow finite regression mixtures. You have a choice of an EM or Bayesian approach.

EM algo for 1-dimensional Gaussian Mixture Model

GMMBayes

Bayesian model (contact author for code)


Jul 20

Unzip password-protected file in Mac OS X

Tag: Uncategorizedadmin @ 10:50 am

Just use the Terminal:

Quick tip: the default Archive Utility in Leopard can’t handle password protected files. If you don’t have a copy of stuffit to hand, you can always open up the terminal and use the command unzip [filename] which will prompt you for the password.


Jan 17

CRSP dates to good dates in Stata

Tag: stataadmin @ 11:07 am

Here is some simple code to transform those pesky CRSP dates (YYYYMMDD) to Stata compatible dates: insheet using "/Users/michaelewens/Archive/UCSD/returns_paper/data/stock_indices/sp_daily.csv"
rename caldt date
* Date Transformation gen year = floor(date/10000)
 gen month = floor((date - year*10000)/100)
 gen day = floor(date - year*10000 - 100*month)
 * replace the date
 replace date = mdy(month, day, year) 
format date %td


Nov 26

Mac Hints

Tag: mac, matlabadmin @ 8:00 pm

Here are some things I learned today about my Mac:


Nov 26

Fix a slow Matlab UI and scrolling in Mac OS X

Tag: mac, matlabadmin @ 9:45 am

The new Mac OS Leopard uses a different graphics engine which Matlab 7.4+ does not like.  Working in the UI is painful.  No more!  Just follow this simple solution to bring back smooth, fast scrolling.


Nov 23

Get PHP working on Leopard (Mac OS X)

Tag: mac, phpadmin @ 7:48 pm

After I upgraded to Leopard from 10.4.x, my PHP processes stopped working.  The new OS overwrote some configuration files.  Check out this post on how to get things working again.


Oct 07

Stata Bundle for Textmate

Tag: mac, stataadmin @ 12:28 pm

Working with Stata’s do file editor is one of the most painful exercises. The lack of syntax highlighting means a large do file is basically unreadable. Enter TextMate. One can edit and send .do files to Stata directly from a Textmate project. If you have the standard Stata Intercooled, then download and install the Stata bundle. Next, go to “Bundles –> Bundle Editor –> Show Bundle Editor” and find the Stata bundle. Select the “Send File to Stata” command and edit the first line “StataMP” to read “Stata.” Do the same with the “Send Selection to Stata.” Now open Stata, cd to the project directory, open your do file in TextMate and start editing. Bask in the glory that is syntax-highlighting.


Sep 04

Corporate Venture Capital in an Upswing

Tag: venture capitaladmin @ 11:09 am

Corporations like Google and Cisco and spending a increased amount of their cash reserves on start-ups in the US and abroad.  Moreoever, in contrast to the corporate VC activity of the late 1990s, they are taking a longer-term view

Intel has restructured its fund to emphasize financial returns and is investing in follow-up rounds in its portfolio companies—something it didn’t do before. “There’s no strategic value unless each individual investment is successful,” says Intel Capital President Arvind Sodhani. “A bankrupt company is not very strategically valuable to Intel—or to anybody for that matter.”

Read the rest.


Sep 01

Convert strings to integers in Stata

Tag: stataadmin @ 6:47 pm

Suppose you have a string variable with a finite number of values (e.g. US states, industry, etc).  The encode command plus the generate command will create a new variable that assigns unique ids to each string value: 

encode your_string_variable, gen(new_string_as_int) 

The labels in the edit/browse view will look like strings, so make sure you use ‘nolabel’ on any export or tab commands. 


Aug 22

Edit Remote Files in TextMate Tabs

Tag: mac, os x, tricksadmin @ 4:48 pm

If you want to edit remote files in TextMate (say with Transmit over FTP), opening them up usually means individual windows.  No more.  Follow these simple instructions and you can have a project with tabs whenever you edit a remote file.


Next Page »