Dear all,
How can I simulate several random variables from a given density function? Assume a bivariate density function x+y defined for x >= 0 & x <= 1 & y >= 0 & y <= x.
The command may work something like this:
clear
set seed 1234
set obs 1000
f = x + y for x >= 0 & x <= 1 & y >= 0 & y <= x
gen x y = some command, denfun(f)
Any ideas would be highly appreciated.
Sincerely,
Alex
Related Posts with Simulate random variables from a given multivariate density function
PPML vs Spatial gravity modelHello everyone, Generally, we know that the PPML (Poisson Pseudo Maximum likelihood) estimation is …
using lagged values to find 5 year growth rate when there are missing years in the dataHi, I want to create a variable that shows the 5 year growth rate. My first thought is to write som…
replacing missing with non-missing within the same variableBelow is an example of the dataset (for some reason the columns are not lining up with the variables…
Generate a variable based on id number and its chosen indicatorDear Stata users, I encounter this question when using one-to-one matching. The variable id is numb…
Collinearity with long-run averageHi, I am creating a long-run average of crime rates disaggregated which are reported at the distric…
Subscribe to:
Post Comments (Atom)
0 Response to Simulate random variables from a given multivariate density function
Post a Comment