This file is indexed.

/usr/share/openturns/validation/ValidGamma.txt is in openturns-validation 1.5-7build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
> restart:
> with(Statistics):
> gamma_:=RandomVariable(Gamma(1/lambda,k)):
> assume(u>0);
> pdf:=subs(u=x-_gamma,PDF(gamma_,u));
> cdf:=subs(u=x-_gamma,CDF(gamma_,u)):
> cdf2:=simplify(convert(cdf,hypergeom),symbolic);
> cf:=subs(u=x,exp(-I*_gamma)*CharacteristicFunction(gamma_,u));
> mu_:=_gamma+Mean(gamma_);
> var_:=Variance(gamma_);
> skew_:=simplify(convert(Skewness(gamma_),GAMMA),symbolic);
> kurt_:=simplify(convert(Kurtosis(gamma_),GAMMA),symbolic);
> sol:=subs(m='mu',v='var',solve({mu_=m,var_=v},{k,lambda}));
> #qdf:=_gamma+Quantile(gamma_,p);
> #qdf2:=solve(cdf=p,x);
> pdfgr:=map(_u->simplify(convert(_u,hypergeom),symbolic),[diff(pdf,
> k)/pdf, diff(pdf, lambda)/pdf, diff(pdf, _gamma)/pdf]);
> cdfgr:=map(_u->simplify(convert(_u,hypergeom),symbolic),[diff(cdf, k),
> diff(cdf, lambda), diff(cdf, _gamma)]);
> #dCDFdk:=collect(map(_u->simplify(convert(_u,hypergeom),symbolic),conv
> ert(diff(subs(_gamma=0,cdf2), k),hypergeometric)),x);
> #dCDFdlambda:=map(_u->factor(simplify(convert(_u,hypergeom),symbolic))
> ,diff(cdf2, lambda));
> #dCDFdgamma:=map(_u->simplify(convert(_u,hypergeom),symbolic),diff(cdf
> 2, _gamma));
> collect(expand(simplify(factor(convert(subs(_gamma=0,lambda=1,diff(cdf
> 2,k)),'StandardFunctions'))),trig),k);
> valnum:=k=1.5,lambda=2.5,_gamma=-0.5;
> evalf(subs(valnum,x=1,ddf));
> evalf(subs(valnum,x=1,pdf));
> evalf(subs(valnum,x=1,cdf));
> evalf(subs(valnum,x=1,cf));
> evalf(subs(valnum,x=1,map(_x->_x*pdf,pdfgr)));
> evalf(subs(valnum,x=1,cdfgr));
> evalf(fsolve(subs(valnum,cdf)=0.95,x));
> evalf(subs(valnum,mu_));
> evalf(subs(valnum,sqrt(var_)));
> evalf(subs(valnum,skew_));
> evalf(subs(valnum,kurt_));
> evalf(subs(valnum,var_));
> evalf(subs(valnum,[mu_,sqrt(var_)]));
> evalf(subs(sol,mu=mu_,var=var_,valnum,[k,lambda]));

                              (k - 1)
  pdf := ((x - _gamma) lambda)        exp(-(x - _gamma) lambda)

        lambda/GAMMA(k)


  cdf2 := (GAMMA(k + 2) - GAMMA(k + 1, (x - _gamma) lambda)

         - GAMMA(k + 1, (x - _gamma) lambda) k

                                           k             k
         + exp(-(x - _gamma) lambda) lambda  (x - _gamma)

                                             k             k
         + k exp(-(x - _gamma) lambda) lambda  (x - _gamma) )/

        GAMMA(k + 2)


                                     /     x I  \(-k)
                cf := exp(-I _gamma) |1 - ------|
                                     \    lambda/


                                          k
                        mu_ := _gamma + ------
                                        lambda


                                      k
                           var_ := -------
                                         2
                                   lambda


                                      2
                            skew_ := ----
                                      1/2
                                     k


                                   3 (k + 2)
                          kurt_ := ---------
                                       k


                                                          2
                          -_gamma + mu      (-_gamma + mu)
         sol := {lambda = ------------, k = ---------------}
                              var                 var


  pdfgr := [ln(x - _gamma) + ln(lambda) - Psi(k),

        k - lambda x + lambda _gamma
        ----------------------------,
                   lambda

          k - 1 - lambda x + lambda _gamma
        - --------------------------------]
                     x - _gamma


                   (k + 2)             (k + 1)
  cdfgr := [(lambda        (x - _gamma)

        hypergeom([k + 2, k + 2], [k + 3, k + 3], %1) _gamma -

              (k + 2)             (k + 1)
        lambda        (x - _gamma)

        hypergeom([k + 2, k + 2], [k + 3, k + 3], %1) x

         - 4 Psi(k + 2) GAMMA(k + 2)

                             k             k
         + 4 k exp(%1) lambda  (x - _gamma)

                                      k             k
         - 8 exp(%1) Psi(k + 2) lambda  (x - _gamma)  k

                                    k             k  3
         - exp(%1) Psi(k + 2) lambda  (x - _gamma)  k

                                      k             k  2
         - 5 exp(%1) Psi(k + 2) lambda  (x - _gamma)  k

                           k             k                 2
         + 5 exp(%1) lambda  (x - _gamma)  ln(x - _gamma) k

                           k             k
         + 8 exp(%1) lambda  (x - _gamma)  ln(x - _gamma) k

                         k                        k  3
         + exp(%1) lambda  ln(lambda) (x - _gamma)  k

                         k             k                 3
         + exp(%1) lambda  (x - _gamma)  ln(x - _gamma) k

                           k                        k  2
         + 5 exp(%1) lambda  ln(lambda) (x - _gamma)  k

                           k                        k
         + 8 exp(%1) lambda  ln(lambda) (x - _gamma)  k

                           k             k                  3
         + 4 exp(%1) lambda  (x - _gamma)  + %2 Psi(k + 2) k

                            2                                      3
         + 5 %2 Psi(k + 2) k  + 8 %2 Psi(k + 2) k - %2 ln(lambda) k

                            2
         - 5 %2 ln(lambda) k  - 8 %2 ln(lambda) k

                              3                        2
         - %2 ln(x - _gamma) k  - 5 %2 ln(x - _gamma) k

                                                            2
         - 8 %2 ln(x - _gamma) k - Psi(k + 2) GAMMA(k + 2) k

         - 4 Psi(k + 2) GAMMA(k + 2) k

                                        2
         + ln(x - _gamma) GAMMA(k + 2) k

         + 4 ln(x - _gamma) GAMMA(k + 2) k

                                    2
         + ln(lambda) GAMMA(k + 2) k  + 4 ln(lambda) GAMMA(k + 2) k

                           k                        k
         + 4 exp(%1) lambda  ln(lambda) (x - _gamma)

                                      k             k
         - 4 exp(%1) Psi(k + 2) lambda  (x - _gamma)

                           k             k
         + 4 exp(%1) lambda  (x - _gamma)  ln(x - _gamma)

                         k             k  2
         + exp(%1) lambda  (x - _gamma)  k

         + 4 ln(lambda) GAMMA(k + 2) + 4 ln(x - _gamma) GAMMA(k + 2)

         + 4 %2 Psi(k + 2) - 4 %2 ln(x - _gamma) - 4 %2 ln(lambda))

           /         2                        (k + 1)             k
          /  ((k + 2)  GAMMA(k + 2)), (-lambda        (x - _gamma)  x
         /

                 (k + 1)             k
         - lambda        (x - _gamma)  k x

                 (k + 1)             k
         + lambda        (x - _gamma)  _gamma

                 (k + 1)             k
         + lambda        (x - _gamma)  k _gamma

                 (k + 1)             (k + 1)
         + lambda        (x - _gamma)        k

                 (k + 1)             (k + 1)
         + lambda        (x - _gamma)

                 k             k           k             k  2
         + lambda  (x - _gamma)  k + lambda  (x - _gamma)  k )

        exp(%1)/(GAMMA(k + 2) lambda), - exp(%1) (

               (k + 1)             k
        -lambda        (x - _gamma)  x

                 (k + 1)             k
         - lambda        (x - _gamma)  k x

                 (k + 1)             k
         + lambda        (x - _gamma)  _gamma

                 (k + 1)             k
         + lambda        (x - _gamma)  k _gamma

                 (k + 1)             (k + 1)
         + lambda        (x - _gamma)        k

                 (k + 1)             (k + 1)
         + lambda        (x - _gamma)

                 k             k           k             k  2
         + lambda  (x - _gamma)  k + lambda  (x - _gamma)  k )/(

        (x - _gamma) GAMMA(k + 2))]

  %1 := -(x - _gamma) lambda

  %2 := GAMMA(k + 1, (x - _gamma) lambda)


       2          k        2 GAMMA(k + 1, x)
  - -------- - -------- + -------------------
           2          2          2
    (k + 1)    (k + 1)    (k + 1)  k GAMMA(k)

                         k                          k
                      2 x                          x
         - -------------------------- - ------------------------
                  2                            2
           (k + 1)  k GAMMA(k) exp(x)   (k + 1)  GAMMA(k) exp(x)

           k GAMMA(k + 1, x) ln(x)   2 GAMMA(k + 1, x) ln(x)
         - ----------------------- - -----------------------
                     2                         2
              (k + 1)  GAMMA(k)         (k + 1)  GAMMA(k)

           GAMMA(k + 1, x) Psi(k)   2 GAMMA(k + 1, x) Psi(k)
         + ---------------------- + ------------------------
                   2                          2
            (k + 1)  k GAMMA(k)        (k + 1)  GAMMA(k)

           GAMMA(k + 1, x) ln(x)   k GAMMA(k + 1, x) Psi(k)
         - --------------------- + ------------------------
                   2                         2
            (k + 1)  k GAMMA(k)       (k + 1)  GAMMA(k)

                        k
                       x                     1         ln(x)
         - --------------------------- - ---------- + --------
                  2  2                          2            2
           (k + 1)  k  GAMMA(k) exp(x)   (k + 1)  k   (k + 1)

            2
           k  Psi(k)    GAMMA(k + 1, x)      GAMMA(k + 1, x)
         - --------- + ----------------- + --------------------
                  2           2                   2  2
           (k + 1)     (k + 1)  GAMMA(k)   (k + 1)  k  GAMMA(k)

                                    2
            Psi(k)    2 k Psi(k)   k  ln(x)   2 k ln(x)
         - -------- - ---------- + -------- + ---------
                  2           2           2          2
           (k + 1)     (k + 1)     (k + 1)    (k + 1)

                     k                          k
                  k x  ln(x)                   x  ln(x)
         + ------------------------ + --------------------------
                  2                          2
           (k + 1)  GAMMA(k) exp(x)   (k + 1)  k GAMMA(k) exp(x)

                     k                         k
                  2 x  ln(x)                2 x  Psi(k)
         + ------------------------ - ------------------------
                  2                          2
           (k + 1)  GAMMA(k) exp(x)   (k + 1)  GAMMA(k) exp(x)

            k
           x  x hypergeom([k + 1, k + 1], [k + 2, k + 2], -x)
         - --------------------------------------------------
                                 2
                          (k + 1)  k GAMMA(k)

                    k                          k
                 k x  Psi(k)                  x  Psi(k)
         - ------------------------ - --------------------------
                  2                          2
           (k + 1)  GAMMA(k) exp(x)   (k + 1)  k GAMMA(k) exp(x)


            valnum := k = 1.5, lambda = 2.5, _gamma = -0.5


                                 ddf


                             0.1284713816


                             0.9424415478


                    0.4289502207 + 0.7851195123 I


             [0.1651198816, -0.1156242435, 0.2783546603]


            [-0.08756249102, 0.07708282900, -0.1284713816]


                             1.062945580


                             0.1000000000


                             0.4898979484


                             1.632993162


                             6.999999999


                             0.2400000000


                     [0.1000000000, 0.4898979484]


                              [1.5, 2.5]

> restart:assume(k,integer,k>2):
> eq:=F(k+1)=F(k)-x^k*exp(-x)/k/GAMMA(k);
> collect(expand(solve(eq,F(k+1))),F(k));

                                           k~
                                          x   exp(-x)
                eq := F(k~ + 1) = F(k~) - ------------
                                          k~ GAMMA(k~)


                                      k~
                                     x
                     F(k~) - -------------------
                             k~ GAMMA(k~) exp(x)

> map(factor,collect(expand(solve(subs(k=k-1,eq),F(k-1))),F(k)));

                                      k~
                                     x
                      F(k~) + ------------------
                              GAMMA(k~) x exp(x)

> int(log(x),x);

                             x ln(x) - x

>