n = 200
x = rnorm(n)
y = rnorm(n, mean=1-3*x, sd=exp(1+0.2*x))
fit = vglm(y ~ x, normal1)
coef(fit, matrix=TRUE)
# Generate a random sample from a N(mu=theta, sigma=theta)
# distribution with theta=10. Then estimate theta.
theta = 10
y = rnorm(100, m=theta, sd=theta)
fit = vglm(y ~ 1, normal1(lsd="identity"),
constraints=list("(Intercept)"=rbind(1,1)))
coef(fit, matrix=TRUE)
Run the code above in your browser using DataLab