Description Usage Arguments Value Examples
View source: R/auto_cmpt_freq.R
WAIC is determined by rho, sigma, data and M. So, we can
explicitly show WAIC = WAIC(rho,sigam,data,M). If M and data is fixed, WAIC
is the function only having rho and sigma as variables. The algorithm for
finding the minimum value of WAIC is as follows.
for(rho in 1:rho_max); if(WAIC(rho+1,ex_sigma) is larger than WAIC(rho,ex_sigma));
then return cmpt_freq(data,rho,ex_sigma)
The details are ######
1 2 3 4 5 | auto_cmpt_freq(data, M = as.integer(50), delta = 1/25, max_rho = 10,
ex_sigma = 3, stan_seed = as.integer(1234),
stan_chains = as.integer(3), stan_warmup = as.integer(300),
stan_thin = as.integer(1), stan_iter = as.integer(1300),
stan_max_treedepth = as.integer(10))
|
data |
a vector of one dimentional data. |
M |
integer; degree of discretization computation. x axis of
frequency plot is divided into M grids.
Defaults to |
delta |
numeric beetween 0 and 1 (defaults to 1/25); the size of
no-data area in frequency plot.
In order to stabilize computation, both ends of the graph have no data
points. The size is expressed by |
max_rho |
numeric > 1; See Description |
ex_sigma |
expected value of sigma > 0; See Description |
stan_seed |
see |
stan_chains |
see |
stan_warmup |
see |
stan_thin |
see |
stan_iter |
see |
stan_max_treedepth |
see |
list data having follow 5 components:
$WAIC
: See Description in in cmpt_freq
$p
: data.frame of the MCMC result. $age_X
is x
coodinates and $p_mean
is estimate. $p_0025
means that
the probability that ture frequency is smaller than $p_0025
is 0.025. $p_025
, $p_075
and $p_0975
is defined
in the same way as $p_0025
. $p_n_eff
and $p_Rhat
is
index to check convergence. In this function, if $p_Rhat > 1.1
, then regard the MCMC to converge
$data
: same as the input data, used in freq_graph
$rho
: same as the input rho
$sigma
: same as the input sigma
1 2 3 | d <- Osayama
e <- auto_cmpt_freq(d)
freq_graph(e)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.