File: multim2d.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 (181 lines) | stat: -rw-r--r-- 9,069 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
178
179
180
181

multim2d(2)                    Scilab Function                    multim2d(2)
NAME
  multim2d - multinomial 2d measure synthesis

  Author: Christophe Canus

  This C_LAB routine synthesizes a large range of pre-multifractal measures
  related to the multinomial 2d measure (deterministic, shuffled, pertubated)
  and computes linked theoretical functions (partition sum function, Reyni
  exponents function, generalized dimensions, multifractal spectrum).

Usage
  [varargout,[optvarargout]]=binom(bx,by,p,str,varargin,[optvarargin])

Input parameters
       o bx : strictly positive real (integer) scalar Contains the abscissa
         base of the multinomial.
       o by : strictly positive real (integer) scalar Contains the ordonate
         base of the multinomial.
       o p : strictly positive real vector [by,bx] Contains the weights of
         the multinomial.
       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 multinomial 2d measure is completly characterized by its abscissa base
  bx, ordonate base by and its weights p(i) (i=1 to bx*by). The first two
  parameters bx and by must be >1. The third parameter must be a vector of
  size equal to bx*by. The weights p(i) must be >0., <1. and their sum must
  be =1. (the case of p(i)=1/(bx*by) corresponds to the Lebesgue measure)
  (i=1 to bx*by).  The fourth 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 multinomial measure and two prefix strings for related measures
  ('shuf' for shuffled , 'pert' for pertubated) which can be added to the
  first ones to form composed strings. For example, 'shufmeas' is for the
  synthesis of a shuffled multinomial 2d pre-multifractal measure. Note that
  all combinaisons of strings are not implemented yet.  When a string con-
  taining suffix string 'meas' is given as fourth input, a pre-multifractal
  measure mu_n (first output argument) is synthesized on the bx-adic and by-
  adic intervals I_nx and I_ny (second and third optional output argument) of
  the unit square. In that case, the fifth input argument is a strictly posi-
  tive real (integer) scalar n which contains the resolution of the pre-
  multifractal measure. The size of the output real matrix mu_n is equal to
  bxn*byn and the one of the output real vectors I_nx and I_ny (if used) is
  equal to bxn and byn (so be aware the stack size ;-)). This option is
  implemented for the deterministic ('meas'), shuffled ('shufmeas') and per-
  tubated ('pertmeas') multinomial 2d measure.  When a string containing pre-
  fix 'shuf' is given as fourth input, the synthesis is made for a shuffled
  multinomial measure. At each level of the multiplicative cascade and for
  all nodes of the corresponding binary tree, the vector of weights p is
  shuffled. This option is implemented only for the multinomial 2d measure
  ('shufmeas').  When a string containing prefix 'pert' is given as fourth
  input, the synthesis is made for a pertubated multinomial measure. In that
  case, the fifth input argument is a strictly positive real scalar epsilon
  which contains the pertubation around weights. The weights are independant
  random variables identically distributed between p(i)-epsilon and
  p(i)+epsilon which must be >0., <1. (i=1 to bx*by). This option is imple-
  mented only for the multinomial 2d measure ('pertmeas').  When replacing
  suffix string 'meas' with suffix string 'cdf', respectively suffix string
  'pdf', the cumulative distribution function F_n, respectively the probabil-
  ity density function p_n, related to this pre-multifractal measure is com-
  puted (first output argument).  When string 'part' is given as fourth
  input, the partition sum function znq of multifractal measure is computed
  as sole output argument. In that case, the fifth input argument is a
  strictly positive real (integer) vector vn which contains the resolutions,
  and the sixth 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 multinomial 2d
  measure.  When string 'Reyni' is given as third 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 fifth input argument is a real vector
  q which contains the measure's exponents. The size of the output real vec-
  tor tq is equal to size(q)). This option is implemented only for the multi-
  nomial 2d measure.  When string 'spec' is given as fourth input, the mul-
  tifractal spectrum f_alpha (second output argument) is synthesized on the
  Hoelder exponents alpha (first output argument). In that case, the fifth
  input argument is a strictly positive real (integer) scalar N which
  contains the number of Hoelder exponents. The size of both output real vec-
  tors alpha and f_alpha is equal to N. This option is implemented only for
  the multinomial 2d measure.

Algorithm details

  For the deterministic multinomial, 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 multinomial, the syn-
  thesis 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). In the case of the
  pertubated multinomial, the weights of each node are normalised by their
  sum for the measure to remain conservative. Note that the shuffled multino-
  mial 2d measure is not conservative.

Examples

Matlab

  bx=2;
  by=3;
  p=[.05 .1; .15 .2; .24 .26];
  n=5;
  % synthesizes a pre-multifractal multinomial 2d measure
  [mu_n,I_nx,I_ny]=multim2d(bx,by,p,'meas',n);
  mesh(I_nx,I_ny,mu_n);
  % synthesizes the cdf of a pre-multifractal shuffled multinomial 2d measure
  F_n=multim2d(bx,by,p,'shufcdf',n);
  mesh(I_nx,I_ny,F_n);
  e=.049;
  % synthesizes the pdf of a pre-multifractal pertubated multinomial 2d measure
  p_n=multim2d(bx,by,p,'pertpdf',n,e);
  mesh(I_nx,I_ny,p_n);
  vn=[1:1:8];
  q=[-5:.1:+5];
  % computes the partition sum function of a multinomial 2d measure
  znq=multim2d(bx,by,p,'part',vn,q);
  plot(-vn*log(2),log(znq));
  % computes the Reyni exponents function of a multinomial 2d measure
  tq=multim2d(bx,by,p,'Reyni',q);
  plot(q,tq);
  N=200;
  % computes the multifractal spectrum of a multinomial 2d measure
  [alpha,f_alpha]=multim2d(bx,by,p,'spec',N);
  plot(alpha,f_alpha);
Scilab

  bx=2;
  by=3;
  p=[.05 .1; .15 .2; .24 .26];
  n=5;
  // synthesizes a pre-multifractal multinomial 2d measure
  [mu_n,I_nx,I_ny]=multim2d(bx,by,p,'meas',n);
  plot3d(I_nx,I_ny,mu_n);
  // synthesizes the cdf of a pre-multifractal shuffled multinomial 2d measure
  F_n=multim2d(bx,by,p,'shufcdf',n);
  plot3d(I_nx,I_ny,F_n);
  e=.049;
  // synthesizes the pdf of a pre-multifractal pertubated multinomial 2d measure
  p_n=multim2d(bx,by,p,'pertpdf',n,e);
  plot3d(I_nx,I_ny,p_n);
  xbasc();
  vn=[1:1:8];
  q=[-5:.1:+5];
  // computes the partition sum function of a multinomial 2d measure
  znq=multim2d(bx,by,p,'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 multinomial 2d measure
  tq=multim2d(bx,by,p,'Reyni',q);
  plot(q,tq);
  N=200;
  // computes the multifractal spectrum of a multinomial 2d measure
  [alpha,f_alpha]=multim2d(bx,by,p,'spec',N);
  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 binom,
  sbinom, multim1d, smultim1d, smultim2d (C_LAB routines).  MFAS_measures,
  MFAS_dimensions, MFAS_spectra (Matlab and/or Scilab demo scripts).