Skip to content

Commit 0733024

Browse files
committed
syntax and doc correction
1 parent c22015e commit 0733024

15 files changed

+128
-128
lines changed

.github/workflows/Build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
julia-version: ['1.6.1']
10+
julia-version: ['1.6.1', '1.7']
1111
julia-arch: [x64]
1212
os: [ubuntu-latest, windows-latest, macOS-latest]
1313
exclude:

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The following examples are intended for a quick introduction to FactorGraph pack
3636
```julia-repl
3737
using FactorGraph
3838
39-
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # jacobian matrix
39+
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # coefficient matrix
4040
z = [0.5; 0.8; 4.1] # observation vector
4141
v = [0.1; 1.0; 1.0] # variance vector
4242
@@ -52,7 +52,7 @@ marginal(gbp) # compute marginals
5252
```julia-repl
5353
using FactorGraph
5454
55-
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # jacobian matrix
55+
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # coefficient matrix
5656
z = [0.5; 0.8; 4.1] # observation vector
5757
v = [0.1; 1.0; 1.0] # variance vector
5858
@@ -77,7 +77,7 @@ marginal(gbp) # compute marginals
7777
```julia-repl
7878
using FactorGraph
7979
80-
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # jacobian matrix
80+
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # coefficient matrix
8181
z = [0.5; 0.8; 4.1] # observation vector
8282
v = [0.1; 1.0; 1.0] # variance vector
8383
@@ -105,7 +105,7 @@ marginal(gbp) # compute marginals
105105
```julia-repl
106106
using FactorGraph
107107
108-
H = [1 0 0 0 0; 6 8 2 0 0; 0 5 0 0 0; # jacobian matrix
108+
H = [1 0 0 0 0; 6 8 2 0 0; 0 5 0 0 0; # coefficient matrix
109109
0 0 2 0 0; 0 0 3 8 2]
110110
z = [1; 2; 3; 4; 5] # observation vector
111111
v = [3; 4; 2; 5; 1] # variance vector

docs/src/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The following examples are intended for a quick introduction to FactorGraph pack
4848
```julia-repl
4949
using FactorGraph
5050
51-
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # jacobian matrix
51+
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # coefficient matrix
5252
z = [0.5; 0.8; 4.1] # observation vector
5353
v = [0.1; 1.0; 1.0] # variance vector
5454
@@ -64,7 +64,7 @@ marginal(gbp) # compute marginals
6464
```julia-repl
6565
using FactorGraph
6666
67-
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # jacobian matrix
67+
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # coefficient matrix
6868
z = [0.5; 0.8; 4.1] # observation vector
6969
v = [0.1; 1.0; 1.0] # variance vector
7070
@@ -89,7 +89,7 @@ marginal(gbp) # compute marginals
8989
```julia-repl
9090
using FactorGraph
9191
92-
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # jacobian matrix
92+
H = [1.0 0.0 0.0; 1.5 0.0 2.0; 0.0 3.1 4.6] # coefficient matrix
9393
z = [0.5; 0.8; 4.1] # observation vector
9494
v = [0.1; 1.0; 1.0] # variance vector
9595
@@ -117,7 +117,7 @@ marginal(gbp) # compute marginals
117117
```julia-repl
118118
using FactorGraph
119119
120-
H = [1 0 0 0 0; 6 8 2 0 0; 0 5 0 0 0; # jacobian matrix
120+
H = [1 0 0 0 0; 6 8 2 0 0; 0 5 0 0 0; # coefficient matrix
121121
0 0 2 0 0; 0 0 3 8 2]
122122
z = [1; 2; 3; 4; 5] # observation vector
123123
v = [3; 4; 2; 5; 1] # variance vector

docs/src/man/continuousInference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ Same as before, the function accepts only the composite type `ContinuousModel`.
5555
---
5656

5757
#### Dynamic inference
58-
This framework is an extension to the real-time model that operates continuously and accepts asynchronous mean and variance values. More precisely, in each GBP iteration user can change the mean and variance values of the corresponding factor nodes and continue the GBP iteration process. We advise the reader to read the section [dynamic GBP algorithm] (@ref dynamicGBP) which provides a detailed description of the input parameters.
58+
This framework is an extension to the real-time model that operates continuously and accepts asynchronous observation (i.e., mean) and variance values. More precisely, in each GBP iteration user can change the observation and variance values of the corresponding factor nodes and continue the GBP iteration process. We advise the reader to read the section [dynamic GBP algorithm] (@ref dynamicGBP) which provides a detailed description of the input parameters.
5959
```julia-repl
60-
dynamicFactor!(gbp; factor = index, mean = value, variance = value)
60+
dynamicFactor!(gbp; factor = index, observation = value, variance = value)
6161
```
62-
The function accepts the composite type `ContinuousModel` and keywords `factor`, `mean` and `variance`, which defines the dynamic update scheme of the factor nodes. The factor node index corresponding to the row index of the jacobian matrix. Note that during each function call, `ContinuousSystem.observation` and `ContinuousSystem.variance` fields also change values according to the scheme.
62+
The function accepts the composite type `ContinuousModel` and keywords `factor`, `observation` and `variance`, which defines the dynamic update scheme of the factor nodes. The factor node index corresponding to the row index of the coefficient matrix. Note that during each function call, `ContinuousSystem.observation` and `ContinuousSystem.variance` fields also change values according to the scheme.
6363

6464
---
6565

docs/src/man/continuousInput.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ The FactorGraph package supports continuous random variables, where local functi
88
```math
99
\mathcal{N}(z_i|\mathcal{X}_i,v_i) \propto \exp\Bigg\{-\cfrac{[z_i-h_i(\mathcal{X}_i)]^2}{2v_i}\Bigg\}.
1010
```
11-
Hence, the local function is associated with mean ``z_i``, variance ``v_i``, and linear equation ``h_i(\mathcal{X}_i)``. To describe the joint probability density function ``g(\mathcal{X})``, it is enough to define the Jacobian matrix containing coefficients of the equations, and vectors of mean and variance values. Then, the ``i``-th row of the Jacobian matrix, with consistent entries of mean and variance, defines the local function ``\psi_i(\mathcal{X}_i)``.
11+
Hence, the local function is associated with observation ``z_i``, variance ``v_i``, and linear equation ``h_i(\mathcal{X}_i)``. To describe the joint probability density function ``g(\mathcal{X})``, it is enough to define the coefficient matrix containing coefficients of the equations, and vectors of observation and variance values. Then, the ``i``-th row of the coefficient matrix, with consistent entries of observation and variance, defines the local function ``\psi_i(\mathcal{X}_i)``.
1212

13-
Thus, the input data structure includes the `jacobian` variable, while variables `observation` and `variance` represent mean and variance vectors, respectively. The functions `continuousModel()` and `continuousTreeModel()` accept variables `jacobian`, `observation` and `variance`.
13+
Thus, the input data structure includes the `coefficient` variable which describes coefficients of the equations, while variables `observation` and `variance` represent observation and variance vectors, respectively. The functions `continuousModel()` and `continuousTreeModel()` accept variables `coefficient`, `observation` and `variance`.
1414

1515
---
1616

@@ -21,16 +21,16 @@ Let us observe the following joint probability density function:
2121
g(\mathcal{X}) \propto \exp\Bigg\{-\cfrac{[2.5 - 0.2x_1]^2}{2\cdot 1.1}\Bigg\}\exp\Bigg\{-\cfrac{[0.6 - (2.1x_1 + 3.4x_2)]^2}{2\cdot 3.5}\Bigg\}
2222
```
2323

24-
We can describe the joint probability density function using variables `jacobian`, `observation` and `variance`. Passing data directly via command-line support the following format, where the Jacobian matrix can be defined as a full or sparse matrix:
24+
We can describe the joint probability density function using variables `coefficient`, `observation` and `variance`. Passing data directly via command-line support the following format, where the coefficient matrix can be defined as a full or sparse matrix:
2525
```julia-repl
26-
jacobian = zeros(2, 2)
27-
jacobian[1, 1] = 0.2; jacobian[2, 1] = 2.1; jacobian[2, 2] = 3.4
26+
coefficient = zeros(2, 2)
27+
coefficient[1, 1] = 0.2; coefficient[2, 1] = 2.1; coefficient[2, 2] = 3.4
2828
observation = [2.5; 0.6]
2929
variance = [1.1; 3.5]
3030
31-
gbp = continuousModel(jacobian, observation, variance)
31+
gbp = continuousModel(coefficient, observation, variance)
3232
```
3333
Here, the variable `gbp` holds the main composite type related to the continuous model. In the case of a tree factor graph, when you want to use a forward-backward GBP algorithm, then the following command can be used:
3434
```julia-repl
35-
gbp = continuousTreeModel(jacobian, observation, variance)
35+
gbp = continuousTreeModel(coefficient, observation, variance)
3636
```

docs/src/man/continuousModel.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Input arguments of the function `continuousModel()` describe the graphical model
1717

1818
Loads the system data passing arguments:
1919
```julia-repl
20-
gbp = continuousModel(jacobian, observation, variances)
20+
gbp = continuousModel(coefficient, observation, variances)
2121
```
2222

2323
---
@@ -64,7 +64,7 @@ freezeVariableFactor!(gbp; variable = index, factor = index)
6464
```julia-repl
6565
freezeFactorVariable!(gbp; factor = index, variable = index)
6666
```
67-
The functions accept following parameters: composite type `ContinuousModel`; the factor node index corresponding to the row index of the Jacobian matrix; and the variable node index corresponding to the column index of the Jacobian matrix. Note that the singly connected factor nodes can not be frozen because they always send the same message.
67+
The functions accept following parameters: composite type `ContinuousModel`; the factor node index corresponding to the row index of the coefficient matrix; and the variable node index corresponding to the column index of the coefficient matrix. Note that the singly connected factor nodes can not be frozen because they always send the same message.
6868

6969
---
7070

@@ -85,7 +85,7 @@ defreezeVariableFactor!(gbp; variable = index, factor = index)
8585
defreezeFactorVariable!(gbp; factor = index, variable = index)
8686
```
8787

88-
The functions accept following parameters: composite type `ContinuousModel`; the factor node index corresponding to the row index of the Jacobian matrix; and the variable node index corresponding to the column index of the Jacobian matrix. Since singly connected factors cannot be frozen, they cannot be unfreezed.
88+
The functions accept following parameters: composite type `ContinuousModel`; the factor node index corresponding to the row index of the coefficient matrix; and the variable node index corresponding to the column index of the coefficient matrix. Since singly connected factors cannot be frozen, they cannot be unfreezed.
8989

9090
---
9191

@@ -94,14 +94,14 @@ Utilising a hiding mechanism, the function softly deletes factor node. Hence, th
9494
```julia-repl
9595
hideFactor!(gbp; factor = index)
9696
```
97-
If the function targets the singly connected factor node, the function obliterates the target factor only if there are two or more singly connected factor nodes at the same variable node. If there is only one singly connected factor node at the variable node, the function transforms the target factor node to the virtual factor node. Note that to maintain consistency, the function also affects `ContinuousSystem.observation`, `ContinuousSystem.jacobian` and `ContinuousSystem.jacobianTranspose` fields by setting non-zero elements to zero.
97+
If the function targets the singly connected factor node, the function obliterates the target factor only if there are two or more singly connected factor nodes at the same variable node. If there is only one singly connected factor node at the variable node, the function transforms the target factor node to the virtual factor node. Note that to maintain consistency, the function also affects `ContinuousSystem.observation`, `ContinuousSystem.coefficient` and `ContinuousSystem.coefficientTranspose` fields by setting non-zero elements to zero.
9898

9999
---
100100

101101
#### Add factor nodes
102102
The function adds new factor nodes to the existing factor graph.
103103
```julia-repl
104-
addFactors!(gbp; mean = vector, variance = vector, jacobian = matrix)
104+
addFactors!(gbp; coefficient = matrix, observation = vector, variance = vector)
105105
```
106-
The function supports addition of the multiple factor nodes to initial (existing) formation of the factor graph using the same input data format. The function accepts the following parameters: composite type `ContinuousModel`; the `mean` and `variance` vectors representing new measurement values and variances, respectively. The keyword `jacobian` with corresponding coefficients defines the set of equations describing new factor nodes. Also, function initializes messages from variable nodes to a new factor node using results from the last GBP iteration. Note that the function also affects `ContinuousSystem.observation`, `ContinuousSystem.variance`, `ContinuousSystem.jacobian` and `ContinuousSystem.jacobianTranspose` fields.
106+
The function supports addition of the multiple factor nodes to initial (existing) formation of the factor graph using the same input data format. The function accepts the following parameters: composite type `ContinuousModel`; the `observation` and `variance` vectors representing new observation values and variances, respectively. The keyword `coefficient` with corresponding coefficients defines the set of equations describing new factor nodes. Also, function initializes messages from variable nodes to a new factor node using results from the last GBP iteration. Note that the function also affects `ContinuousSystem.observation`, `ContinuousSystem.variance`, `ContinuousSystem.coefficient` and `ContinuousSystem.coefficientTranspose` fields.
107107

docs/src/man/continuousTreeModel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Input arguments of the function `continuousTreeModel()` describe the tree graphi
1515

1616
Loads the system data passing arguments:
1717
```julia-repl
18-
gbp = continuousTreeModel(jacobian, observation, variances)
18+
gbp = continuousTreeModel(coefficient, observation, variances)
1919
```
2020

2121
---

docs/src/man/theoreticalBelief.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Thus, as an input, we observe a noisy linear system of equations with real coeff
99
```math
1010
\mathbf{z}=\mathbf{h}(\mathbf{x})+\mathbf{u},
1111
```
12-
where ``\mathbf {x}=[x_1,\dots,x_{n}]^{{T}}`` is the vector of the state variables, ``\mathbf{h}(\mathbf{x})= [h_1(\mathbf{x})``, ``\dots``, ``h_k(\mathbf{x})]^{{T}}`` is the vector of observation or measurement functions, ``\mathbf{z} = [z_1,\dots,z_m]^{{T}}`` is the vector of observation values, and ``\mathbf{u} = [u_1,\dots,u_k]^{{T}}`` is the vector of uncorrelated observation errors. The linear system of equations is an overdetermined ``m>n`` arising in many technical fields, such as statistics, signal processing, and control theory.
12+
where ``\mathbf {x}=[x_1,\dots,x_{n}]^{{T}}`` is the vector of the state variables, ``\mathbf{h}(\mathbf{x})= [h_1(\mathbf{x})``, ``\dots``, ``h_k(\mathbf{x})]^{{T}}`` is the vector of observation functions, ``\mathbf{z} = [z_1,\dots,z_m]^{{T}}`` is the vector of observation values, and ``\mathbf{u} = [u_1,\dots,u_k]^{{T}}`` is the vector of uncorrelated observation errors. The linear system of equations is an overdetermined ``m>n`` arising in many technical fields, such as statistics, signal processing, and control theory.
1313

1414
Each observation is associated with observed value ``z_i``, error ``u_i``, and function ``h_i(\mathbf{x})``. Under the assumption that observation errors ``u_i`` follow a zero-mean Gaussian distribution, the probability density function associated with the ``i``-th observation is proportional to:
1515
```math
@@ -156,9 +156,9 @@ The randomised damping parameter pairs lead to a trade-off between the number of
156156
---
157157

158158
### [Dynamic GBP algorithm] (@id dynamicGBP)
159-
To recall, each factor node is associated with the mean ``z_i`` and variance value ``v_i``. The dynamic framework allows the update of these values in any GBP iteration ``\tau``. This framework is an extension to the real-time model that operates continuously and accepts asynchronous data. Such data are continuously integrated into the running instances of the GBP algorithm. Hence, the GBP algorithm can update the state estimate vector in a time-continuous process.
159+
To recall, each factor node is associated with the observation ``z_i`` and variance value ``v_i``. The dynamic framework allows the update of these values in any GBP iteration ``\tau``. This framework is an extension to the real-time model that operates continuously and accepts asynchronous data. Such data are continuously integrated into the running instances of the GBP algorithm. Hence, the GBP algorithm can update the state estimate vector in a time-continuous process.
160160

161-
Additionally, this framework allows for the artificial addition and removal of factor nodes. Then, the initial factor graph, described with the Jacobian matrix, should include all possible factor nodes. Factor nodes that are not active are then taken into account via extremely large values of variances (e.g., ``10^{60}``). Consequently, estimates will have a unique solution according to variances whose values are much smaller than ``10^{60}``.
161+
Additionally, this framework allows for the artificial addition and removal of factor nodes. Then, the initial factor graph, described with the coefficient matrix, should include all possible factor nodes. Factor nodes that are not active are then taken into account via extremely large values of variances (e.g., ``10^{60}``). Consequently, estimates will have a unique solution according to variances whose values are much smaller than ``10^{60}``.
162162

163163
---
164164

docs/src/man/utility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The function provides the estimate obtained by the weighted least-squares (WLS)
88
```julia-repl
99
exact = wls(gbp)
1010
```
11-
The function returns the composite type `WeightedLeastSquares` with fields `estimate`, `rmse`, `mae`, `wrss`. Note that results are obtained according to variables `ContinuousSystem.jacobian`, `ContinuousSystem.observation` and `ContinuousSystem.variance`.
11+
The function returns the composite type `WeightedLeastSquares` with fields `estimate`, `rmse`, `mae`, `wrss`. Note that results are obtained according to variables `ContinuousSystem.coefficient`, `ContinuousSystem.observation` and `ContinuousSystem.variance`.
1212

1313
----
1414
#### The GBP error metrics

0 commit comments

Comments
 (0)