3 SCHMIDT et al. : IMPLEMENTATION STRATEGIES FOR HYPERSPECTRAL UNMIXING... Algorithm 2 Fully constrained Bayesian positive source sep- aration algorithm (BPSS2) Algorithm 1 Bayesian positive source separation algorithm (BPSS) for i = 1 , . . . , N$_{MC}$ do % sampling the abundance hyperparameters for p = 1 , . . . , P do Draw λ$_{p}$ from the pdf for i = 1 , . . . , N$_{MC}$ do % sampling the abundance vectors for p = 1 , . . . , P do Draw a$_{p}$$_{:}$ from the pdf with end for % sampling the noise hyperparameter Draw ψ$_{e}$ from the inverse-gamma distribution end for % sampling the abundance hyperparameters for p = 1 , . . . , P do Draw γ$_{p}$ from the gamma distribution end for % sampling the abundance vectors for p = 1 , . . . , P and r = 1 , . . . , R do Draw a$_{p,r}$ from the pdf % sampling the noise variances for p = 1 , . . . , P do Draw σ 2 e ,p from the inverse-gamma distribution end for % sampling the source hyperparameters for r = 1 , . . . , R do Draw α$_{r}$ from the pdf end for % sampling the noise hyperparameter Draw ψ$_{e}$ from the inverse-gamma distribution end for % sampling the source hyperparameters for r = 1 , . . . , R do Draw β$_{r}$ from the gamma distribution % sampling the noise variances for p = 1 , . . . , P do Draw σ 2 e ,p from the inverse-gamma distribution end for % sampling the source spectrum for r = 1 , . . . , R and l = 1 , . . . , L do Draw s$_{r,l}$ from the pdf end for % sampling the source hyperparameters for r = 1 , . . . , R do Draw α$_{r}$ from the pdf end for end for end for % sampling the source hyperparameters for r = 1 , . . . , R do Draw β$_{r}$ from the gamma distribution end for % sampling the source spectrum for r = 1 , . . . , R and l = 1 , . . . , L do Draw s$_{r,l}$ from the pdf end for end for time on an x86 processor architecture, while the changes to the code have been minimal. Furthermore, most dataset come as single precision. 3) OS Architecture: It is interesting to note that MATLAB c ○ is limited in terms of memory usage (regardless of the size of physical memory). This depends on the Operating System (OS) and on the MATLAB version (see Table II-A3). Therefore, a 32-bits LINUX architecture has been chosen. 4) Parallelization: MATLAB c ○ contains libraries dedicated to automatically parallelize parts of the algorithms on a single computer. BPSS has been run on a 4 -core machine. The underlying matrix libraries already provide a certain level of parallelism depending on the number of available cores. However, in the future, parts of the code could be parallelized f $^{(}$a$_{p}$$_{:}$ | A , σ 2 $_{e}$, X ) ∝ exp$^{[}$ − 1 2 $^{(}$a$_{p}$$_{:}$ − µ$_{p}$ ) $^{T}$Λ − 1 p $^{(}$a$_{p}$$_{:}$ − µ$_{p}$ ) ] 1$_{S}$ ( a$_{p}$$_{:}$ ) . S = { a$_{p}$$_{:}$ ; a$_{p,r}$ ≥ 0 , ∀ r = 1 , . . . , R, R ∑ r =1 a$_{p,r}$ = 1$^{}}$ . f $^{(}$λ$_{p}$ ∣ $_{∣}$a$_{p}$$_{:}$ , γ$_{p}$ ) ∝ R ∏ r =1 [ γ λ p p Γ ( λ$_{p}$ ) a λ p p,r ] e − ϵλ $^{p}$1$_{R}$$_{+}$ ( λ$_{p}$ ) . ψ$_{e}$ ∣ $_{∣}$σ 2 $_{e}$, ρ$_{e}$ ∼ IG   P ρ$_{e}$ 2 , 1 2 P ∑ p =1 1 σ 2 e ,p  $_{}$. γ$_{p}$ ∣ $_{∣}$λ$_{p}$ , a$_{p}$$_{:}$ ∼ G ( 1 + Rλ$_{p}$ + ϵ, R ∑ r =1 a$_{p,r}$ + ϵ$^{)}$ . f $^{(}$a$_{p,r}$ ∣ $_{∣}$λ$_{p}$ , γ$_{p}$, S , σ 2 $_{e}$, X ) ∝ a λ r − 1 p,r 1$_{R}$$_{+}$ ( a$_{p,r}$ ) exp$^{[}$ − ( a$_{p,r}$ − µ$_{p,r}$ ) 2 2 δ 2 p − γ$_{p}$a$_{p,r}$$^{]}$ , σ 2 e ,p | ψ$_{e}$, a$_{p}$$_{:}$ , S , x$_{p}$$_{:}$ ∼ IG $^{(}$ρ$_{e}$ + L 2 , ψ$_{e}$ + ‖ x$_{p}$$_{:}$ − Sa$_{p}$$_{:}$ ‖ 2 2 ) . f $^{(}$α$_{r}$ ∣ $_{∣}$s$_{r}$$_{:}$ , β$_{r}$ ) ∝ L ∏ l =1 [ β α r r Γ ( α$_{r}$ ) s α r r,l ] e − ϵα $^{r}$1$_{R}$$_{+}$ ( α$_{r}$ ) . ψ$_{e}$ ∣ $_{∣}$σ 2 $_{e}$, ρ$_{e}$ ∼ IG   P ρ$_{e}$ 2 , 1 2 P ∑ p =1 1 σ 2 e ,p  $_{}$. β$_{r}$ ∣ $_{∣}$α$_{r}$ , s$_{r}$$_{:}$ ∼ G ( 1 + Lα$_{r}$ + ϵ, L ∑ l =1 s$_{r,l}$ + ϵ$^{)}$ . σ 2 e ,p | ψ$_{e}$, a$_{p}$$_{:}$ , S , x$_{p}$$_{:}$ ∼ IG $^{(}$ρ$_{e}$ + L 2 , ψ$_{e}$ + ‖ x$_{p}$$_{:}$ − Sa$_{p}$$_{:}$ ‖ 2 2 ) . f $^{(}$α$_{r}$ ∣ $_{∣}$s$_{r}$$_{:}$ , β$_{r}$ ) ∝ L ∏ l =1 [ β α r r Γ ( α$_{r}$ ) s α r r,l ] e − ϵα $^{r}$1$_{R}$$_{+}$ ( α$_{r}$ ) . f $^{(}$s$_{r,l}$ ∣ $_{∣}$α$_{r}$ , β$_{r}$, A , σ 2 $_{e}$, X ) ∝ s α r − 1 r,l 1$_{R}$$_{+}$ ( s$_{r,l}$ ) exp$^{[}$ − ( s$_{r,l}$ − µ$_{r,l}$ ) 2 2 δ 2 r − β$_{r}$s$_{r,l}$$^{]}$ , β$_{r}$ ∣ $_{∣}$α$_{r}$ , s$_{r}$$_{:}$ ∼ G ( 1 + Lα$_{r}$ + ϵ, L ∑ l =1 s$_{r,l}$ + ϵ$^{)}$ . f $^{(}$s$_{r,l}$ ∣ $_{∣}$α$_{r}$ , β$_{r}$, A , σ 2 $_{e}$, X ) ∝ s α r − 1 r,l 1$_{R}$$_{+}$ ( s$_{r,l}$ ) exp$^{[}$ − ( s$_{r,l}$ − µ$_{r,l}$ ) 2 2 δ 2 r − β$_{r}$s$_{r,l}$$^{]}$ ,