## 2 Materials and Methods
### Statistics and Machine Learning  
Analyses were carried out separately for the microphone-based recordings and for the accelerometer-based recordings. When a participant performed the same task multiple times on a single day, the measures based on that task were averaged to produce a single value per measure per day. For each measure, [PERSON]'s \(d\) effect sizes for paired samples were computed as \(\frac{\overline{x}_{2}-\overline{x}_{1}}{\sigma}\), where \(\overline{x}_{1}\) and \(\overline{x}_{2}\) were the means of the admission and discharge values for each measure, respectively, and \(\sigma\) was the standard deviation of the admission-to-discharge day differences. To investigate whether voice and speech features could distinguish stable versus decompensated heart failure, we used machine learning to classify speech samples into \"admission\" and \"discharge\" classes. Patients' first recordings were labeled as \"admission\", and their last recordings were labeled as \"discharge\". We used supervised learning to train a classifier based on a regularized logistic regression model, with the acoustic voice and speech features described above as inputs and the admission/discharge classes as labels to be predicted. This classification task was chosen as it allows for an initial understanding of how well voice and speech features may perform on a binary healthy/ unhealthy classification task that could then be used to inform a more granular analysis of feature trajectories. Each data point for the model input consisted of the admission or discharge label and all the features associated with a single day of recording for a single participant. There were thus 104 input points for each of the 52 participants (features at admission and discharge). Some features could not be computed for every recording, since occasionally participants did not complete a task or the recording quality was inadequate for analysis. Any data point with one or more features missing was excluded from the model input. The remaining input data was z-normalized so that each feature had a mean of 0 and standard deviation of 1. Since the MPT was added partway through data collection, not all participants completed the task. Therefore, the model creation process was run twice: once with all the participants but not the MPT feature (\"MPT\(-\)\" model) and once with the MPT feature but only the participants who completed it (\"MPT+\" model). After removing missing data, the MPT\(-\) model had 91 inputs from 51 participants, and the MPT+ model had 42 inputs from 24 participants. MATLAB's _fitclinear_ function was used to train logistic classifiers using the leave-one-participant-out cross-validation method described below. In these classification models, \(n\) input features \(\{x_{1},\ x_{2},\ldots x_{n}\}\) are combined linearly using learned coefficients \(\{\beta_{0},\ \beta_{1},\ \beta_{2},\ldots\beta_{n}\}\):  
\[f(x)=\beta_{0}+\beta_{1}x_{1}+\beta_{2}x_{2}+\ldots+\beta_{n}x_{n} \tag{1}\]The learning process attempts to find \(\beta\) coefficients that minimize the loss function \(L\) for a prediction relative to the labels \(\{y_{1},\ y_{2},\cdots y_{n}\}\) that indicate whether a data point was produced at admission (+1) or discharge (\(-1\)):  
\[L(y,\ f(x))=log\Big{(}1+e^{-yf(x)}\Big{)} \tag{2}\]  
where \(y\) is the known label (+1 or \(-1\)) and \(f(x)\) is the model output, which ranges from +1 to \(-1\). Intuitively, this loss function penalizes large mismatches between the label \(y\) and the model output \(f(x)\) for each point. It especially penalizes predictions that have opposite sign to the labels. When \(y\) and \(f(x)\) have the same sign for a given data point, the model's classification is correct: the prediction correctly aligns with that point's label. In that case, the product \(-yf(x)\) is negative, and \(e^{-yf(x)}<1\). If \(y\) and \(f(x)\) do not have the same sign (i.e., if the classification is incorrect), then \(-yf(x)>0\), and \(e^{-yf(x)}>1\).