Skip to content

Commit d4b6821

Browse files
committed
matrix expectation and covariance
1 parent ebe8f93 commit d4b6821

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

theories/probability.v

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,8 +1391,7 @@ apply: cvgeM.
13911391
- apply: mule_def_fin => //.
13921392
apply: integral_fune_fin_num => //.
13931393
exact: integrableS _ _ _ f_int.
1394-
- suff: semi_sigma_additive nu; first exact.
1395-
exact: nu_sigma_additive.
1394+
- exact: nu_sigma_additive.
13961395
- exact: cvg_cst.
13971396
Qed.
13981397

@@ -1416,3 +1415,29 @@ HB.instance Definition _ :=
14161415
@Measure_isProbability.Build _ _ R wgt wgt_setT.
14171416

14181417
End weighted.
1418+
1419+
From mathcomp Require Import matrix.
1420+
1421+
Section vector_expectation.
1422+
Context d (T : measurableType d) (R : realType).
1423+
1424+
Local Open Scope ereal_scope.
1425+
1426+
Definition matrix_expectation m n (P : probability T R) (X : 'M[{RV P >-> R}]_(m, n)) :=
1427+
\matrix_(i < m, j < n) 'E_P[X i j].
1428+
1429+
Notation "'mE_ P [ X ]" := (@matrix_expectation _ _ P X).
1430+
1431+
1432+
Definition mulmxfun {m n p} (A : 'M[{mfun T >-> R}]_(m, n)) (B : 'M[{mfun T >-> R}]_(n, p)) F G z : 'M[{mfun T >-> R}]_(m, p) :=
1433+
\matrix_(i, k) \big[F/z]_j (G (A i j) (B j k))%R.
1434+
1435+
1436+
Context m n (P : probability T R) (X : 'M[{RV P >-> R}]_(m, n)) (Y : 'M[{RV P >-> R}]_(m, n)).
1437+
(* Definition x : {RV P >-> R} := [the {RV P >-> R} of (X 0%O 0%O \-cst (fine 'E_P[X 0%O 0%O]))%R]. *)
1438+
Definition A : 'M[{RV P >-> R}]_(m,n) := (\matrix_(i, j) [the {RV P >-> R} of (X i j \-cst (fine 'E_P[X i j]))])%R.
1439+
Definition B : 'M[{RV P >-> R}]_(m,n) := (\matrix_(i, j) [the {RV P >-> R} of (Y i j \-cst (fine 'E_P[Y i j]))])%R.
1440+
Definition matrix_covariance :=
1441+
'mE_P[ mulmxfun A B^T (GRing.add_fun) (GRing.mul_fun) (cst 0) ]%R.
1442+
1443+
End vector_expectation.

0 commit comments

Comments
 (0)