File: binom.cat

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (177 lines) | stat: -rw-r--r-- 8,691 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177

binom(2)                       Scilab Function                       binom(2)
NAME
  binom - binomial measure synthesis

  Author: Christophe Canus

  This C_LAB routine synthesizes a large range of pre-multifractal measures
  related to the binomial measure paradigm (deterministic, shuffled, pertu-
  bated, and mixing of two binomials: lumping and sum) and computes linked
  theoretical functions (partition sum function, Reyni exponents function,
  generalized dimensions, multifractal spectrum).

Usage
  [varargout,[optvarargout]]=binom(p0,str,varargin,[optvarargin])

Input parameters
       o p0 : strictly positive real scalar Contains the weight of the bino-
         mial.
       o str : string Contains the type of ouput.
       o varargin : variable input argument Contains the variable input argu-
         ment.
       o optvarargin : optional variable input arguments Contains optional
         variable input arguments.
Output parameters
       o varargout : variable output argument Contains the variable output
         argument.
       o optvarargout : optional variable output argument Contains an
         optional variable output argument.

Description

Parameters

  The binomial measure is completly characterized by its weight p0. This
  first parameter must be >0. and <1. (the case of p0=.5 corresponds to the
  Lebesgue measure).  The second parameter str is a variable string used to
  determine the desired type of output. There are six suffix strings ('meas'
  for measure, 'cdf' for cumulative distribution function, , 'pdf' for proba-
  bility density function, 'part' for partition sum function, 'Reyni' for
  Reyni exponent function , 'spec' for multifractal spectrum) for the deter-
  ministic binomial measure and a lot of possibly composed prefix strings for
  related measures ('shuf' for shuffled, 'pert' for pertubated, 'lump' for
  lumping , 'sum' for sum, 'sumpert' for sum of pertubated, and so on) which
  can be added to the first ones to form composed strings. For example,
  'lumppertmeas' is for the synthesis of the lumping of 2 pertubated binomial
  pre-multifractal measures and 'sumspec' is for the computation of the mul-
  tifractal spectrum of the sum of two binomials. Note that all combinaisons
  of strings are not implemented yet.  When a string containing suffix string
  'meas' is given as second input, a pre-multifractal measure mu_n (first
  output argument) is synthesized on the dyadic intervals I_n (second
  optional output argument) of the unit interval. In that case, the third
  input argument is a strictly positive real (integer) scalar n which con-
  tains the resolution of the pre-multifractal measure. The size of the out-
  put real vectors mu_n (and I_n if used) is equal to 2n (so be aware the
  stack size ;-)). This option is implemented for the deterministic ('meas'),
  shuffled ('shufmeas') and pertubated ('pertmeas') binomial, and also for
  the mixing (lumping or sum) of two deterministic ('lumpmeas' and 'summeas')
  or pertubated ('lumppertmeas' and 'sumpertmeas') binomial measures. When a
  string containing prefix 'shuf' is given as second input, the synthesis is
  made for a shuffled binomial measure. At each level of the multiplicative
  cascade and for all nodes of the corresponding binary tree, the weight is
  chosen uniformly among p0 and 1-p0. This option is implemented only for the
  binomial measure ('shufmeas').  When a string containing prefix 'pert' is
  given as second input, the synthesis is made for a pertubated binomial
  measure. In that case, the fourth input argument is a strictly positive
  real scalar epsilon which contains the pertubation around weights. The
  weight is an independant random variable identically distributed between
  p0-epsilon and p0+epsilon which must be >0., <1. This option is implemented
  only for the binomial measure ('pertmeas') and the mixing (lumping and sum)
  of two binomial measures ('lumppertmeas' and 'sumpertmeas').  When replac-
  ing suffix string 'meas' with suffix string 'cdf', respectively suffix
  string 'pdf', the cumulative distribution function F_n, respectively the
  probability density function p_n, related to this pre-multifractal measure
  is computed (first output argument).  When string 'part' is given as second
  input, the partition sum function znq of multifractal measure is computed
  as sole output argument. In that case, the third input argument is a
  strictly positive real (integer) vector vn which contains the resolutions,
  and the fourth input argument is a real vector q which contains the measure
  exponents. The size of the output real matrix znq is equal to
  size(q)*size(vn). This option is implemented only for the binomial measure.
  When string 'Reyni' is given as second input, the Reyni exponents function
  tq (and the generalized dimensions Dq if used) of the multifractal measure
  is computed as first output argument (and second optional output argument
  if used). In that case, the third input argument is a real vector q which
  contains the measure's exponents. The size of the output real vector tq is
  equal to size(q)). This option is implemented only for the binomial meas-
  ure.  When a string containing suffix string 'spec' is given as second
  input, the multifractal spectrum f_alpha (second output argument) is syn-
  thesized on the Hoelder exponents alpha (first output argument). In that
  case, the third input argument is a strictly positive real (integer) scalar
  N which contains the number of Hoelder exponents. The size of both output
  real vectors alpha and f_alpha is equal to N. This option is implemented
  only for the binomial measure ('spec') and the mixing (lumping and sum) of
  two binomial measures ('lumpspec' and sumspec').

Algorithm details

  For the deterministic binomial, the pre-multifractal measure synthesis
  algorithm is implemented is a iterative way (supposed to run faster than a
  recursive one). For the shuffled or the pertubated binomial, the synthesis
  algorithm is implemented is a recursive way (to be able to pick up a i.i.d.
  r.v. at each level of the multiplicative cascade and for all nodes of the
  corresponding binary tree w.r.t. the given law). Note that the shuffled
  binomial measure is not conservative.

Examples

Matlab

  p0=.2;
  n=10;
  % synthesizes a pre-multifractal binomial measure
  [mu_n,I_n]=binom(p0,'meas',n);
  plot(I_n,mu_n);
  % synthesizes the cdf of a pre-multifractal shuffled binomial measure
  F_n=binom(p0,'shufcdf',n);
  plot(I_n,F_n);
  e=.19;
  % synthesizes the pdf of a pre-multifractal pertubated binomial measure
  p_n=binom(p0,'pertpdf',n,e);
  plot(I_n,p_n);
  vn=[1:1:8];
  q=[-5:.1:+5];
  % computes the partition sum function of a binomial measure
  znq=binom(p0,'part',vn,q);
  plot(-vn*log(2),log(znq));
  % computes the Reyni exponents function of a binomial measure
  tq=binom(p0,'Reyni',q);
  plot(q,tq);
  N=200;
  q0=.4;
  % computes the multifractal spectrum of the lumping of two binomial measures
  [alpha,f_alpha]=binom(p0,'lumpspec',N,q0);
  plot(alpha,f_alpha);
Scilab

  p0=.2;
  n=10;
  // synthesizes a pre-multifractal binomial measure
  [mu_n,I_n]=binom(p0,'meas',n);
  plot(I_n,mu_n);
  // synthesizes the cdf of a pre-multifractal shuffled binomial measure
  F_n=binom(p0,'shufcdf',n);
  plot(I_n,F_n);
  e=.19;
  // synthesizes the pdf of a pre-multifractal pertubated binomial measure
  p_n=binom(p0,'pertpdf',n,e);
  plot(I_n,p_n);
  xbasc();
  vn=[1:1:8];
  q=[-5:.1:+5];
  // computes the partition sum function of a binomial measure
  znq=binom(p0,'part',vn,q);
  mn=zeros(max(size(q)),max(size(vn)));
  for i=1:max(size(q))
     mn(i,:)=-vn*log(2);
  end
  plot2d(mn',log(znq'));
  // computes the Reyni exponents function of a binomial measure
  tq=binom(p0,'Reyni',q);
  plot(q,tq);
  N=200;
  q0=.4;
  // computes the multifractal spectrum of the lumping of two binomial measures
  [alpha,f_alpha]=binom(p0,'lumpspec',N,q0);
  plot(alpha,f_alpha);
References
  "Multifractal Measures", Carl J. G. Evertsz and Benoit B. MandelBrot. In
  Chaos and Fractals, New Frontiers of Science, Appendix B. Edited by Peit-
  gen, Juergens and Saupe, Springer Verlag, 1992 pages 921-953.  "A class of
  Multinomial Multifractal Measures with negative (latent) values for the
  "Dimension" f(alpha)", Benoit B. MandelBrot. In Fractals' Physical Origins
  and Properties, Proceeding of the Erice Meeting, 1988. Edited by L.
  Pietronero, Plenum Press, New York, 1989 pages 3-29.  .SH See also sbinom,
  multim1d, multim2d, smultim1d, smultim2d (C_LAB routines).  MFAS_measures,
  MFAS_dimensions, MFAS_spectra (Matlab and/or Scilab demo scripts).