support_estimation: support_estimation

View source: R/basic_functions.R

support_estimationR Documentation

support_estimation

Description

Compute the support estimate.

Usage

support_estimation(beta_sample_q, gamma = 0.5)

Arguments

beta_sample_q

a matrix. Each row is a coefficient function computed from the posterior sample.

gamma

a numeric value, the default value is 0.5.

Value

a list containing:

alpha

a numerical vector. The approximated posterior probabilities that the coefficient function support covers t for each time points t.

estimate

a numerical vector, the support estimate.

estimate_fct

a numerical vector, another version of the support estimate.

Examples

data(data1)
data(param1)
# result of res_bliss1<-fit_Bliss(data=data1,param=param1)
data(res_bliss1)
res_support <- support_estimation(res_bliss1$beta_sample[[1]])

### The estimate
res_support$estimate
### Plot the result
grid <- res_bliss1$data$grids[[1]]
plot(grid,res_support$alpha,ylim=c(0,1),type="l",xlab="",ylab="")
for(k in 1:nrow(res_support$estimate)){
    segments(grid[res_support$estimate[k,1]],0.5,
             grid[res_support$estimate[k,2]],0.5,lwd=2,col=2)
    points(grid[res_support$estimate[k,1]],0.5,pch="|",lwd=2,col=2)
    points(grid[res_support$estimate[k,2]],0.5,pch="|",lwd=2,col=2)
}
abline(h=0.5,col=2,lty=2)

bliss documentation built on March 18, 2022, 5:46 p.m.