Disclosure of Invention
The invention mainly solves the technical problems that the sleeping quality assessment in the prior art generally needs external additional equipment, is inconvenient to use, has strong somatosensory, affects sleeping quality of users and the like, and provides a sleeping quality assessment method based on network analysis so as to improve sleeping quality assessment efficiency.
The invention provides a sleep quality assessment method based on network analysis, which comprises the following steps:
Step 100, collecting sleep quality and mental health relation data;
step 200, adopting EBICglasso model, and obtaining sleep quality evaluation model by utilizing sleep quality and mental health relationship data;
step 300, acquiring predicted sleep quality node data input by a user to be evaluated, and analyzing the user data to be evaluated by using the obtained sleep quality evaluation model to obtain a minimum predicted interval of sleep quality;
Step 400, outputting a sleep quality interval according to the obtained minimum prediction interval of the sleep quality, and realizing sleep quality assessment.
Further, the types of mental health include, but are not limited to, depression, anxiety, and stress.
Further, the step 200 includes the following steps:
step 201, determining connection coefficients between nodes of the model according to an evolution path of the following EBICglasso model:
y=Xβ+∈
For n observations and p parameters, y is an n X1 vector of the result, beta is a p X1 vector of a beta coefficient, epsilon is an n X1 error vector, and X is an n X p design matrix;
step 202, constructing a sleep quality assessment model according to the determined connection coefficients among the nodes of the model.
Further, in step 201, the connection coefficients between the nodes of the model are calibrated by:
1) The mental health index evaluation error value is calculated using the following formula:
(y-Xβ)T(y-Xβ)
2) And adjusting a mental health index evaluation error value by using a Lasso method, and further calibrating connection coefficients among nodes of a model, wherein a Residual Square Sum (RSS) formula is as follows:
where λ is a penalty or tuning parameter introduced to avoid the problems faced by the common least squares.
Further, the step 300 includes the following steps:
step 301, obtaining a predicted sleep quality node selected by a user to be evaluated, and obtaining psychological assessment data corresponding to the predicted sleep quality node filled by the user;
step 302, assuming that the first predicted sleep quality node is X, the sleep quality to be predicted is Y, and the first predicted sleep quality node X is known, generating the following estimation interval regarding the sleep quality to be predicted Y according to the connection coefficient b 1 of the first predicted sleep quality node being X and the sleep quality to be predicted being Y:
[ x-b 1y,x+b1 y ], wherein x-b 1y=m,x+b1 y=n;
step 303, according to the mental health data network relationship, the second predicted sleep quality node Z is another variable associated with the sleep quality to be predicted Y, and according to the connection coefficient b 2 between the first predicted sleep quality node X and the second predicted sleep quality node Z, the following estimated interval of the first predicted sleep quality node X to the second predicted sleep quality node Z is equally output:
[ x-b 2z,x+b2 z ], wherein x-b 2z=a,x+b2 z=b;
Step 304 may make a prediction according to the evaluation interval of the sleep quality to be predicted Y by the second predicted sleep quality node Z, and output two evaluation intervals by using the maximum value and the minimum value of the path estimation of the first predicted sleep quality node x→the second predicted sleep quality node Z, where the connection coefficient between the second predicted sleep quality node Z and the sleep quality to be predicted Y is b 3, and confirm the minimum evaluation interval of the sleep quality to be predicted Y value as follows by using the interval intersection:
[ a-b 3y,a+b3 y ], wherein a-b 3y=p,a+b3 y=q
[ B-b 3y,b+b3 y ], wherein b-b 3y=e,b+b3 y=f
Wherein m, n, a, b, p, q, e, f represents mental health indexes, respectively;
Step 305, taking the psychological health index m, n, a, b, p, q, e, f on the number axis according to the estimated interval of the sleep quality Y to be predicted generated in step 302, the estimated interval of the first predicted sleep quality node X to the second predicted sleep quality node Z output in step 303, and the minimum estimated interval of the sleep quality Y value to be predicted formed in step 304, and taking the interval between the fourth point and the fifth point after respectively arranging as the minimum predicted interval of the sleep quality Y value to be predicted, wherein the average value of the maximum value and the minimum value of the interval is the optimal predicted point of the sleep quality Y value to be predicted.
Correspondingly, the invention also provides a sleep quality assessment system based on network analysis, which comprises a data pre-input subsystem A, a network model construction subsystem B, an assessment data input and analysis subsystem C and an assessment data output feedback subsystem D;
the data pre-input subsystem A is used for collecting sleep quality and mental health relation data;
The network model construction subsystem B is used for obtaining a sleep quality assessment model by adopting EBICglasso models and utilizing sleep quality and mental health relationship data;
The evaluation data input and analysis subsystem C is used for collecting the predicted sleep quality node data input by the user to be evaluated, and analyzing the user data to be evaluated by utilizing the obtained sleep quality evaluation model to obtain the minimum predicted interval of the sleep quality;
And the evaluation data output feedback subsystem D is used for outputting a sleep quality interval according to the obtained minimum prediction interval of the sleep quality to realize sleep quality evaluation.
According to the sleep quality assessment method based on the network analysis, which is provided by the invention, the sleep quality assessment model is obtained based on the network analysis method, and the sleep quality assessment is performed by utilizing the sleep quality assessment model, so that the sleep quality assessment efficiency of a user is improved. The multi-dimensional and multi-directional prediction of the sleeping quality of the user can be generated, and the sleeping quality evaluation result and the suggestion interpretation output by the user can be obtained. Compared with a sleep quality measuring method using additional hardware devices such as a specific biological instrument and a wristwatch, the sleep quality measuring method can save the cost of hardware, reduce the sense of body of a user and evaluate the sleep quality of the user more directly and conveniently. Compared with the prediction of the correlation coefficient or the single linear regression generated by the pearson product difference correlation method, the network analysis method is used for paying attention to the interaction between the mental health data, and the sleep quality level of the user is estimated three-dimensionally in the network structure, so that the method is more accurate.
The invention is a psychological health assessment network taking sleep quality as a core, a user can obtain predicted values of other psychological health levels including the completed questions only by completing a small number of psychological health test questions, so that the psychological health assessment efficiency of the user is greatly improved, and the problem that hundreds of questions need to be time-consuming for half an hour or even longer in the traditional psychological health test is solved. The method can be applied to various APP/webpage ends, and is used for single-point rapid psychological assessment and prediction of sleep quality (central node), or prediction of the psychological health level of the user through the sleep quality assessment by the reverse path.
Detailed Description
In order to make the technical problems solved by the invention, the technical scheme adopted and the technical effects achieved clearer, the invention is further described in detail below with reference to the accompanying drawings and the embodiments. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the matters related to the present invention are shown in the accompanying drawings.
Example 1
As shown in fig. 1, the sleep quality assessment method based on network analysis provided by the embodiment of the invention includes the following processes:
step 100, collecting sleep quality and mental health relation data.
The sleep quality and mental health relationship data is data reflecting the relationship between mental health and sleep quality. Types of mental health include, but are not limited to, depression, anxiety, and stress.
The step of collecting the data of the relation between the sleep quality and the mental health which are formed and stored in the database is summarized by collecting massive mental health data and sleep quality data. At the time of database creation, mental health data may be collected along with basic information data including, but not limited to, gender, age, occupation, income, region, etc. When collecting data, heterogeneous data within the coverage test population should be collected as much as possible, e.g., when applied in the adult population, covering as many demographic trait data types as possible, such as profession, income, region, etc.
The relation between sleep quality and mental health has the following characteristics:
first, networks that are tightly connected and more connected are considered risky networks. This is due to the snowball effect of symptoms, where activation of one symptom may result in other strongly associated symptoms.
Second, a more central node may also cause a snowball effect, again causing activation of the connected node.
Thus, a tightly connected network and more central nodes are indicative of the risk that the user may be.
Similarly, in network analysis, node activation or approval for a given symptom may be predicted in the network. The symptoms of a highly predictable network are more easily controlled by neighboring symptoms, indicating a more promising therapeutic and intervention approach. Network analysis may also determine the severity of the disease and predict treatment loss.
And 200, obtaining a sleep quality assessment model by adopting EBICglasso models and utilizing the sleep quality and mental health relationship data.
Step 201, determining connection coefficients between nodes of the model according to an evolution path of the following EBICglasso model:
y=Xβ+∈
Wherein sleep quality, anxiety, depression, stress are taken as nodes of the model, X represents the input of the model, the input parameters are any single or combination of depression, anxiety and stress, y represents the output of the model, and the output is sleep quality, y is the n X1 vector of the result, beta is the p X1 vector of the beta coefficient, epsilon is the n X1 error vector, and X is the n X p design matrix (all 1 in the first column, predictor values in the second column).
The EBICglasso model adopted by the invention is based on a linear regression model, and the assumption of the linear regression model is that data are independent. Another key assumption is that the residual of the resulting variable follows a normal distribution.
Preferably, the connection coefficients between the nodes of the model are calibrated by:
1) And calculating a mental health index evaluation error value.
Note that this assumption will be extended to the case of a multivariate model, as we consider here the network approach. When we tried to predict sleep quality nodes with the following three kinds of depression, anxiety and stress, we assumed that all variables existing in the network were independent from each other and that the residuals of the respective variables were in conformity with the normal distribution, the mental health index evaluation error value was calculated using the following formula:
(y-Xβ)T(y-Xβ)
2) And adjusting the psychological health index evaluation error value by using a Lasso method, and further calibrating the connection coefficient among all nodes of the model.
Lasso (Lasso solution SHRINKAGE AND selection operator) is a regularization method aimed at minimizing the sum of squares Residual (RSS) by adding an additional penalty, the sum of squares Residual (RSS) formula being as follows:
Where λ is a penalty or tuning parameter introduced to avoid the problems faced by the common least squares. When λ goes to 0, the equation tends to minimize RSS. As λ approaches infinity, the problem of under-fitting may be faced. Therefore, an appropriate lambda value must be selected, which has the following two selection methods:
One common method is cross-validation, which is used in conjunction with the characteristics of Lasso, which are well suited to network analysis methods. The combination then yields Glasso (GRAPHICAL LASSO, graphical penalty maximum likelihood/penalty likelihood gaussian graph model), which is a regularization method to estimate the covariance matrix. The covariance matrix error estimate formula is as follows:
log(|Θ|)-tr(SΘ)-λ∑i≠j(|Θi,j|)
where log (|Θ|) is the log of the determinant of Θ, p x p precision matrix. tr (sΘ) is the sum of eigenvalues, at p×p sample covariance matrix (multiplied by the estimate of Θ post- Σ). Lambda sigma i≠j(|Θi,j i) is a penalty factor, multiplying the tuning parameter lambda by the sum of the absolute values of the elements opposite the covariance matrix. Glasso can be further modified to λ selection criteria. k-fold cross-validation is often used for λ selection. But k-fold cross-validation over-fits when tuning parameters are selected.
Another approach is to use information criteria to select tuning parameters. EBICglasso select tuning parameters by minimizing extended bayesian information criteria.
Step 202, constructing a sleep quality assessment model according to the determined connection coefficients among the nodes of the model.
In the sleep quality assessment model (network structure diagram and connection coefficients between nodes) constructed in this step, as shown in fig. 2, sleep quality P, anxiety Q1, depression Q2, and pressure Q3 are used as nodes, and each node has different connection coefficients with other nodes. The more information input around the sleep quality P of the variable to be predicted, the more accurate the prediction evaluation of the variable to be predicted.
And 300, acquiring predicted sleep quality node data input by a user to be evaluated, and analyzing the user data to be evaluated by using the obtained sleep quality evaluation model to obtain a minimum predicted interval of sleep quality.
Step 301, obtaining a predicted sleep quality node selected by a user to be evaluated, and obtaining psychological assessment scale data corresponding to the predicted sleep quality node filled in by the user.
Step 302, assuming that the first predicted sleep quality node is X, the sleep quality to be predicted is Y, and the first predicted sleep quality node X is known, generating the following estimation interval regarding the sleep quality to be predicted Y according to the connection coefficient b 1 of the first predicted sleep quality node being X and the sleep quality to be predicted being Y:
[ x-b 1y,x+b1 y ], wherein x-b 1y=m,x+b1 y=n
Step 303, according to the mental health data network relationship, the second predicted sleep quality node Z is another variable associated with the sleep quality to be predicted Y, and according to the connection coefficient b 2 between the first predicted sleep quality node X and the second predicted sleep quality node Z, the following estimated interval of the first predicted sleep quality node X to the second predicted sleep quality node Z is equally output:
[ x-b 2z,x+b2 z ], wherein x-b 2z=a,x+b2 z=b
Step 304, similarly, a prediction may be made according to the evaluation interval of the sleep quality to be predicted Y by the second predicted sleep quality node Z, and two estimation intervals are output by using the maximum value and the minimum value of the path estimation of the first predicted sleep quality node x→the second predicted sleep quality node Z, where the connection coefficient between the second predicted sleep quality node Z and the sleep quality to be predicted Y is b 3, and the minimum estimation interval of the sleep quality to be predicted Y value is determined by using the interval intersection as follows:
[ a-b 3y,a+b3 y ], wherein a-b 3y=p,a+b3 y=q
[ B-b 3y,b+b3 y ], wherein b-b 3y=e,b+b3 y=f
Wherein m, n, a, b, p, q, e, f represent psychological health indexes, respectively.
Step 305, taking the psychological health index m, n, a, b, p, q, e, f on the number axis according to the estimated interval of the sleep quality Y to be predicted generated in step 302, the estimated interval of the first predicted sleep quality node X to the second predicted sleep quality node Z output in step 303, and the minimum estimated interval of the sleep quality Y to be predicted formed in step 304, and taking the interval between the fourth point and the fifth point after the arrangement as the minimum predicted interval of the sleep quality Y to be predicted, wherein the average value of the maximum value and the minimum value of the interval is the optimal predicted point of the sleep quality Y to be predicted, as shown in fig. 3.
Step 400, outputting a sleep quality interval according to the obtained minimum prediction interval of the sleep quality, and realizing sleep quality assessment.
And if the estimated interval of the sleep quality Y result to be predicted spans two horizontal estimated intervals, dividing the two horizontal estimated intervals, and outputting the interval with larger occupation ratio after division as a sleep quality interval to realize sleep quality assessment. The sleep quality interval is, for example, low, medium and high sleep quality, or sleep quality of 0-30 min, 30-70 min and 70-100 min.
Providing other variable prediction results and suggestions based on the network analysis results for the user to be evaluated, and outputting result examples:
point output your Y sleep quality score may be May be at a moderate sleep quality level.
Interval output-your Y sleep quality is 60% likely to be at a medium sleep quality level.
The sleep quality assessment method can be used for a psychological assessment module in a mobile phone APP, and the flow and the example are that a user login account starts to optionally select a psychological assessment table mapped by a node, and by taking the above expression as an example, the user selects Q2 as depression, and the number of topics is about 7. After the answer is completed, the result and suggestion of the depression assessment are provided for the user.
The sleep quality assessment method based on network analysis utilizes the obtained sleep quality assessment model. And obtaining any snack physical health level value input by a user, and generating an estimated interval according to the predicted value of the snack physical health level value to the two associated points, wherein the midpoint of the minimum interval where a plurality of intervals are overlapped is the optimal predicted value of the variable. For example, through depression nodes and coefficients connected with the depression nodes, the co-transformation of the connected nodes can be presumed, namely, after data is input, an estimated value is obtained according to an interval algorithm of minimum error estimation. The EBICglasso model adopted by the invention belongs to a network analysis model (Network Analysis Model), sleep quality evaluation is carried out, the network analysis can identify the risk of mental pathology, and the model has the capability of identifying risk factors and predicting nodes.
Example two
As shown in FIG. 4, the sleep quality assessment system based on network analysis provided by the embodiment of the invention comprises a data pre-input subsystem A, a network model construction subsystem B, an assessment data input and analysis subsystem C and an assessment data output feedback subsystem D;
the data pre-input subsystem A is used for collecting sleep quality and mental health relation data;
The network model construction subsystem B is used for obtaining a sleep quality assessment model by adopting EBICglasso models and utilizing sleep quality and mental health relationship data;
The evaluation data input and analysis subsystem C is used for collecting the predicted sleep quality node data input by the user to be evaluated, and analyzing the user data to be evaluated by utilizing the obtained sleep quality evaluation model to obtain the minimum predicted interval of the sleep quality;
And the evaluation data output feedback subsystem D is used for outputting a sleep quality interval according to the obtained minimum prediction interval of the sleep quality to realize sleep quality evaluation.
It should be noted that the above embodiments are merely for illustrating the technical solution of the present invention, and not for limiting the same, and although the present invention has been described in detail with reference to the above embodiments, it should be understood by those skilled in the art that the technical solution described in the above embodiments may be modified or some or all of the technical features may be equivalently replaced, without departing from the spirit of the technical solution of the present invention.