Difference between revisions of "Estimating Unobserved Complementarities between Entrepreneurs and Venture Capitalists Matlab Code"

From edegan.com
Jump to navigation Jump to search
Line 1: Line 1:
 
Main Project here: [[Estimating Unobserved Complementarities between Entrepreneurs and Venture Capitalists]]
 
Main Project here: [[Estimating Unobserved Complementarities between Entrepreneurs and Venture Capitalists]]
 +
 +
==Important contractions==
 +
 +
*GMM: Generalized Method of Moments
 +
*MSM: Markov State Model
 +
*MLE: Maximum Likelihood Estimation
 +
*GA: Genetic Algorithm
 +
*SE:
 +
  
 
==How to run==
 
==How to run==
  
First, apparently, you need a gurobi license, which can be obtained [http://www.gurobi.com/registration/academic-license-reg here].
+
First, you need a gurobi license, which can be obtained (free) [http://www.gurobi.com/registration/academic-license-reg here].
  
 
In master.m, edit the options section to reflect what you want the code to do. Then run it.
 
In master.m, edit the options section to reflect what you want the code to do. Then run it.
Line 24: Line 33:
 
'''task:''' Can take the values {'data', 'monte', 'monte_data'}.
 
'''task:''' Can take the values {'data', 'monte', 'monte_data'}.
  
'''estimator:''' Can take the values {'MLE', 'MSM', 'compare'}.
+
'''estimator:''' Can take the values {'MSM'}.
* MSM stands for Markov State Model
 
* MLE stands for Maximum Likelihood Estimation
 
* compare
 
** compare is valid only under task='monte'
 
'''use_solver:''' Can take the values {'fminunc', 'ga', 'patternsearch', 'cmaes'}.
 
* GA stands for genetic algorithm
 
* fminunc
 
* patternsearch
 
* cmaes
 
'''error_type''' (currently hard coded as 1): 1 for match specific errors, with the error distribution following an exchangeable structure. var(e) = sig^2, and cov(e,e') = 1/4*sig^2. 2 for agent specific errors, with the error structure of match <i, j> as sig*ei*ej.
 
  
===strip_master.m===
+
'''use_solver:''' Can take the values {'ga'}.
 +
 
 +
'''error_type''' (currently hard coded as 1 and isn't fully written to support 2): 1 for match specific errors, with the error distribution following an exchangeable structure. var(e) = sig^2, and cov(e,e') = 1/4*sig^2. 2 for agent specific errors, with the error structure of match <i, j> as sig*ei*ej.
 +
 
 +
===strip_master.m (deleted in readjusted code)===
 
Seems to be a version of master.m that only uses the parameters task = 'monte_data', use_solver = 'ga', and estimator = 'MSM' (which apparently are the only values that work for master.m, but unverified).
 
Seems to be a version of master.m that only uses the parameters task = 'monte_data', use_solver = 'ga', and estimator = 'MSM' (which apparently are the only values that work for master.m, but unverified).
 +
 +
===msmf_corr_coeff.m===
 +
 +
This is the fitness function. Takes a vector and returns a scalar.
  
 
==Location/Structure of Data==
 
==Location/Structure of Data==

Revision as of 19:38, 24 January 2018

Main Project here: Estimating Unobserved Complementarities between Entrepreneurs and Venture Capitalists

Important contractions

  • GMM: Generalized Method of Moments
  • MSM: Markov State Model
  • MLE: Maximum Likelihood Estimation
  • GA: Genetic Algorithm
  • SE:


How to run

First, you need a gurobi license, which can be obtained (free) here.

In master.m, edit the options section to reflect what you want the code to do. Then run it.

Location/structure of the code

The old codebase is located in

 E:\McNair\Projects\MatchingEntrepsToVC\OriginalCode

The new codebase is located in

 E:\McNair\Projects\MatchingEntrepsToVC\AdjustedCode

The new-new codebase is located in

 E:\McNair\Projects\MatchingEntrepsToVC\ReAdjustedCode

Some of this code is just library code (prefix mtimesx).

master.m

options section

task: Can take the values {'data', 'monte', 'monte_data'}.

estimator: Can take the values {'MSM'}.

use_solver: Can take the values {'ga'}.

error_type (currently hard coded as 1 and isn't fully written to support 2): 1 for match specific errors, with the error distribution following an exchangeable structure. var(e) = sig^2, and cov(e,e') = 1/4*sig^2. 2 for agent specific errors, with the error structure of match <i, j> as sig*ei*ej.

strip_master.m (deleted in readjusted code)

Seems to be a version of master.m that only uses the parameters task = 'monte_data', use_solver = 'ga', and estimator = 'MSM' (which apparently are the only values that work for master.m, but unverified).

msmf_corr_coeff.m

This is the fitness function. Takes a vector and returns a scalar.

Location/Structure of Data

Pro tip: running the command

 whos -file filename

from a matlab session will tell you the contents of any .mat file.

There are two of both psdata and dyad_tech_mkt_data, corresponding to 4 industries or 5 industries. You can find them in

 E:\McNair\Projects\MatchingEntrepsToVC\OriginalCode\FVEIC4 data

and

 E:\McNair\Projects\MatchingEntrepsToVC\OriginalCode\FVEIC5 data

The one wanted should be copied into the code directory:

 E:\McNair\Projects\MatchingEntrepsToVC\AdjustedCode

psdata.mat contains

  • vc: the number of VC's in each market, in the form of (10, 12, 13, ...): the first market has 10 VC's, the second market has 12 VC's....
  • firm: the number of firms in each market, (13, 14, ...): the first market has 13 downstream, the second 14 downstream... this is a one (VC) to many (firms) market, and the number of firms in each market is at least as many as the number of firms
  • m_id: unused, I'm guessing the market id

dyad_tech_mkt_data.mat variables used include:

  • pvc_exp_n, mean_pvc_exp_n, std_pvc_exp_n
  • lnfpat, mean_lnfpat:
  • mean_m_dist_1000, std_m_dist_1000:
  • mean_exp_sector, std_exp_sector:
  • m_match: contains the matching outcome: for each dyad (firm VC pair), 0 means not matched and 1 means matched. The variable asg in the code contains the matching outcomes of all markets. The matching outcomes are delineated by firms using the position data N1 (vc' from psdata)and N2 (firm' from psdata).

Location/Structure of Output

empirics_match_specific_1st_stage_ga:

empirics_match_specific_2nd_stage_ga:

empirics_match_specific_1st_stage_cmaes:

empirics_match_specific_2nd_stage_cmaes:

empirics_match_specific_with_se: Saved if task = 'data'

type_(error_type)_monte_mktsize_(mktsize)_K_(K)_S_(S)_rep_(montenn):