1 /***************************************************************************** 2 * * 3 * UNURAN -- Universal Non-Uniform Random number generator * 4 * * 5 ***************************************************************************** 6 * * 7 * FILE: empk_struct.h * 8 * * 9 * PURPOSE: * 10 * declares structures for method EMPK * 11 * (EMPirical distribution with Kernel smoothing) * 12 * * 13 ***************************************************************************** 14 * * 15 * Copyright (c) 2000-2006 Wolfgang Hoermann and Josef Leydold * 16 * Department of Statistics and Mathematics, WU Wien, Austria * 17 * * 18 * This program is free software; you can redistribute it and/or modify * 19 * it under the terms of the GNU General Public License as published by * 20 * the Free Software Foundation; either version 2 of the License, or * 21 * (at your option) any later version. * 22 * * 23 * This program is distributed in the hope that it will be useful, * 24 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 26 * GNU General Public License for more details. * 27 * * 28 * You should have received a copy of the GNU General Public License * 29 * along with this program; if not, write to the * 30 * Free Software Foundation, Inc., * 31 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA * 32 * * 33 *****************************************************************************/ 34 35 /*---------------------------------------------------------------------------*/ 36 /* Information for constructing the generator */ 37 38 struct unur_empk_par { 39 /* the observed sample is stored in the distribution object */ 40 41 const UNUR_GEN *kerngen; /* random variate generator for kernel 42 (given by user) */ 43 UNUR_GEN *kernel; /* random variate generator for kernel 44 (provided by UNURAN) */ 45 46 double alpha; /* alpha is used to compute the optimal bandwidth from 47 the point of view of minimizing the mean integrated 48 square error (MISE). 49 alfa depends on the type of kernel being used. */ 50 51 double beta; /* beta is used to compute the optimal bandwidth from 52 the point of view of minimizing the mean integrated 53 square error (MISE). 54 beta depends on the (unknown) distribution of the 55 sampled data points. Thus its value contains some 56 guess on this distribution. */ 57 58 double smoothing; /* determines how "smooth" the estimated density will be */ 59 60 double kernvar; /* variance of used kernel, only used if varcor == 1 */ 61 62 }; 63 64 /*---------------------------------------------------------------------------*/ 65 /* The generator object */ 66 67 struct unur_empk_gen { 68 double *observ; /* pointer to the array of the observations */ 69 int n_observ; /* number of observations */ 70 71 UNUR_GEN *kerngen; /* random variate generator for kernel */ 72 73 double smoothing; /* determines how "smooth" the estimated density will be */ 74 double kernvar; /* variance of used kernel, only used if varcor == 1 */ 75 76 double bwidth; /* bandwidth for kernel density estimation */ 77 double bwidth_opt; /* optimal bandwith for kernel density estimation */ 78 double mean_observ; /* mean of observed data */ 79 double stddev_observ; /* standard deviation of oberved data */ 80 double sconst; /* constant used for variance corrected version 81 of kernel method */ 82 double alpha; /* parameter for kernel width */ 83 double beta; /* parameter for kernel width */ 84 }; 85 86 /*---------------------------------------------------------------------------*/ 87