Description Usage Arguments Value Author(s) See Also Examples
View source: R/logLik.frontier.R
Extract the log-likelihood value(s) from stochastic frontier models
returned by frontier
.
1 2 |
object |
an object of class |
which |
character string. Which log-likelihood value should be returned? 'ols' for the log-likelihood value of the parameters estimated by OLS, 'grid' for the log-likelihood value of the parameters obtained by the grid search (only if no starting values were provided), 'start' for the log-likelihood value of the starting values of the parameters specified by the user (only if starting values were provided), or 'mle' for the log-likelihood values of the parameters estimated by Maximum Likelihood. |
newParam |
optional vector of parameters.
If this argument is provided by the user, the log-likelihood value
of the model |
... |
currently unused. |
logLik.frontier
returns an object of class logLik
,
which is a numeric scalar (the log-likelihood value) with 2 attributes:
nobs
(total number of observations in all equations) and
df
(number of free parameters, i.e. length of the coefficient vector).
Arne Henningsen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # example included in FRONTIER 4.1
data( front41Data )
# SFA estimation with starting values obtained from a grid search
sfaResult <- sfa( log( output ) ~ log( capital ) + log( labour ),
data = front41Data )
logLik( sfaResult, which = "ols" )
logLik( sfaResult, which = "grid" )
logLik( sfaResult )
# SFA estimation with starting values provided by the user
sfaResult2 <- sfa( log( output ) ~ log( capital ) + log( labour ),
data = front41Data, startVal = 0.9 * coef( sfaResult ) )
logLik( sfaResult2, which = "ols" )
logLik( sfaResult2, which = "start" )
logLik( sfaResult2 )
# evaluate log likelihood function for a user-provided parameter vector
logLik( sfaResult, newParam = 0.9 * coef( sfaResult ) )
# equal to logLik( sfaResult2, which = "start" )
# log likelihood function for different values of gamma
plot( t( sapply( seq( 0.05, 0.95, 0.05 ), function(x) c( x,
logLik( sfaResult, newParam = c( coef( sfaResult )[1:4], x ) ) ) ) ) )
|
Loading required package: micEcon
If you have questions, suggestions, or comments regarding one of the 'micEcon' packages, please use a forum or 'tracker' at micEcon's R-Forge site:
https://r-forge.r-project.org/projects/micecon/
Loading required package: lmtest
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
Please cite the 'frontier' package as:
Tim Coelli and Arne Henningsen (2013). frontier: Stochastic Frontier Analysis. R package version 1.1. http://CRAN.R-Project.org/package=frontier.
If you have questions, suggestions, or comments regarding the 'frontier' package, please use a forum or 'tracker' at frontier's R-Forge site:
https://r-forge.r-project.org/projects/frontier/
'log Lik.' -18.44684 (df=4)
'log Lik.' -17.03485 (df=5)
'log Lik.' -17.02722 (df=5)
'log Lik.' -18.44684 (df=4)
'log Lik.' -41.52228 (df=5)
'log Lik.' -17.02722 (df=5)
'log Lik.' -41.52228 (df=5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.