learnMoTBFpriorInformation: Incorporating prior knowledge in the estimation process

View source: R/priorKnowledge.R

learnMoTBFpriorInformationR Documentation

Incorporating prior knowledge in the estimation process

Description

Learns a univariate MoTBF function using prior information.

Usage

learnMoTBFpriorInformation(
  priorData,
  data,
  s,
  POTENTIAL_TYPE,
  domain = range(data),
  coeffversion = 4,
  restrictDomain = TRUE,
  maxParam = NULL
)

Arguments

priorData

A "numeric" vector which contains the prior information.

data

A "numeric" vector containing the observed data.

s

A "numeric" value which specifies the expert confidence in the prior knowledge. This argument takes values on the interval [0, N], where N is the sample size, and is used to synchronize the support of the prior knowledge and the sample.

POTENTIAL_TYPE

A "character" string, either MOP or MTE, corresponding to the type of basis function.

domain

A "numeric" vector which contains the bounding values to fit the function. By default, it is the range of the data.

coeffversion

A "numeric" value between 1--4 which contains the used version for computing the coefficients of the linear opinion pool to combine the prior function and the data function. By default, coeffversion = "4" is used, so the combination depends on the goodness of the model versus another random model.

restrictDomain

A logical value. This argument allows to choose if the domain is used joining both domains, the prior one and the data domain or trimming them. By default, TRUE is used, so the domain will be trimmed.

maxParam

A positive integer which indicates the maximum number of coefficients in the function. If specified, the output is the function which gets the best BIC with, at most, this number of parameters. By default, it is set to NULL.

Value

A list with the elements

coeffs

An "numeric" vector with the two coefficients of the linear opinion pool

posteriorFunction

The final function after combining.

priorFunction

The fit of the prior data.

dataFunction

The fit of the original data.

rangeNewPriorData

A "numeric" vector which contains the final domain where the functions are defined.

See Also

getCoefficients

Examples


## Data
X <- rnorm(15)

## Prior Data
priordata <- rnorm(5000)

## Test data
test <- rnorm(1000)
testData <- test[test>=min(X)&test<=max(X)]

## Learning
type <- "MOP" 
confident <- 3 ## confident <- 1,2,...,length(X)
f <- learnMoTBFpriorInformation(priorData = priordata, data = X, s = confident,
POTENTIAL_TYPE = type)
attributes(f)

## Log-likelihood
sum(log(as.function(f$dataFunction)(testData)))
sum(log(as.function(f$posteriorFunction)(testData))) ## best loglikelihood



MoTBFs documentation built on April 18, 2022, 5:06 p.m.