30 #if !defined(OPT_LIB) && (__cplusplus >= 201103L)
31 const int xs = [](
unsigned int size)->
int
33 assert(size <= INT_MAX);
34 return static_cast<int>(size);
36 const int us = [](
unsigned int size)->
int
38 assert(size <= INT_MAX);
39 return static_cast<int>(size);
42 const int xs =
static_cast<int>(x.
size());
43 const int us =
static_cast<int>(u0.
size());
46 int nvar = xs + us + us * us;
65 int & vxs = (
int&)(xs);
80 cerr <<
"can't do importance sampling with bounded random effects"
81 " at present" <<
endl;
107 int samplesize=nsamp/nfunnelblocks;
108 int ubound=samplesize;
111 ivector blocksizes(1,nfunnelblocks);
112 for (
int iblock=1;iblock<=nfunnelblocks;iblock++)
115 if (lbound>nsamp)
break;
119 for (
int is=lbound;is<=ubound;is++)
125 vy(xs+1,xs+us).
shift(1)+=tau;
127 vy(xs+1,xs+us).
shift(1)-=tau;
154 fvalues(mean_count)=tmp;
155 blocksizes(mean_count)=icount;
161 double fm=
mean(
value(fvalues(1,mean_count)));
163 vf=-fm-
log(nfval*blocksizes(1,mean_count)/
sum(blocksizes(1,mean_count)));
180 vy(xs+1,xs+us).
shift(1)=u0;
191 Hessadjoint(i,j)=g(ii++);
Description not yet available.
laplace_approximation_calculator * lapprox
static void set_NO_DERIVATIVES(void)
Disable accumulation of derivative information.
Description not yet available.
dvar_vector & shift(int min)
Description not yet available.
static void set_active_random_effects(void)
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
Vector of double precision numbers.
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static dvariable reset(const dvar_vector &x)
double mean(const dvector &vec)
Returns computed mean of vec.
void gradcalc(int nvar, const dvector &g)
df1_one_matrix choleski_decomp(const df1_one_matrix &MM)
ivector sgn(const dvector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static int no_ln_det_choleski_flag
static int stddev_vscale(const dvar_vector &d, const dvar_vector &x)
int num_importance_samples
prnstream & endl(prnstream &)
Description not yet available.
Array of integers(int) with indexes from index_min to indexmax.
double calculate_importance_sample_funnel(const dvector &x, const dvector &u0, const dmatrix &Hess, const dvector &_xadjoint, const dvector &_uadjoint, const dmatrix &_Hessadjoint, function_minimizer *pmin)
Description not yet available.
static objective_function_value * pobjfun
Description not yet available.
static void xinit(const dvector &x)
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
Description not yet available.
double norm2(const d3_array &a)
Return sum of squared elements in a.
double ln_det(const dmatrix &m1, int &sgn)
Compute log determinant of a constant matrix.
unsigned int size() const
Get number of elements in array.
void ad_begin_funnel(void)
Description not yet available.
static int have_bounded_random_effects
Class definition of matrix with derivitive information .
virtual void AD_uf_outer()
double ln_det_choleski(const banded_symmetric_dmatrix &MM, int &ierr)
Description not yet available.
Description not yet available.
static void set_YES_DERIVATIVES(void)
Enable accumulation of derivative information.
static void get_cHessian_contribution(dmatrix, int)
Description not yet available.
void initialize(const dvector &ww)
Description not yet available.
dvector value(const df1_one_vector &v)
static int get_num_quadratic_prior(void)
double square(const double value)
Return square of value; constant object.
Fundamental data type for reverse mode automatic differentiation.
df1_one_variable inv(const df1_one_variable &x)
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
static void set_inactive_only_random_effects(void)