Domanda

I see that Stata has binormal command for computing bivariate cumulative distribution function but not corresponding (official) command for computing bivariate probability density function. (Please let me know if I am wrong). I know that there is a user-written function bnormpdf for that but unlike the official commands like normalden for univariate probability density function, the variable to be generated appears at the right hand side.

bnormpdf x1 x2, rho(.2) dens(pdf_b) double

I was wondering whether this pattern will have any effects when programming, for example maximum likelihood (this may seem too broad).

È stato utile?

Soluzione

It's not clear what you are worried about, but in Stata terms you have functions and commands the wrong way round here.

  1. Commands and functions are totally disjoint in Stata.

  2. A command may call a function and in Stata that is the only way to use a function. But a function may not call a command.

  3. Users cannot write functions in Stata. (Users can write egen functions and Mata functions but neither of those categories is relevant here.) Only Stata's developers can write Stata functions.

Note that some (occasional) users of Stata prefer to ignore Stata's own terminology in discussing Stata, perhaps because they regard it as perverse. I don't recommend that. Stata's terminology choices are open to discussion, but you need to understand Stata's terminology before you can discuss it.

All that said, I don't think there is much to add on your question.

http://www.stata.com/manuals13/dfunctions.pdf documents binormal() which is, in Stata terms, a function, not a command.

bnormpdf (SSC) is in contrast not a function but a command.

However, nothing stops you using either or both within your own programs. The syntax is necessarily different, so you must use bnormpdf to create a new variable before you use that variable for your own purposes. You can't use a call to bnormpdf within some other command.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top