📄 logit_dgp.ox
字号:
// This returns data that follow a logit model with the
// supplied parameters. n is the number of observations.
// Note how the binary 0/1 variable is generated so that
// it really follows the logit model
logit_dgp(const n, const theta)
{
decl k, x, y;
k = sizer(theta); //sizer returns the number of rows of theta
x = ones(n,1) ~ rann(n,k-1);
y = (1 ./ (1 + exp(-x*theta)) .> ranu(n,1));
return y ~ x;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -