[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Beginning Programming Advice

From   "Thomas Jacobs" <>
To   StataList <>
Subject   st: Beginning Programming Advice
Date   Sun, 14 Oct 2007 18:43:33 -0500


I have the following problem that I am attempting to program in Stata
and I am a newbie:

I have a collection of companies with trading day data composed of
accounting information, market equity values, and equity volatility
values which I currently insheet into Stata.  I need to write a
routine to perform a 2 variable in 2 unknown newton-raphson or
equivalent procedure to iteratively solve for asset value and
volatility using non-linear equations.  I know how to produce the
routine to do so in a pseudo-code sense, where I am stuck is how to
proceed in Stata.

Should I be attempting to write a function that I will then call in a
generate command so that every company-tradeday instance will have
populated values?  If so, do I need to use a function to produce a
matrix to bring back multiple values from the function (the target
asset value and volatility as well as any other information such as
remaining error or iterations completed)?   If so would I then
generate a matrix variable which I would set equal to the output of
this function?

Is there a better way to proceed?  Can this be done in a do file as I
bring the raw data in rather than operating on the data in memory
after using the insheet command?  Any suggestions would be greatly


 Thomas Jacobs
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index