PlotOptimalDecision {aihuman}R Documentation

Plot optimal decision

Description

See Figure 6 for example.

Usage

PlotOptimalDecision(res, colname.d, idx = NULL)

Arguments

res

The data frame generated from CalOptimalDecision.

colname.d

The column name of decision to be plotted.

idx

The row index of observations to be included. The default is all the observations from the data.

Value

A ggplot.

Examples


data(synth)
sample_mcmc = AiEvalmcmc(data = synth, n.mcmc = 10)
sample_optd = CalOptimalDecision(data = synth, mcmc.re = sample_mcmc, 
                                 c0.ls = seq(0,5,1), c1.ls = seq(0,5,1), 
                                 size = 1) # adjust the size
sample_optd$cash = sample_optd$d1 + sample_optd$d2 + sample_optd$d3
PlotOptimalDecision(sample_optd, "cash")



[Package aihuman version 0.1.0 Index]