getCoefficients: Get the coefficients

View source: R/priorKnowledge.R

getCoefficientsR Documentation

Get the coefficients

Description

Compute the coefficients for the linear opinion pool

Usage

getCoefficients(fPI, rangeNewPriorData, fD, data, domain, coeffversion)

Arguments

fPI

The function fitted to the prior data, of class "motbf".

rangeNewPriorData

An array of length 2 with the new domain of the prior function.

fD

The function fitted to the original data, of class "motbf".

data

A "numeric" array which contains the sample.

domain

A "numeric" array with the domain of the data density function.

coeffversion

A "numeric" value between 1--4 which contains the used version for computing the coefficients in 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 positive MoTBF model.

Details

coeffversion can be: "1" coef1 and coef2 are the sum of the probabilities of one of the function over the sum of all probabilities, respectively; "2" coef1 and coef2 are the solution of a linear optimization problem which tries to maximize the sum 1 for each row of probabilities; "3" coef1 and coef2 are the difference of the log-likelihood of the evaluated model and a random uniform model over the sum of both differences, respectively; "4" coef1 and coef2 are the difference of the log-likelihood of the evaluated model and a ramdom positive MoTBF model over the sum of both differences, respectively.

Value

A "numeric" value of length 2 giving the coefficients which are the weigth of the two function to combine.

See Also

learnMoTBFpriorInformation

Examples


## Data
X <- rnorm(15)

## Prior Data
priordata <- rnorm(5000)

## Learning
confident <- 5
type <- "MOP"
f <- learnMoTBFpriorInformation(priorData = priordata, data = X, s = confident,
POTENTIAL_TYPE = type)
attributes(f)
 
## Coefficients: linear opinion pool
getCoefficients(fPI = f$priorFunction, rangeNewPriorData = f$domain, fD = f$dataFunction, 
data = X, domain = range(X), coeffversion = 4)

getCoefficients(fPI = f$priorFunction, rangeNewPriorData = f$domain, fD = f$dataFunction, 
data = X, domain = range(X), coeffversion = 1)

getCoefficients(fPI = f$priorFunction, rangeNewPriorData = f$domain, fD = f$dataFunction, 
data = X, domain = range(X), coeffversion = 3)

getCoefficients(fPI = f$priorFunction, rangeNewPriorData = f$domain, fD = f$dataFunction, 
data = X, domain = range(X), coeffversion = 2)


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