File: log_lik.Rd

package info (click to toggle)
r-cran-rstantools 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 624 kB
  • sloc: sh: 15; cpp: 5; makefile: 2
file content (46 lines) | stat: -rw-r--r-- 1,669 bytes parent folder | download | duplicates (3)
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
43
44
45
46
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/log_lik.R
\name{log_lik}
\alias{log_lik}
\title{Generic function for pointwise log-likelihood}
\usage{
log_lik(object, ...)
}
\arguments{
\item{object}{The object to use.}

\item{...}{Arguments passed to methods. See the methods in the \pkg{rstanarm}
package for examples.}
}
\value{
\code{log_lik()} methods should return a \eqn{S} by \eqn{N} matrix,
where \eqn{S} is the size of the posterior sample (the number of draws from
the posterior distribution) and \eqn{N} is the number of data points.
}
\description{
We define a new function \code{log_lik()} rather than a
\code{\link[stats:logLik]{stats::logLik()}} method because (in addition to the conceptual
difference) the documentation for \code{logLik()} states that the return value
will be a single number, whereas \code{log_lik()} returns a matrix. See
the \href{https://mc-stan.org/rstanarm/reference/log_lik.stanreg.html}{log_lik.stanreg()}
method in the \pkg{rstanarm} package for an example of defining a method.
}
\examples{
# See help("log_lik", package = "rstanarm")

}
\seealso{
\itemize{
\item The \pkg{rstanarm} package (\href{https://mc-stan.org/rstanarm/}{mc-stan.org/rstanarm})
for example methods
(\href{https://CRAN.R-project.org/package=rstanarm}{CRAN},
\href{https://github.com/stan-dev/rstanarm}{GitHub}).
}

\itemize{
\item Guidelines and recommendations for developers of \R packages
interfacing with Stan and a demonstration getting a simple package working
can be found in the vignettes included with \pkg{rstantools} and at
\href{https://mc-stan.org/rstantools/articles/}{mc-stan.org/rstantools/articles}.
}
}