man/examples/logLik_ex.R

# Simulate a simple dataset
set.seed(5)
x <- rnorm(100)
y <- x + rnorm(100)

# Run the model
mod <- glm(y ~ x, method = "cirls.fit", Cmat = list(x = 1), lb = 0)

# Loglikelihood and AIC
logLik(mod)
AIC(mod)

# AIC with a different degree of freedom
ll <- logLik(mod, df = "o")
AIC(ll)

Try the cirls package in your browser

Any scripts or data that you put into this service are public.

cirls documentation built on Sept. 13, 2025, 1:09 a.m.