evaluatePosterior: Function to evaluate the 'posterior' density surfacer; it...

Description Usage Arguments Value Examples

Description

Function to evaluate the ‘posterior’ density surfacer; it updates the prior surface with the information associated with the new data

Usage

1
evaluatePosterior(data_new_y, data_new_cv, data_prior_y, data_prior_cv)

Arguments

data_new_y

vector of new density data

data_new_cv

vector of coefficients of variation values for the new data (between 0 and 25)

data_prior_y

vector of prior density data

data_prior_cv

vector of coefficients of variation values for the prior data (between 0 and 25)

Value

Returns a list object: posterior densities, posterior CVs and posterior variances

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x<-seq(0, 10, length=15)
y1<-rep(5, 15)
cv1<-rep(0.6, 15)

y2<- (evaluateGaussianKernel(x, 5, 1)*6) +2
cv2<-rep(0.1, 15)

posterior<-evaluatePosterior(y2, cv2, y1, cv1)

plot(x,y1, ylim=c(0,6), ylab='y', xlab='x')
points(x, y2, pch=20)
points(x, posterior$post_y, pch=20, col='red')

lindesaysh/dcap documentation built on May 28, 2019, 11:34 a.m.