Learn R Programming

pauwels2014 (version 1.0)

risk_theta_vect: Expected risk based on a posterior sample

Description

The function computes the expected risk based on the empirical distribution defined by the sample thetas_trans.

Usage

risk_theta_vect(thetas_trans, n_params)

Arguments

thetas_trans
A matrix which row represent parameter values in physical space (after applying transform_params).
n_params
The number of parameters to be estimated

Value

A numerical value

See Also

risk_theta_fun

Examples

Run this code
data(knobjs)
sapply(	
	1:length(knobjs),
	function(k){
		assign(names(knobjs)[k], knobjs[[k]], envir = .GlobalEnv)
	}
)

thetas <- knobjActMult1$datas[[1]]$thetas[1:10,]

thetas_trans <- t(apply(thetas, 1, transform_params))
risk_theta_vect(thetas_trans, 9)

Run the code above in your browser using DataLab