亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bayesys3.c

?? 貝葉斯算法:盲分離技術
?? C
?? 第 1 頁 / 共 5 頁
字號:
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//             Bayesian Inference
// 
// Filename:   bayesys3.c
//
// Purpose:    Obtain sample objects from posterior atomic distribution.
//
// Dedication: To my intellectual ancestors  the late Edwin T Jaynes,  and
//             Steve Gull, to my descendant Sibusiso Sibisi,  and the many
//             colleagues and friends  over the  past quarter-century  who
//             have inspired and encouraged the development of these ideas.
//
//             John Skilling, Kenmare, Ireland, November 2003
//             email: skilling@eircom.net
//=============================================================================
/*
    Copyright (c) 1999-2003 Maximum Entropy Data Consultants Ltd,
                            114c Milton Road, Cambridge CB4 1XE, England

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

#include "license.txt"
*/
//=============================================================================
//
//  An OBJECT is a combination of a-priori-equivalent "atoms":
//  statisticians call this construction a "mixture model".
// 
//  ATOMS
//  The number of atoms N in an object can range from MIN to MAX.
//  MIN >= 1 is required to avoid the algorithmically special null object N=0.
//  Generally, MAX >= MIN is required (with MAX=MIN allowed), but
//  MAX=infinity (absence of limit) can be specified with MAX=0.
//  [ Technically, this coding allows at most 1 atom per identifiable
//    location, so "infinity" means #(locations), perhaps 2^32 . ]
//
//  There are three standard priors Pr(N), selected by sign(Alpha).
//  Alpha = 0.
//      The prior is UNIFORM in MIN <= N <= MAX (and MAX must be finite).
//  Alpha > 0.
//      The prior is POISSON or BINOMIAL.
//      N  ~  Alpha +- sqrt(Alpha), subject to MIN and MAX
//  Alpha < 0.
//      The prior is GEOMETRIC.
//      N  ~  |Alpha| +- |Alpha|, subject to MIN and MAX
//
//  COORDINATES
//  The BayeSys prior for locating an atom in space is flat over the hypercube
//  (0,1)^Ndim  of dimension  Ndim .  In fact, the hypercube is treated as
//  wraparound-continuous, so is more properly described as a "hyper-torus".
//  BayeSys gives you coordinate vectors "double Cube[Ndim]" with values in
//  (0,1), but you can transform these into other "Coord" if you wish.
//  
//  The BayeShape procedure lets you modify some or all of your coordinates
//  into nine alternative configurations:
//
//   Shape  Description           Prob(Coord[i])                    Range of i
//
//     0   Permutation         uniform on integers Perm(0...N-1)     0...N-1
//     1   +ve orthant         exp(-x) in x > 0                      0...N-1
//     2   Simplex volume      uniform in SUM(x) < 1                 0...N-1
//     3   Simplex surface     uniform on SUM(x) = 1                  0...N
//     4   Ordered             uniform in 0 < x[0] < x[1] < ... < 1  0...N-1
//     5   Bell                Normal(0,1) in -inf < x < inf         0...N-1
//     6   Sphere volume       uniform in SUM(x^2) < 1               0...N-1
//     7   Hemisphere surface  uniform on SUM(x^2) = 1, x[N]>0        0...N
//     8   Sphere surface      uniform on SUM(x^2) = 1                0...N
//
//  For the interior of an awkward shape, allow a circumscribing volume,
//  but return the value 0 from UserTry1 and UserTry2 (instead of the
//  usual positive acceptance code) for any location outside the shape.
//  The ensemble will keep within the domain, because BayeSys only accepts
//  points for which you give strictly positive return codes.
//
//  Thus the unit disc  x^2 + y^2 < 1 could be programmed in several ways:
// (a) Use BayeShape with Shape=6 which gives the N=2 disc interior directly.
// (b) Use N=2 hypercube (= unit square) but expand it to (-1,1) by setting
//        x = 2*Cube[0] - 1,  y = 2*Cube[1] - 1
//     and reject any point outside the disc by returning 0 from UserTry1
//     and UserTry2.
// (c) Use hypercube to yield a unit square, but spread the prior measure
//     uniformly through the unit disc with your own transformation, e.g.
//        radius^2 = Cube[0],  angle = 2 PI Cube[1] .
//
//  FLUXES
//  The Ndim coordinates can be supplemented by  Valency  intensities or
//  "fluxes" z, being attributes for which the joint distribution
//                  Prior(z).Likelihood(D|z,...)
//  is integrable and can be sampled from.
//  The MassInf library incorporated in BayeSys provides Flux procedures for
//  its priors and linear data.
//
//  DISPLAY 
//  The coordinates and intensities are supplemented by a guidance width, being
//      log(fraction of hypercube volume that atom might plausibly range over).
//  This may help you to produce smooth displays from the atomic objects.
//
//  The number of atoms in an object is supplied to you as Natoms and
//  each atom's attributes are supplied to you consecutively as
//    double Cube[ 0,1,...,Ndim-1,  Ndim,...,Ndim+Valency-1,  Ndim+Valency ]
//              coordinates in (0,1)     intensities            log(width)
//=============================================================================
//
//  ENSEMBLE
//  The program uses an ensemble of sample objects.  Using several objects is
//  usually recommended, partly because objects that seem to be getting stuck
//  are overwritten by more successful ones which reduces the risk of failure,
//  and partly because the geometrical exploration engines only work with
//  several objects.
//
//=============================================================================
//
//  METHOD
//  Internally in the program, hypercube coordinates are mapped to an
//  extended-integer label whose range fills the hypercube but which preserves
//  a degree of locality: small changes in this integer will necessarily
//  correspond to small changes in coordinates.  
//  The user can use the Method parameter to control the style of this mapping,
//  and the operation of the various internal engines that control the 
//  evolution of the ensemble.
//
//     Method = 0    is the simplest algorithm, mapping hypercube coordinates
//                   onto extended-integer position labels by simple raster,
//                   and using the "LifeStory1" diffusion engine to create,
//                   destroy, and move atoms.
//                   This is very likely to be enhanced by switching on
//                   various bits of the Method integer.
//
// if( Method & 1 ), hypercube coordinates are mapped to position labels along
//                   a space-filling Hilbert curve.
//                   This is generally recommended, but unnecessary if Ndim=1.
//
// if( Method & 2 ), the "LifeStory" diffusion engine will include interactions
//                   with atoms' neighbours, otherwise not.
//                   This is generally recommended for its extra power.
//
// if( Method & 4 ), the algorithm includes the Chameleon1 engine, which lets
//                   atoms jump from one ensemble object to another, without
//                   changing position.
//                   This is ineffective if there is only one ensemble object.
//
// if( Method & 8 ), the algorithm includes the Chameleon2 engine, which lets
//                   atoms from different ensemble objects exchange position. 
//                   This is ineffective if there is only one ensemble object.
//
// if( Method & 16), the algorithm will include the Leapfrog1 engine, which
//                   inverts atom positions with respect to another atom from
//                   the same or a different ensemble object.
//                   This is designed to assist when the posterior distribution
//                   in more than one dimension is highly non-spherical.
//
// if( Method & 32), the algorithm will include the Leapfrog2 engine, which
//                   reflects atom positions with respect to two other atoms
//                   from the same or different ensemble objects.
//                   This is designed to assist when the posterior distribution
//                   in more than one dimension is highly non-spherical.
//
// if( Method & 64), the algorithm will include the GuidedWalk engine, which
//                   moves atoms along directions parallel to displacements
//                   between neighbours, thus following the local shape of
//                   the posterior distribution.
//                   This may supersede the Leapfrog engines.
//
//  ________________________________________________________________________
// |                                                                        |
// | GuidedWalk Leapfrog2 Leapfrog1 Chameleon2 Chameleon1 LifeStory2 Hilbert| 1
// |    off        off       off       off       off      LifeStory1 raster | 0
// |________________________________________________________________________|
//       64        32        16         8         4          2         1 Method
//
//  In the interest of overall efficiency, the algorithm tries to equalise the
//  computation time between its engines so that even if all the optional
//  engines did nothing, the computation cost of including them would be
//  limited to the number of engines (currently a factor of 6).
//
//  Author generally recommends switching everything in by
//                   Method = 127 (equivalently -1) .
//  
//=============================================================================
//
// The "Massive Inference" (MassInf) option is provided for applications where
// atoms have intensities or "fluxes" about which the data are linear.
//
// The PRIOR for the number of atoms and for their location is as for BayeSys3.
//
// Prior on flux z of atom is Pr(z) = ProbON * P(z) + (1 - ProbON) * delta(z) ,
// i.e. each flux is expected to be distributed as P(z) with probability ProbON
//      otherwise it is switched off with zero value.
// Common->ProbON supplies ProbON, and the "units" decimal digit of the switch
// Common->MassInf defines the shape P(z) of the prior according to
//
// (0) "monkeys"              P(z) = delta(z-q),   i.e. z = q = constant
//                     
// (1) "positive"             P(z) = exp(-z/q) / q    in z > 0
//    
// (2) "positive/negative"    P(z) = exp(-|z|/q) / 2q
//                                         2     2               2
// (3) "Gaussian"             P(z) = exp(-z / 2 q ) / sqrt(2 pi q )
//
// When flux can be positive or negative, the "positive/negative" prior is
// more tolerant of dynamic range than is the Gaussian prior.
// In each case the flux unit q is fixed at the positive value supplied
// in Common->FluxUnit0, or (if <= 0) kept close to its most probable value.
//
// An atom can have Valency (=1,2,...) independent fluxes, provided
// (a) all atoms have the same valency,
// (b) the flux unit is the same for each,
// (c) the mock-data footprints of the different valencies of an atom
//     do not overlap (no common cells), and
// (d) (if using LifeStory2 engine) for any pair of atoms, each footprint
//     of one overlaps no more than one valency footprint of the other.
//
//
// To specify the LIKELIHOOD (used as its log), define
//
//                    f     = object = sum of atoms
//
//                    x[j]  = positional coordinate of atom j
//
//                    z[j]  = flux(es) of atom j
//
//                    Footprint(x) = mock data from unit flux at x
//
//                    Mock  = SUM[j] z[j] Footprint(x[j]) = mock data of object
//
// Likeliood Pr(Data | f) can be one of
//
// (0xx) "chisquared", derived from
//
//                    Data  = signal,
//
//                    Acc   = 1/sigma, can be 0,   (sigma = standard deviation)
//
//                    M     = # measured data, for which Acc[k] > 0.
//                               M                         2
//                    Z     = PRODUCT[k] sqrt(2 PI sigma[k] )
//                                                      2          2
//                    Chisq = SUM[k] (Mock[k] - Data[k]) / sigma[k]
//                                    -1   -Chisq / 2
//                    Pr(Data | f) = Z    e
//
// (1xx) "Poisson", for positive problems with "monkey" or "positive" prior;
//
//                    Data  = counts, can be floating-point but must be >= 0.0
//
//                    Acc   = extraneous "background", which may be small but
//                            must be strictly +ve wherever Data > 0.0
//                                               -F[k]     D[k]
//                    Pr(Data | f) = PRODUCT[k] e      F[k]    / D[k]!
//
//                    where  F = Mock + Acc, D = Data + Acc,  x! = GAMMA(x+1) :
//                    this form of likelihood avoids singularity when active
//                    cells happen to be empty of mock data, and reduces to
//                    standard Poisson when the background -> 0
//
// according to the "hundreds" digit of the switch Common->MassInf.
//
// For example, Common->MassInf =  1  is Gaussian data with "positive" prior;
//              Common->MassInf = 101  is Poisson data with "positive" prior.
//=============================================================================
// History:
// MassInf1 v1.12-2.36  1998-2000
// BayeSys1 code        1999-2000
// BayeSys2 v1.02-1.05  1 May - 10 Sep 2001
// BayeSys3 v1.01-1.32  2 Jan 2002 - 4 Feb 2003
//          v2.00      10 Feb 2003
//          v2.01      11 Jul 2003  Fixed-q0 option to fix FluxUnit0 in MassInf
//          v2.02      19 Jul 2003  MassInf options extended to allow flux=0
//          v2.10      12 Aug 2003  MassInf needs FluxUnit0 from user
//          v2.20      14 Aug 2003  Remove any overlay in MassInf user's "bits"
//          v3.00      20 Aug 2003  Poisson data as MassInf option
//          v3.01      12 Sep 2003  MassInf control of flux=0 by ProbON
//          v3.02      18 Sep 2003  BayeShape coordinate options
//          v3.03      11 Oct 2003  "Hilbert" name used instead of Peano
//          v3.04      20 Oct 2003  Display width of atom roughy halved
//          v3.05      27 Oct 2003  BayeShape permutation option
//          v3.10      29 Nov 2003  Free software under GNU LGPL
//          v3.11       3 Feb 2004  Control uses <#copies>.  Better Evid & Info
//-----------------------------------------------------------------------------
// 
#include <stdlib.h>
#include <float.h>
#include <math.h>
#include "bayesys3.h"
#include "random.h"
#include "hilbert.h"

#undef  PARALLEL
#define PARALLEL 0   // # slaved parallel processors [0 = none]
#undef  DEBUG
#define DEBUG    0   // check Cube/Link consistency  [0 = off]

/***********************/
/* Internal structures */
/***********************/
typedef struct
{
    int            i;        // 1st object
    int            j;        // [2nd object]
    int            k;        // [3rd object]
    signed char    engine;   // operation type
    signed char    iType;    // type of 1st object, -1=WRITE, 0=Unused, 1=read
    signed char    jType;    // type of 2nd object, -1=WRITE, 0=Unused, 1=read

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩一级二级三级| 777午夜精品视频在线播放| 9久草视频在线视频精品| 色婷婷精品大视频在线蜜桃视频| 欧美一区二区三区日韩视频| 国产精品视频一二| 蜜臀av性久久久久蜜臀av麻豆| 99re热这里只有精品视频| 欧美一个色资源| 一区二区高清在线| 高清成人在线观看| 精品国产制服丝袜高跟| 午夜激情综合网| 色综合久久综合| 日本一区二区三区久久久久久久久不| 午夜伦理一区二区| 日本韩国精品在线| 国产精品第四页| 成人网在线播放| 久久午夜老司机| 久久国产剧场电影| 日韩欧美一级特黄在线播放| 亚洲午夜久久久久久久久电影网 | 亚洲一区二区三区激情| 精品成人一区二区| 亚洲18影院在线观看| 色综合激情五月| 亚洲欧美另类图片小说| 成人av影视在线观看| 国产嫩草影院久久久久| 国产成人精品亚洲午夜麻豆| 久久亚洲精精品中文字幕早川悠里 | 极品少妇一区二区| 91精品午夜视频| 男人的天堂久久精品| 7777精品伊人久久久大香线蕉经典版下载 | 黄色日韩网站视频| 亚洲精品一区二区三区蜜桃下载| 人人精品人人爱| 日韩精品一区二区三区中文精品| 蜜臀av性久久久久蜜臀aⅴ| 日韩亚洲国产中文字幕欧美| 另类欧美日韩国产在线| 欧美精品一区二区三区蜜臀| 国产一区二区三区| 欧美国产欧美综合| 国产午夜三级一区二区三| 国产精品亚洲午夜一区二区三区| www国产亚洲精品久久麻豆| 国产不卡免费视频| **网站欧美大片在线观看| 91在线一区二区| 亚洲国产一区二区在线播放| 欧美精品v日韩精品v韩国精品v| 美女看a上一区| 久久精品人人做| 一本久久精品一区二区| 午夜电影网一区| 国产日韩av一区| 91色porny在线视频| 水野朝阳av一区二区三区| 欧美成人福利视频| 波多野结衣视频一区| 五月天激情小说综合| 精品乱人伦小说| 国产在线视视频有精品| 国产精品成人免费精品自在线观看| 91丨九色丨黑人外教| 免费观看久久久4p| 亚洲欧洲一区二区三区| 欧美成人精品高清在线播放| 久久精品72免费观看| 在线免费亚洲电影| 久久99精品国产麻豆婷婷洗澡| 日韩欧美国产一区二区在线播放| 国产成人午夜高潮毛片| 亚洲综合丝袜美腿| 国产亚洲成aⅴ人片在线观看| 在线观看日韩高清av| 精品在线播放免费| 亚洲亚洲精品在线观看| 欧美经典一区二区| 欧美猛男男办公室激情| www.欧美日韩国产在线| 丝袜a∨在线一区二区三区不卡| 中国av一区二区三区| 4438x亚洲最大成人网| 一本一道综合狠狠老| 黑人精品欧美一区二区蜜桃| 亚洲一区二区视频在线| 国产色产综合产在线视频| 91精品欧美久久久久久动漫| 91捆绑美女网站| 国产美女精品人人做人人爽 | 在线观看www91| 国产大陆精品国产| 免费观看在线综合| 亚洲国产精品一区二区www | 92精品国产成人观看免费| 韩国三级中文字幕hd久久精品| 成人一级视频在线观看| 色综合天天综合给合国产| 国产精品99久| 欧美日韩另类一区| 99久久久国产精品| 国产99久久久国产精品潘金网站| 久久国产日韩欧美精品| 免费av成人在线| 日产国产高清一区二区三区| 亚洲国产精品一区二区久久恐怖片 | 精品国产电影一区二区| 国产精品456露脸| 国产精品视频观看| 欧美丝袜第三区| 国产精品无人区| 欧美久久免费观看| 精品亚洲免费视频| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 国产精品视频免费| 日韩精品一区二区三区在线观看| 欧美日韩性生活| 91黄视频在线观看| 欧美三级电影网站| 91精品国产综合久久香蕉的特点 | 久久精品在线观看| 久久精品视频一区二区三区| 国产人伦精品一区二区| 国产欧美一区二区精品仙草咪| 国产日韩一级二级三级| 国产精品无遮挡| 一区二区三区在线影院| 午夜影院在线观看欧美| 看电视剧不卡顿的网站| 国产精品自拍av| 99久久精品一区| 在线精品视频免费播放| 欧美一区二区在线观看| 久久精品日产第一区二区三区高清版| 国产欧美一区二区精品婷婷| 亚洲九九爱视频| 天堂资源在线中文精品| 精品一区二区在线免费观看| 成人精品小蝌蚪| 欧美视频完全免费看| 精品国产1区二区| 国产精品日日摸夜夜摸av| 亚洲自拍另类综合| 久久av资源站| 色综合一区二区| 日韩免费高清av| 中文字幕一区二区三区不卡| 亚洲成人黄色小说| 国产高清久久久久| 欧美日韩一区二区三区在线看 | 国产福利一区在线| 在线免费不卡视频| 精品国产91久久久久久久妲己| 中文字幕在线不卡| 久久精品国产亚洲高清剧情介绍| 不卡av在线免费观看| 欧美丰满嫩嫩电影| 国产精品久久久久久久岛一牛影视| 午夜影院在线观看欧美| 国产成都精品91一区二区三| 911国产精品| ●精品国产综合乱码久久久久| 蜜桃免费网站一区二区三区| 91免费在线看| 337p日本欧洲亚洲大胆精品| 亚洲成av人片在线观看| 成人短视频下载| 精品福利av导航| 午夜影视日本亚洲欧洲精品| 成人av午夜电影| 久久亚洲一级片| 蜜臀va亚洲va欧美va天堂| 在线观看免费亚洲| 中文字幕av在线一区二区三区| 日韩在线一二三区| 欧美在线你懂的| 最近中文字幕一区二区三区| 国产乱理伦片在线观看夜一区| 欧美高清性hdvideosex| 一区二区三区.www| 91麻豆国产香蕉久久精品| 欧美国产成人精品| 国产河南妇女毛片精品久久久| 日韩女优av电影在线观看| 91丝袜国产在线播放| 久久久久九九视频| 精品伊人久久久久7777人| 91精品综合久久久久久| 一区二区高清在线| 91免费国产在线观看| 日韩美女啊v在线免费观看| 99在线精品视频| 国产精品精品国产色婷婷| 白白色 亚洲乱淫| 日韩毛片精品高清免费| 色妞www精品视频|