# NOT RUN {
# Example 1: Let F be a standard normal cumulative distribution function then
f_N<-function(s){dnorm(s, mean = 0,sd = 1)} # density function of N(0,1)
y<-rnorm(100)
g_id<-function(y){y}
g_log<-function(y){log(y)}
mleGAD(y,f=f_N,g=g_id) # For identity-link
mleGAD(rexp(100,0.1),f=f_N,g=g_log,lower = 0, upper = Inf) # For log-link
# Example 2: Let F be a standard Laplace cumulative distribution function then
f_La<-function(s){0.5*exp(-abs(s))} # density function of Laplace(0,1)
mleGAD(y,f=f_La,g=g_id) # For identity-link
mleGAD(rexp(100,0.1),f=f_La,g=g_log,lower = 0, upper = Inf) # For log-link
# }
Run the code above in your browser using DataLab