Description Usage Arguments Value Examples
estimate.normal.regression
fits a standard linear model by OLS (ordinary least square);
estimate.laplace.regression
fits a standard linear model by LAD (least absolute deviations);
the scale parameter is estimated by maximum likelihood.
estimate.logistic.regression
fits a standard linear model by maximum likelihood when the errors
are modeled as having a logistic distribution.
estimate.extremevalue.regression
fits a standard linear model by maximum likelihood when the errors
are modeled as having an extreme value distribution with standard cdf given by F(x) = exp(-exp(x)) .
estimate.weibull.regression
fits a Weibull model by maximum likelihood when the log of
scale parameter is linearly predicted. The procedure is equivalent to taking logs and doing extreme value
regression as above.
estimate.gamma.regression
estimate the parameters in a Gamma regression model
which fits link(E(y))= x beta. "link" must be one of "log","identity", "inverse".
A Gamma glm gets initial estimates which are improved by Maximum Likelihood.
estimate.exp.regression
estimate the parameters in an exponential regression model
which fits link(E(y))= x beta. "link" must be one of "log","identity", "inverse".
A Gamma glm is used for fitting.
1 2 3 4 5 6 7 8 9 10 11 12 13 | estimate.normal.regression(y, x, fit, fit.intercept = TRUE)
estimate.gamma.regression(y, x, fit, fit.intercept = TRUE, link = "log")
estimate.exp.regression(y, x, fit, fit.intercept = TRUE, link = "log")
estimate.logistic.regression(y, x, fit, fit.intercept = TRUE, detail = FALSE)
estimate.laplace.regression(y, x, fit.intercept = TRUE)
estimate.weibull.regression(y, x, fit.intercept = TRUE)
estimate.extremevalue.regression(y, x, fit.intercept = TRUE)
|
y |
A univariate response. |
x |
A design matrix which is not expected to have a column of 1s. |
fit.intercept |
Logical; if TRUE, an intercept term is added. |
Estimated dispersion or sd or scale or inverse dispersion and coefficients of a linear regression.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | n = 500
p = 3
beta = c(1,2,3)
x = rnorm(n*(p-1))
x = c(rep(1,n),x)
x = matrix(x,n,p)
# OLS regression
mean = x%*%(beta)
#apply the link to get the mean
#generate data with that mean,
sd = 2
y =rnorm(n,mean=mean,sd=sd)
estimate.normal.regression(y=y,x=x)
# LAD regression
library(L1pack)
y =L1pack::rlaplace(n=n, location=mean, scale=sd)
estimate.laplace.regression(y=y,x=x,FALSE)
# Gamma regression
alpha = 3
scale=exp(x %*% beta) / alpha
y =rgamma(n=n,shape=alpha,scale=scale)
estimate.gamma.regression(y=y,x=x,intercept=FALSE)
# Exponential regression
y =rexp(n=n,rate=1/exp(mean))
estimate.exp.regression(y=y,x=x)
# Weibull regression
y = rweibull(n=n,shape=1,scale=exp(mean))
estimate.weibull.regression(y=y,x=x)
# Extreme Value regression
y = log(rweibull(n=n,shape=1,scale=exp(mean)))
estimate.extremevalue.regression(y=y,x=x)
# Logistic regression
y = rlogis(n=n,location=mean,scale=2)
estimate.logistic.regression(y=y,x=x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.