ndata = data.frame(x = rnorm(nn <- 200))
ndata = transform(ndata, y = rnorm(nn, mean = 1-3*x, sd = exp(1+0.2*x)))
fit = vglm(y ~ x, normal1, ndata, trace = TRUE)
coef(fit, matrix = TRUE)
# Generate data from N(mu = theta = 10, sigma = theta) and estimate theta.
theta = 10
ndata = data.frame(y = rnorm(100, m = theta, sd = theta))
fit = vglm(y ~ 1, normal1(lsd = "identity"), ndata,
constraints = list("(Intercept)" = rbind(1, 1)))
coef(fit, matrix = TRUE)
Run the code above in your browser using DataLab