Tensor Bayesian quantile regression method based on GSSL penalty prior

By introducing GSSL penalty prior and CP decomposition into tensor Bayesian quantile regression, the problem of shrinkage performance and computational burden of the tensor quantile regression algorithm in high-dimensional scenes is solved, and the parameter estimation accuracy and calculation are improved. efficiency.

CN118762269AActive Publication Date: 2024-10-11YUNNAN UNIV

Patent Information

Application Number
CN202410766834.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-11
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

The existing tensor quantile regression algorithm has limited shrinkage performance in high-dimensional scenarios, and the estimation accuracy of sparsely structured tensor data is low, and the computational burden is heavy, and it cannot effectively consider the dimensions that do not affect the response variable. Overall shrinkage.

Method used

The tensor Bayesian quantile regression method based on the GSSL penalty prior is used to measure parameter randomness through the Bayesian framework. The GSSL prior is used to shrink the coefficient tensor, and the dimensions that do not affect the response variable are eliminated, and in CP On the basis of decomposition, the parameter dimension is reduced and the Lasso penalty coefficient is determined adaptively.

Benefits of technology

It improves the effect of tensor regression coefficient parameter estimation, improves the estimation accuracy of sparsely structured tensor data, reduces the computational burden, and avoids the need for cross-validation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118762269A_ABST
    Figure CN118762269A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Bayesian statistical inference of tensor regression, and discloses a tensor Bayesian quantile regression method based on GSSL penalty priori. In order to measure the randomness of parameters, tensor quantile regression is provided under a Bayesian framework, a novel shrinkage method for tensor regression coefficients is provided for GSSL punishment prior distribution, the method can eliminate the dimensionality of the tensor regression coefficients with sparse structures which have little influence on response variables, and the robustness of the tensor regression coefficients is improved. Therefore, the dimensionality of the tensor regression coefficient can be further reduced on the basis of CP decomposition, the estimation and prediction effects are improved, the penalty parameter of the Lasso part can be adaptively determined, cross validation or model selection for selecting the penalty parameter under the frequency discipline is avoided, and the calculation efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Bayesian statistical inference of tensor regression, and in particular to a tensor Bayesian quantile regression method based on GSSL penalty prior. Background Art

[0002] The quantile regression model has the characteristics of a comprehensive description of the response variable characteristics and strong robustness, and is widely used in the study of variable relationships in general-scale data. The traditional quantile regression method only considers the covariates that affect the scalar response of the i-th observed individual as vectors and estimates the corresponding regression coefficient vectors. However, many applications in today's big data era involve high-dimensional arrays with tensor structures. These tensor data inevitably have an impact on the scalar response and cannot be ignored. They should be included in the regression process as an important type of explanatory variable. Therefore, the regression coefficients to be estimated should also be high-dimensional arrays, that is, tensor regression coefficients.

[0003] At present, scholars have proposed a tensor quantile regression algorithm based on the alternating direction method of multipliers (ADMM) and Tucker decomposition. However, this algorithm is proposed on the basis of the frequency method, which sacrifices the randomness measurement of the parameters in the model. For tensor data with sparse structure, the algorithm only uses the Lasso method to shrink the tensor regression coefficients. However, the shrinkage performance of Lasso is limited in high-dimensional scenarios, and the Lasso under the frequency school needs to be cross-validated to determine the optimal regularization parameter. In addition, the selection of the rank of the tensor Tucker decomposition makes the algorithm computationally heavy. Some scholars have proposed a Bayesian tensor regression algorithm based on the Multiway Dirichlet Generalized Double Pareto (M-DGDP) prior, but it is aimed at general linear tensor regression and has not been extended to quantile tensor regression. In addition, this method does not consider the situation where some dimensions of the tensor covariate have no effect on the response scalar, and thus does not consider shrinking the regression coefficient vector of the corresponding dimension to a zero vector as a whole, resulting in low parameter estimation accuracy when the tensor regression coefficient has a strong sparse structure. Summary of the invention

[0004] 1. Technical issues to be solved

[0005] In view of the shortcomings of the prior art, the present invention provides a tensor Bayesian quantile regression method based on GSSL penalized prior, which has the advantages of excellent shrinkage performance and the ability to improve the parameter estimation effect of the tensor regression coefficient, thereby improving the above technical problems.

[0006] (II) Technical solution

[0007] To achieve the above object, the present invention provides the following technical solution: a tensor Bayesian quantile regression method based on GSSL penalty prior, comprising the following steps:

[0008] S1, data reading and parameter setting, including the following steps:

[0009] S1.1. Importing datasets Where n is the sample size, yi is the i-th observation value of the response variable, is the tensor covariate of the i-th observation;

[0010] S1.2. Determine the tensor order D and dimensions p1, p2, ..., p D , where p1, p2, ..., p D Respectively represent the dimensions of different orders of the D-order tensor;

[0011] S1.3, rank R, quantile τ of input CP decomposition, six different hyperparameters a ρ , b ρ , a σ , b σ ;

[0012] S1.4. Input the number of sampling times and the length of the burn-in period;

[0013] S2. Construct a tensor Bayesian quantile regression model with tensor data as covariates and scalar data as response variables, including the following steps:

[0014] S2.1. Set the tensor regression model for the quantile τ. The specific expression is as follows:

[0015]

[0016] Among them, y i represents the i-th observation value of the response variable, represents the tensor covariate corresponding to the i-th observation, μ represents the intercept, Indicates a given Next i τ quantile of , and Indicates a given Under the condition y i The conditional distribution function of , τ represents the quantile between 0 and 1, represents the tensor coefficient, inf{·} represents the conditional distribution function The infimum function greater than the quantile τ, <·, ·> represents the inner product operation;

[0017] S2.2, constructing a Bayesian hierarchical model for quantile tensor regression;

[0018]

[0019] in represents the latent variable z i It obeys an exponential distribution with a mean of σ, where σ represents the scale parameter, μ represents the intercept, and z i represents the latent variable, y i represents the i-th observation value of the response variable, ξ i represents a random error that follows a standard normal distribution, k1 and k2 represent known quantities about the quantile τ, Express and The inner product of

[0020] S3, for D-order tensor The rank R is decomposed by CP, and the specific expression is as follows:

[0021]

[0022] in, They represent the regression coefficient vectors of the rth rank 1st, 2nd, …, Dth order after CP decomposition, represents the regression coefficient vector of the rth rank d order after CP decomposition, represents the outer product operation, p1, p2, ..., p D Respectively represent the dimensions of different orders of the D-order tensor;

[0023] S4. Represent tensor coefficients using reduced-dimensional parameters The tensor covariate with the ith observation The inner product of is expressed as follows:

[0024]

[0025] Among them, vec(·) represents the straightening function, which is used to straighten the tensor into a vector, and the superscript T represents the transpose of the matrix. represents the tensor covariate of the ith observation, represents the tensor coefficient, Represents the regression coefficient vector of the rth rank d order after CP decomposition The elements of are reorganized into a regression coefficient vector, Respectively The i-th rank, the 2-th rank, ..., the R-th rank d elements, Represents the preservation of tensor covariates In and subscript i d Related elements, Represents the tensor covariate Delete the subscript i d Related elements, 1 R represents a vector whose R-dimensional elements are all 1, ⊙ represents a dot product operation, represents p, which is composed of regression coefficient vectors of d order with a total of R ranks after CP decomposition. d ×R matrix, Represents the matrix B d Delete the i d Line (p d -1)×R matrix, B1,…,B D-1 , B D Respectively represent matrices B t Representation Matrix They represent the matrices composed of the regression coefficient vectors of the 1st, 2nd, …, and Rth order after CP decomposition, respectively. They represent the matrices composed of the regression coefficient vectors of the 1st, 2nd, …, and Rth orders of D-1 after CP decomposition, respectively. They represent the matrices composed of the regression coefficient vectors of the 1st, 2nd, …, and Rth order after CP decomposition, Respectively represent the matrices composed of the regression coefficient vectors of the tth order of the 1st rank, 2nd rank, …, Rth rank after CP decomposition, ⊙ t≠d Denotes D-1 matrices B whose subscripts are not d D , …, B d+1 , B d-1 , ..., the dot product of B1, Denotes D matrices B D , …, B d+1 , B d-1 , ..., the dot product of B1, where the d-th matrix Represents the matrix B d Delete the i d The remaining part after the line;

[0026] S5. Determine the prior distribution of each parameter in the tensor Bayesian quantile regression model, including the following steps:

[0027] S5.1. GSSL priors are performed on each parameter of the tensor Bayesian quantile regression model. The specific expressions are as follows:

[0028]

[0029]

[0030]

[0031] in, Indicates a given Under the conditions Follow the distribution represents the covariance matrix, Exp(*) represents the exponential distribution, indicates that the mean is 0 and the covariance is The R-variable normal distribution, represents the indicative function, Represents the regression coefficient vector of the rth rank d order after CP decomposition The elements of are reorganized into a regression coefficient vector, represents the coefficient shrinkage parameter, Indicates a given Under the conditions Exponential distribution represents the Lasso shrinkage adjustment parameter, represents an indicator variable and is a scalar, Bernoulli(ρ) represents a Bernoulli distribution with a success probability of ρ, express The event probability is ρ, which is the Bernoulli distribution Bernoulli(ρ). express Gamma distribution Represents hyperparameters and hyperparameters The gamma distribution, Beta(a ρ , b ρ ) indicates that the mean is The beta distribution of The coefficient vector is active, otherwise it indicates the coefficient vector Inactive, ρ represents The probability of

[0032] S5.2. For the intercept μ and scale parameter σ, use uninformative conjugate priors:

[0033] μ~N(m,v 2 ),σ~IG(a σ , b σ )

[0034] Among them, N(m,v 2 ) means the mean is m and the variance is v 2 The univariate normal distribution of IG(a σ , b σ ) represents the hyperparameter a σ 、b σ The inverse gamma distribution of

[0035] S6. Calculate the full conditional posterior distribution of each parameter in the tensor Bayesian quantile regression model through the Bayesian formula;

[0036] S7, taking the input sampling number in step S1 as the upper limit, extracting the posterior samples of each parameter from the full conditional posterior distribution of each parameter calculated in step S6;

[0037] S8. Remove the sample of the parameter in the burn-in period from the burn-in period length input in step S1.4, and calculate and output the parameter estimation value through the remaining samples. as well as

[0038] As a preferred technical solution of the present invention, the fully conditional posterior distribution of each parameter in step S6 is specifically:

[0039] Regression coefficient vector In a given data set intercept μ, scale parameter σ, latent variable set z, variance matrix Coefficient vector set and indicator variables The fully conditional posterior under the condition is as follows:

[0040]

[0041] Among them, μ represents the intercept, Representation parameters The posterior mean of , σ represents the scale parameter, represents the covariance matrix, represents the regression coefficient vector, represents the posterior covariance matrix, represents a dataset, represents the posterior covariance The inverse of , d = 1, 2, ..., D represents D tensor dimensions, represents an indicator variable, j d With subscript i d The same meaning as the subscript i d , Indicates removal of parameters The set of all other regression coefficient vectors of , Indicates the jth d The regression coefficient vector after CP decomposition, z represents n latent variables z1, ..., z n The set composed of d represents the dimension of the tensor at the dth order, k1 and k2 represent the known quantities about the quantile τ, B t Representation Matrix ⊙t≠d Denotes D-1 matrices B whose subscripts are not d D , …, B d+1 , B d-1 , …, the dot product of B1, Vec(·) represents the straightening function, Represents the preservation of tensor covariates In and subscript i d The relevant elements, θ i Represents a scalar whose value is z i represents a latent variable, the superscript T represents transposition, and y i represents the i-th observation value of the response variable, can be reparameterized as in

[0042] Indicator variables In a given data set intercept μ, scale parameter σ, latent variable set z, prior probability ρ, variance matrix And the coefficient vector set The fully conditional posterior under the condition is as follows:

[0043]

[0044] in, The success probability is Bernoulli distribution, exp(*) represents the exponential function, represents a scalar obtained by a posteriori calculation, and ρ represents The prior probability of express The covariance matrix when ln(ρ) represents the logarithmic function with natural logarithm as base, Representation Matrix The determinant of z represents n latent variables z1, ..., z n The set of components;

[0045] Coefficient shrinkage parameter Given a coefficient vector Indicator variables and the contraction adjustment parameter θ 2 The fully conditional posterior under the condition is as follows:

[0046]

[0047] where GIG(·,·,·) represents the generalized inverse Gaussian distribution, represents the Lasso shrinkage adjustment parameter, can be reparameterized as and as well as in express The covariance matrix when express The covariance matrix when represents an indicator variable, Representation vector The rth element of Respectively The R diagonal elements of Respectively R diagonal elements of , diag(*) means a diagonal matrix with * as the diagonal elements;

[0048] Lasso shrinkage adjustment parameter The fully conditional posterior under the given coefficient shrinkage parameter set λ is as follows:

[0049]

[0050] Among them, λ represents all d=1,...,D,r=1,...,R,i d =1,...,p d The set composed of represents the coefficient shrinkage parameter, and They represent hyperparameters, Ga(*) represents gamma distribution,

[0051] The fully conditional posterior of the parameter ρ under the given indicator variable set γ is as follows:

[0052]

[0053] Among them, γ represents all indicator variables d=1,...,D,i d =1,...,p d The set composed of Indicates the mean The beta distribution, p d represents the dimension of the d-th order of the tensor, represents an indicator variable;

[0054] The intercept μ in a given data set Tensor coefficients The fully conditional posterior under the condition of scale parameter σ and latent variable set z is as follows:

[0055]

[0056] Among them, m * represents the posterior mean of the intercept μ, v *2 represents the posterior variance of the intercept μ, v 2 represents the prior variance of the intercept μ, and m represents the prior mean of the intercept μ.

[0057] Latent variable z i In a given data set Tensor coefficients The posterior distribution under the condition of and scale parameter σ is as follows:

[0058]

[0059] Where <·,·> represents the inner product operation, GIG(·,·,·) represents the generalized inverse Gaussian distribution, k1 and k2 represent the known quantities about the quantile τ, respectively. is the tensor covariate of the ith observation, y i represents the i-th observation value of the response variable;

[0060] The scale parameter σ in a given dataset Tensor coefficients The fully conditional posterior distribution under the intercept μ and the latent variable set z is as follows:

[0061]

[0062] Where n represents the sample size, IG(1.5n+a σ , c σ ) represents 1.5n+a σ 、c σ The inverse gamma distribution, c σ represents the posterior scale parameter.

[0063] As a preferred technical solution of the present invention, the specific process of step S7 is as follows:

[0064] S7.1, initialization parameters;

[0065] S7.2, the extracted d-th dimension is i d The posterior sample of the parameters includes the following steps:

[0066] S7.2.1: Given μ (t-1) , σ (t-1) , z (t-1) , ρ (t-1) as well as Under the condition of Extract where z (t-1) represents the iterative value sequence of the parameter set z at the t-1th step, μ(t-1) represents the intercept of the t-1 iteration, σ (t-1) represents the scale parameter of the t-1 iteration, represents the covariance matrix of the t-1 iteration, Indicates the mean The covariance matrix is The R-variable normal distribution, express The sample value at step t, Represents the set of regression coefficient vectors for the t-1th iteration A sequence of sample values.

[0067] S7.2.2: Given and Under the condition of and Extract and Where r = 1, ..., R, represents the Lasso shrinkage adjustment parameter for the t-1th iteration, express The sampling value of the tth iteration.

[0068] S7.2.3: From indicator variables Extract the indicator variable of the tth iteration from the fully conditional posterior expression pass Update Parameters represents the regression coefficient vector for the tth iteration.

[0069] S7.2.4: Pass renew Where r = 1, ..., R, express The sampling value of the tth iteration, express The sampling value of the tth iteration, express The sampling value of the tth iteration, represents the i-th observation of the response variable at iteration t.

[0070] S7.2.5: Repeat S7.2.1-S7.2.4 until all d=1, ..., D, i are traversed. d =1,...,p d ;

[0071] S7.3, given λ (t) Under the condition of Extract the Lasso shrinkage adjustment parameter of the tth iteration from the fully conditional posterior expression where λ (t) represents all the d=1,...,D,i d =1,...,p d , r = 1, ..., the set consisting of R;

[0072] S7.4, given γ (t) Under the condition of (t) , where γ (t) Represents all indicator variables extracted in step S7.2 d=1,...,D,i d =1,...,p d The set of components;

[0073] S7.5. Given the scale parameter σ of the t-1th iteration (t-1) , z of the t-1th iteration (t-1) , the tensor coefficients at the tth iteration Under the condition of , the intercept μ of the tth iteration is extracted from the full conditional posterior of the intercept μ (t) ;

[0074] S7.6. Extract the latent variable z under the i-th sample i The posterior sample includes the following steps:

[0075] S7.6.1. Given the tensor coefficients for the tth iteration The intercept μ at the tth iteration (t) and the scale parameter σ of the t-1th iteration (t-1) Under the condition of i In a given data set Tensor coefficients The latent variable of the tth iteration is extracted from the posterior distribution expression under the condition of and scale parameter σ

[0076] S7.6.2. Repeat S7.6.1 until i=1, 2…, n is traversed;

[0077] S7.7. Given the tensor coefficients for the tth iteration The intercept μ at the tth iteration (t) and z (t) Under the condition of , the scale parameter σ of the tth iteration is extracted from the full conditional posterior distribution of the scale parameter σ (t) ;

[0078] S7.8. Repeat S7.2-S7.7 until the algorithm iterates to the sampling number input in step S1.4 and the iteration is completed.

[0079] Compared with the prior art, the present invention provides a tensor Bayesian quantile regression method based on GSSL penalty prior, which has the following beneficial effects:

[0080] The present invention extends the Bayesian framework to quantile tensor regression. First, it can measure the randomness of parameters in the quantile tensor regression model through the posterior distribution. Secondly, a new shrinkage method for the coefficient tensor is given through the prior distribution. This method can eliminate the dimensions in the coefficient tensor that do not affect the response variable. This can further reduce the dimension of the parameters on the basis of CP decomposition for the coefficient tensor with a sparse structure, thereby improving the effect of parameter estimation. Finally, the Lasso part in the algorithm can adaptively determine the optimal penalty coefficient parameters, that is, there is no need to perform cross-validation on the penalty parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] Figure 1 This is a schematic diagram of the trend prediction of the present invention;

[0082] Figure 2 It is a schematic diagram of the process of the present invention;

[0083] Figure 3 This is a covariate picture with a count of 17 people in the test set of the embodiment;

[0084] Figure 4 This is a covariate picture with a count of 12 people in the test set of the embodiment. DETAILED DESCRIPTION

[0085] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0086] See also Figure 1-4 , a tensor Bayesian quantile regression method based on GSSL (Group Spike and Slab Lasso) penalized prior, including the following steps:

[0087] S1, data reading and parameter setting, including the following steps:

[0088] S1.1. Importing datasets Where n is the sample size, y i is the i-th observation value of the response variable, is the tensor covariate of the i-th observation;

[0089] S1.1.1: The number of people who tagged each image in the dataset, either through machine learning algorithms or manual identification.

[0090] S1.1.2: Divide the training set and the test set. All pictures with timestamps 13-57 and 13-59 and the first 200 pictures with timestamp 14-03, totaling 662 pictures, are used as the training set data, and the remaining 213 pictures with timestamp 14-03 are used as the test set, so the sample size n = 662.

[0091] S1.1.3: Import the training set images and the number of responses into the computer. The computer reads the color images as a third-order tensor, i.e., a three-dimensional matrix. In order to improve the computational efficiency, the tensor read by the computer is reduced by a ratio of 0.1, and the tensor read and reduced from the i-th image is used as the covariate corresponding to the i-th observation. The number of people who read the i-th picture is the response scalar y i , the number of people in all training set images constitutes the corresponding response vector. In this way, the data set can be obtained

[0092] S1.2. Determine the tensor order D and dimensions p1, p2, ..., p D , where p1, p2, ..., p D They represent the dimensions of the D-order tensor at different orders. From the data set, we can get D=3, p1=55, p2=75, p3=3 here;

[0093] S1.3, rank R, quantile τ of input CP decomposition, six different hyperparameters

[0094] S1.4. Input the number of samples and the length of the burn-in period (Note: The Bayesian parameter estimate is calculated by removing the parameter sample sequence after the burn-in period. Therefore, the role of the burn-in period is to perform pre-iteration until the algorithm converges. The sampled values ​​after the algorithm converges are the posterior sample sequences of each parameter.);

[0095] S2. Construct a tensor Bayesian quantile regression model with tensor data as covariates and scalar data as response variables, including the following steps:

[0096] S2.1. Set the tensor regression model for the quantile τ. The specific expression is as follows:

[0097]

[0098] Among them, y i represents the i-th observation value of the response variable, represents the tensor covariate corresponding to the i-th observation, μ represents the intercept, Indicates a given Next i τ quantile of , and Indicates a given Under the condition y i The conditional distribution function of , τ represents a specific quantile whose value is between 0 and 1, represents the tensor coefficient, inf{·} represents the conditional distribution function The infimum function greater than the quantile τ, <·, ·> represents the inner product operation;

[0099] S2.2, constructing a Bayesian hierarchical model for quantile tensor regression;

[0100]

[0101] in, represents the latent variable z i It obeys an exponential distribution with a mean of σ, where σ represents the scale parameter, μ represents the intercept, and z i represents the latent variable, y i represents the i-th observation value of the response variable, ξ i represents a random error that follows a standard normal distribution, k1 and k2 represent known quantities about the quantile τ, Express and The inner product of

[0102] S3, for D-order tensor The rank R is decomposed by CP, and the specific expression is as follows:

[0103]

[0104] in They represent the regression coefficient vectors of the rth rank 1st, 2nd, …, Dth order after CP decomposition, represents the regression coefficient vector of the rth rank d order after CP decomposition, represents the outer product operation, p1, p2, ..., p D Respectively represent the dimensions of different orders of the D-order tensor;

[0105] S4. Represent tensor coefficients using reduced-dimensional parameters The tensor covariate with the ith observation The inner product of is expressed as follows:

[0106]

[0107] Among them, Vec(·) represents the straightening function, which is used to straighten the tensor into a vector, and the superscript T represents the transpose of the matrix. represents the tensor covariate of the ith observation, represents the tensor coefficient, Represents the regression coefficient vector of the rth rank d order after CP decomposition The elements of are reorganized into a regression coefficient vector, Respectively The i-th rank, the 2-th rank, ..., the R-th rank d elements, Represents the preservation of tensor covariates In and subscript i d Related elements, Represents the tensor covariate Delete the subscript i d Related elements, 1 R represents a vector whose R-dimensional elements are all 1, ⊙ represents a dot product operation, represents p, which is composed of regression coefficient vectors of d order with a total of R ranks after CP decomposition. d ×R matrix, Represents the matrix B d Delete the i d Line (p d -1)×R matrix, B1,…,B D-1 , B D Respectively represent matrices B t Representation Matrix They represent the matrices composed of the regression coefficient vectors of the 1st, 2nd, …, and Rth order after CP decomposition, respectively. They represent the matrices composed of the regression coefficient vectors of the 1st, 2nd, …, and Rth orders of D-1 after CP decomposition, respectively. They represent the matrices composed of the regression coefficient vectors of the 1st, 2nd, …, and Rth order after CP decomposition, Respectively represent the matrices composed of the regression coefficient vectors of the tth order of the 1st rank, 2nd rank, …, Rth rank after CP decomposition, ⊙ t≠d Denotes D-1 matrices B whose subscripts are not d D , …, B d+1 , B d-1 , ..., the dot product of B1, Denotes D matrices B D , …, B d+1 , B d-1 , ..., the dot product of B1, where the d-th matrix Represents the matrix Bd Delete the i d The remaining part after the line;

[0108] S5. Determine the prior distribution of each parameter in the tensor Bayesian quantile regression model, including the following steps:

[0109] S5.1. GSSL priors are performed on each parameter of the tensor Bayesian quantile regression model. The specific expressions are as follows:

[0110]

[0111] in, Indicates a given Under the conditions Follow the distribution represents the covariance matrix, Exp(*) represents the exponential distribution, indicates that the mean is 0 and the covariance is The R-variable normal distribution, represents the indicative function, Represents the regression coefficient vector of the rth rank d order after CP decomposition The elements of are reorganized into a regression coefficient vector, represents the coefficient shrinkage parameter, For a given θ 2 Under the conditions Exponential distribution represents the Lasso shrinkage adjustment parameter, represents an indicator variable and is a scalar, Bernoulli(ρ) represents a Bernoulli distribution with a success probability of ρ, ρ represents a probability parameter, express The event probability is ρ, which is the Bernoulli distribution Bernoulli(ρ). express Gamma distribution Represents hyperparameters and hyperparameters The gamma distribution, Beta(a ρ , b ρ ) indicates that the mean is The beta distribution of The coefficient vector is active, otherwise it indicates the coefficient vector Inactive, ρ represents The probability of

[0112] S5.2. For the intercept μ and scale parameter σ, use uninformative conjugate priors:

[0113] μ~N(m,v 2 ),σ~IG(a σ , b σ ),

[0114] Among them, N(m,v 2 ) means the mean is m and the variance is v 2 The univariate normal distribution of IG(a σ , b σ ) represents the hyperparameter a σ 、b σ The inverse gamma distribution of

[0115] S6. Calculate the full conditional posterior distribution of each parameter in the tensor Bayesian quantile regression model through the Bayesian formula;

[0116] The fully conditional posterior distribution of each parameter in step S6 is specifically:

[0117] Regression coefficient vector In a given data set intercept μ, scale parameter σ, latent variable set z, variance matrix Coefficient vector set and indicator variables The fully conditional posterior under the condition is as follows:

[0118]

[0119] Among them, μ represents the intercept, Representation parameters The posterior mean of , σ represents the scale parameter, represents the covariance matrix, represents the regression coefficient vector, represents the posterior covariance matrix, represents a dataset, represents the posterior covariance The inverse of , d = 1, 2, ..., D represents D tensor dimensions, represents an indicator variable, j d Indicates similar to i d But in order to avoid duplication of symbols, we use the symbol j d Indicates subscript, Indicates removal of parameters The set of all other regression coefficient vectors of , Indicates the jth d The regression coefficient vector after CP decomposition, z represents n latent variables z1, ..., z n The set composed of d represents the dimension of the tensor at the dth order, k1 and k2 represent the known quantities about the quantile τ, Bt Representation Matrix ⊙ t≠d Denotes D-1 matrices B whose subscripts are not d D , …, B d+1 , B d-1 , ..., the dot product of B1, vec(·) represents the straightening function, which is used to straighten the tensor into a vector. Represents the preservation of tensor covariates In and subscript i d The relevant elements, θ i Represents a scalar whose value is z i represents a latent variable, the superscript T represents transposition, and y i represents the i-th observation value of the response variable, can be reparameterized as in

[0120] Indicator variables In a given data set intercept μ, scale parameter σ, latent variable set z, prior probability ρ, variance matrix And the coefficient vector set The fully conditional posterior under the condition is as follows:

[0121]

[0122] in, The success probability is Bernoulli distribution, exp(*) represents the exponential function, represents a scalar obtained by a posteriori calculation, and ρ represents The prior probability of express The covariance matrix when ln(ρ) represents the logarithmic function with natural logarithm as base, Representation Matrix The determinant of z represents n latent variables z1, ..., z n The set of components;

[0123] Coefficient shrinkage parameter Given a coefficient vector Indicator variables and the contraction adjustment parameter θ 2 The fully conditional posterior under the condition is as follows:

[0124]

[0125] where GIG(·,·,·) represents the generalized inverse Gaussian distribution, represents the Lasso shrinkage adjustment parameter, can be reparameterized as and as well as in express The covariance matrix when express The covariance matrix when represents an indicator variable, Representation vector The rth element of Respectively The R diagonal elements of Respectively R diagonal elements of , diag(*) means a diagonal matrix with * as the diagonal elements;

[0126] Lasso shrinkage adjustment parameter The fully conditional posterior under the given coefficient shrinkage parameter set λ is as follows:

[0127]

[0128] Among them, λ represents all d=1,...,D,r=1,...,R,i d =1,...,p d The set composed of represents the coefficient shrinkage parameter, and They represent hyperparameters, Ga(*) represents gamma distribution,

[0129] The fully conditional posterior of the probability parameter ρ under the given indicator variable set γ is as follows:

[0130]

[0131] Among them, γ represents all indicator variables d=1,...,D,i d =1,...,p d The set composed of Indicates the mean The beta distribution, p d represents the dimension of the d-th order of the tensor, represents an indicator variable;

[0132] The intercept μ in a given data set Tensor coefficients The fully conditional posterior under the condition of scale parameter σ and latent variable set z is as follows:

[0133]

[0134] Where m * represents the posterior mean of the intercept μ, v *2 represents the posterior variance of the intercept μ, v 2 represents the prior variance of the intercept μ, and m represents the prior mean of the intercept μ.

[0135] Latent variable z i In a given data set Tensor coefficients The posterior distribution under the condition of and scale parameter σ is as follows:

[0136]

[0137] Among them, <·,·) represents the inner product operation, GIG(·,·,·) represents the generalized inverse Gaussian distribution, k1 and k2 represent the known quantities about the quantile τ, respectively. is the tensor covariate of the ith observation, y i represents the i-th observation value of the response variable;

[0138] The scale parameter σ in a given dataset Tensor coefficients The fully conditional posterior distribution under the intercept μ and the latent variable set z is as follows:

[0139]

[0140] Where n represents the sample size, IG(1.5n+a σ , c σ ) represents 1.5n+a σ and c σ The inverse gamma distribution, c σ represents the posterior scale parameter.

[0141] S7, taking the input sampling number in step S1 as the upper limit, extracting the posterior samples of each parameter from the full conditional posterior distribution of each parameter calculated in step S6;

[0142] S7.1, initialization parameters;

[0143] S7.2, the extracted d-th dimension is i d The posterior sample of the parameters includes the following steps:

[0144] S7.2.1: Given μ (t-1) , σ (t-1) , z (t-1) , ρ (t-1) as well as Under the condition of Extract where z (t-1) represents the iterative value sequence of parameter set z at the t-1th time, μ (t-1) represents the intercept of the t-1 iteration, σ (t-1) represents the scale parameter of the t-1 iteration, represents the covariance matrix of the t-1 iteration, Indicates the mean The covariance matrix is The R-variable normal distribution, express The sample value at step t, Represents the set of regression coefficient vectors for the t-1th iteration A sequence of sample values.

[0145] S7.2.2: Given and Under the condition of and Extract and Where r = 1, ..., R, represents the Lasso shrinkage adjustment parameter for the t-1th iteration, express The sampling value of the tth iteration.

[0146] S7.2.3: From indicator variables Extract the indicator variable of the tth iteration from the fully conditional posterior expression pass Update Parameters represents the regression coefficient vector for the tth iteration.

[0147] S7.2.4: Pass renew Where r = 1, ..., R, express The sampling value of the tth iteration, express The sampling value of the tth iteration, express The sampling value of the tth iteration, represents the i-th observation of the response variable at iteration t.

[0148] S7.2.5: Repeat S7.2.1-S7.2.4 until all d=1, ..., D, i are traversed. d =1,...,p d ;

[0149] S7.3, given λ (t) Under the condition of Extract the Lasso shrinkage adjustment parameter of the tth iteration from the fully conditional posterior expression where λ (t) represents all the The set of components;

[0150] S7.4, given γ (t) Under the condition of (t) , where γ (t) Represents all indicator variables extracted in step S7.2 The set of components;

[0151] S7.5. Given the scale parameter σ of the t-1th iteration (t-1) , z of the t-1th iteration (t-1) , the tensor coefficients at the tth iteration Under the condition of , the intercept μ of the tth iteration is extracted from the full conditional posterior of the intercept μ (t) ;

[0152] S7.6. Extract the latent variable z under the i-th sample i The posterior sample includes the following steps:

[0153] S7.6.1. Given the tensor coefficients for the tth iteration The intercept μ at the tth iteration (t) and the scale parameter σ of the t-1th iteration (t-1) Under the condition of i In a given data set Tensor coefficients The latent variable of the tth iteration is extracted from the posterior distribution expression under the condition of and scale parameter σ

[0154] S7.6.2. Repeat S7.6.1 until i=1, 2…, n is traversed;

[0155] S7.7. Given the tensor coefficients for the tth iteration The intercept μ at the tth iteration (t) and z (t) Under the condition of , the scale parameter σ of the tth iteration is extracted from the full conditional posterior distribution of the scale parameter σ (t) ;

[0156] S7.8. Repeat S7.2-S7.7 until the algorithm iterates to the sampling number input in step S1.4 and the iteration is completed.

[0157] S8. Remove the sample of the parameter in the burn-in period from the burn-in period length input in step S1.4, and calculate and output the parameter estimation value through the remaining samples. as well as

[0158] For the effectiveness of the present invention, the loss function value (loss) is used to evaluate the model fitting performance of the training set and the test set under different decomposition ranks R and different quantile τ levels. The loss function value (loss) is obtained by

[0159]

[0160] Calculate, where Indicates that the conditions are met The set of subscript i of Indicates that the conditions are met The set of subscript i in the training set is n=662 and the test set is n=213. The results are shown in the following table:

[0161]

[0162]

[0163] By executing the above steps, the tensor Bayesian quantile regression model of the present invention can be fitted with the training set at different quantiles (τ=0.25, 0.5, 0.75), and the pictures in the test set can be brought into the fitted quantile tensor model to obtain the estimated value of the number of people in the corresponding pictures in the test set, thereby obtaining the test set prediction trend chart under the decomposition rank R=3, as shown in FIG. Figure 1 shown. Figure 3 and Figure 4 These are the pictures in the test set. When the pictures are imported into the model, we can get the following results at quantiles τ = 0.25, 0.5, and 0.75: Figure 3 The predicted values ​​are 14.75, 15.22, and 14.88 respectively. Figure 4 The predicted values ​​are 11.72, 12.00, and 13.44 respectively.

[0164] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A tensor Bayesian quantile regression method based on GSSL penalized prior, characterized by: The following steps are involved: S1, data reading and parameter setting, including the following steps: S1.

1. Importing datasets Where n is the sample size, y i is the i-th observation value of the response variable, is the tensor covariate of the i-th observation; S1.

2. Determine the tensor order D and dimensions p1, p2, ..., p D , where p1, p2, …, p D Respectively represent the dimensions of different orders of the D-order tensor; S1.3, rank R, quantile τ of input CP decomposition, six different hyperparameters a θ ,b θ ,a ρ ,b ρ ,a σ ,b σ ; S1.

4. Input the number of sampling times and the length of the burn-in period; S2. Construct a tensor Bayesian quantile regression model with tensor covariates and scalar response variables, including the following steps: S2.

1. Set the tensor regression model for the quantile τ. The specific expression is as follows: Among them, y i represents the i-th observation value of the response variable, represents the tensor covariate corresponding to the i-th observation, v represents the intercept, Indicates a given Next i τ quantile of , and Indicates a given Under the condition y i The conditional distribution function of , τ represents the quantile between 0 and 1, represents the tensor coefficient, inf{·} represents the conditional distribution function The infimum function is greater than the quantile τ, and <·,·> represents the inner product operation; S2.2, constructing a Bayesian hierarchical model for quantile tensor regression; in, represents the latent variable z i It obeys an exponential distribution with a mean of σ, where σ represents the scale parameter, μ represents the intercept, and z i represents the latent variable, y i represents the i-th observation value of the response variable, ξ i represents a random error that follows a standard normal distribution, k1 and k2 represent known quantities about the quantile τ, Express and The inner product of S3, for D-order tensor The rank R is decomposed by CP, and the specific expression is as follows: in, They represent the regression coefficient vectors of the rth rank 1st, 2nd, …, Dth order after CP decomposition, represents the regression coefficient vector of the rth rank d order after CP decomposition, represents the outer product operation, p1,p2,…,p D Respectively represent the dimensions of different orders of the D-order tensor; S4. Represent tensor coefficients using reduced-dimensional parameters The tensor covariate with the ith observation The inner product of is expressed as follows: Where vec(·) represents the straightening function, and the superscript T represents the transpose of the matrix. represents the tensor covariate of the ith observation, represents the tensor coefficient, Represents the regression coefficient vector of the rth rank d order after CP decomposition The elements of are reorganized into a regression coefficient vector, Respectively The i-th rank, the 2-th rank, ..., the R-th rank d elements, Represents the preservation of tensor covariates In and subscript i d Related elements, Represents the tensor covariate Delete the subscript i d Related elements, 1 R represents a vector whose R-dimensional elements are all 1, ⊙ represents a dot product operation, represents p, which is composed of regression coefficient vectors of d order with a total of R ranks after CP decomposition. d ×R matrix, Represents the matrix B d Delete the i d Line (p d -1)×R matrix, B1,…,B D-1 , B D Respectively represent matrices B t Representation Matrix They represent the matrices composed of the regression coefficient vectors of the 1st, 2nd, …, and Rth order after CP decomposition, respectively. They represent the matrices composed of the regression coefficient vectors of the 1st, 2nd, …, and Rth orders of D-1 after CP decomposition, respectively. They represent the matrices composed of the regression coefficient vectors of the 1st, 2nd, …, and Rth order after CP decomposition, Respectively represent the matrices composed of the regression coefficient vectors of the tth order of the 1st rank, 2nd rank, …, Rth rank after CP decomposition, ⊙ t≠d Denotes D-1 matrices B whose subscripts are not d D , …, B d+1 , B d-1 , ..., the dot product of B1, Denotes D matrices B D , …, B d+1 , B d-1 , ..., the dot product of B1, where the d-th matrix Represents the matrix B d Delete the i d The remaining part after the line; S5. Determine the prior distribution of each parameter in the tensor Bayesian quantile regression model, including the following steps: S5.1, GSSL priors are performed on each parameter of the tensor Bayesian quantile regression model; S5.

2. For the intercept μ and scale parameter σ, use uninformative conjugate priors: μ~N(m,v 2 ),σ~IG(a σ ,b σ ) Where N(m,v 2 ) means the mean is m and the variance is v 2 The univariate normal distribution of IG(a σ ,b σ ) represents the hyperparameter a σ 、b σ The inverse gamma distribution of S6. Calculate the full conditional posterior distribution of each parameter in the tensor Bayesian quantile regression model through the Bayesian formula; S7, taking the input sampling number in step S1 as the upper limit, extracting the posterior samples of each parameter from the full conditional posterior distribution of each parameter calculated in step S6; S8. Remove the sample of the parameter in the burn-in period from the burn-in period length input in step S1.4, and calculate and output the parameter estimation value through the remaining samples. as well as 2. The tensor Bayesian quantile regression method based on GSSL penalized prior according to claim 1, characterized in that: In step S5.1, the specific expression of GSSL prior for each parameter of the tensor Bayesian quantile regression model is as follows: in, Indicates a given Under the conditions Follow the distribution represents the covariance matrix, Exp(*) represents the exponential distribution, indicates that the mean is 0 and the covariance is The R-variable normal distribution, represents the indicative function, Represents the regression coefficient vector of the rth rank d order after CP decomposition The elements of are reorganized into a regression coefficient vector, represents the coefficient shrinkage parameter, For a given θ 2 Under the conditions Exponential distribution θ 2 represents the Lasso shrinkage adjustment parameter, represents an indicator variable and is a scalar, Bernoulli(ρ) represents a Bernoulli distribution with a success probability of ρ, express Obey the Bernoulli distribution with the probability of event occurrence being ρ, Bernoulli(v), θ 2 ~Ga(a θ ,b θ ) indicates v 2 Gamma distribution Ga(a θ ,b θ ), Ga(a θ ,b θ ) represents the hyperparameter a θ and hyperparameter b θ The gamma distribution, Beta(a ρ ,b ρ ) indicates that the mean is The beta distribution of The coefficient vector is active, otherwise it indicates the coefficient vector Inactive, ρ represents probability.

3. The tensor Bayesian quantile regression method based on GSSL penalized prior according to claim 1, characterized in that: The fully conditional posterior distribution of each parameter in step S6 is specifically: Regression coefficient vector In a given data set intercept μ, scale parameter σ, latent variable set z, variance matrix Coefficient vector set and indicator variables The fully conditional posterior under the condition is as follows: Among them, μ represents the intercept, Representation parameters The posterior mean of , σ represents the scale parameter, represents the covariance matrix, represents the regression coefficient vector, represents the posterior covariance matrix, represents a data set, represents the posterior covariance The inverse of , d = 1, 2, ..., D represents D tensor dimensions, represents an indicator variable, j d With subscript i d The same meaning as the subscript i d , Indicates removal of parameters The set of all other regression coefficient vectors of , Indicates the jth d The regression coefficient vector after CP decomposition, z represents n latent variables z1,…,z n The set composed of d represents the dimension of the tensor at the dth order, k1 and k2 represent the known quantities about the quantile τ, B t Representation Matrix ⊙ t≠d Denotes D-1 matrices B whose subscripts are not d D , …, B d+1 , B d-1 , ..., the dot product of B1, vec(·) represents the straightening function, Represents the preservation of tensor covariates In and subscript i d The relevant elements, θ i Represents a scalar whose value is z i represents a latent variable, the superscript T represents transposition, and y i represents the i-th observation value of the response variable, can be reparameterized as in Indicator variables In a given data set intercept μ, scale parameter σ, latent variable set z, prior probability ρ, variance matrix And the coefficient vector set The fully conditional posterior under the condition is as follows: in, The success probability is Bernoulli distribution, exp(*) represents the exponential function, represents a scalar obtained by a posteriori calculation, and ρ represents The prior probability of express The covariance matrix when ln(ρ) represents the logarithmic function with natural logarithm as base, Representation Matrix The determinant of z represents n latent variables z1,…,z n The set of components; Coefficient shrinkage parameter Given a coefficient vector Indicator variables and the contraction adjustment parameter θ 2 The fully conditional posterior under the condition is as follows: where GIG(·,·,·) represents the generalized inverse Gaussian distribution, θ 2 represents the Lasso shrinkage adjustment parameter, can be reparameterized as and as well as express The covariance matrix when express The covariance matrix when represents an indicator variable, Representation vector The rth element of Represents the coefficient vector After reparameterization, some parameters are expressed as hour The value of Respectively The R diagonal elements of Respectively R diagonal elements of , diag(*) means a diagonal matrix with * as the diagonal elements; Lasso shrinkage adjustment parameter θ 2 The fully conditional posterior under the given coefficient shrinkage parameter set λ is as follows: Among them, λ represents all The set composed of represents the coefficient shrinkage parameter, a θ and b θ They represent hyperparameters, Ga(*) represents gamma distribution, Indicates the sum of the internal D data. Indicates the internal p d The data are summed up, Sum the internal R data; The fully conditional posterior of the probability parameter ρ under the given indicator variable set γ is as follows: Among them, γ represents all indicator variables The set composed of It means the mean The beta distribution, p d represents the dimension of the d-th order of the tensor, represents an indicator variable, Indicates the sum of the internal D data. Indicates the internal p d The data are summed; The intercept μ in a given data set Tensor coefficients The fully conditional posterior under the condition of scale parameter σ and latent variable set z is as follows: Among them, m * represents the posterior mean of the intercept μ, v *2 represents the posterior variance of the intercept μ, v 2 represents the prior variance of the intercept μ, m represents the prior mean of the intercept μ, Express and The inner product of Latent variable z i In a given data set Tensor coefficients The posterior distribution under the condition of and scale parameter σ is as follows: in, Express and The inner product of GIG(·,·,·) represents the generalized inverse Gaussian distribution, k1 and k2 represent the known quantities about the quantile τ, is the tensor covariate of the ith observation, y i represents the i-th observation value of the response variable; The scale parameter σ in a given dataset Tensor coefficients The fully conditional posterior distribution under the intercept μ and the latent variable set z is as follows: Where n represents the sample size, IG(1.5n+a σ ,c σ ) represents 1.5n+a σ and c σ The inverse gamma distribution, c σ represents the posterior scale parameter.

4. The tensor Bayesian quantile regression method based on GSSL penalized prior according to claim 3, characterized in that: The specific process of step S7 is as follows: S7.1, initialization parameters; S7.2, the extracted d-th dimension is i d The posterior sample of the parameters of ,; S7.3, given λ (t) Under the condition of Lasso contraction adjustment parameter θ 2 Extract the Lasso shrinkage adjustment parameter (θ) of the tth iteration from the fully conditional posterior expression 2 ) (r) , where λ (t) represents all the The set of components; S7.4, given γ (t) Under the condition of (t) , where γ (t) Represents all indicator variables extracted in step S7.2 The set of components; S7.

5. Given the scale parameter σ of the t-1th iteration (t-1) , z of the t-1th iteration (t-1) , the tensor coefficients of the tth iteration Under the condition of , the intercept μ of the tth iteration is extracted from the full conditional posterior of the intercept μ (t) ; S7.

6. Extract the latent variable z under the i-th sample i The posterior sample of S7.

7. Given the tensor coefficients for the tth iteration The intercept μ at the tth iteration (t) and z (t) Under the condition of , the scale parameter σ of the tth iteration is extracted from the full conditional posterior distribution of the scale parameter σ (t) ; S7.

8. Repeat S7.2-S7.7 until the algorithm iterates to the sampling number input in step S1.4 and the iteration is completed.

5. The tensor Bayesian quantile regression method based on GSSL penalized prior according to claim 4, characterized in that: The step S7.2 comprises the following steps: S7.2.1: Given μ (t-1) ,σ (t-1) ,x (t-1) , ρ (t-1) as well as Under the condition of Extract where x (t-1) represents the iterative value sequence of parameter set z at the t-1th time, μ (t-1) represents the intercept of the t-1 iteration, σ (t-1) represents the scale parameter of the t-1 iteration, represents the covariance matrix of the t-1 iteration, It means the mean The covariance matrix is The R-variable normal distribution, express The sample value at step t, Represents the set of regression coefficient vectors for the t-1th iteration A sequence of sample values ​​of ; S7.2.2: Given and (θ 2 ) (t-1) Under the condition of and Extract and Where r = 1,…,R, (θ 2 ) (t-1) represents the Lasso shrinkage adjustment parameter for the t-1th iteration, express The sampling value of the tth iteration, Representation vector The rth element of express The sampling value of the tth iteration; S7.2.3: From indicator variables Extract the indicator variable of the tth iteration from the fully conditional posterior expression pass Update Parameters represents the regression coefficient vector of the tth iteration; S7.2.4: Pass renew Where r = 1,…,R, express The sampling value of the tth iteration, express The sampling value of the tth iteration, express The r diagonal elements of express The sampling value of the tth iteration, Respectively The rth diagonal element of represents the i-th observation value of the response variable at t iterations; S7.2.5: Repeat S7.2.1-S7.2.4 until all d=1,…,D,i are traversed. d =1,…,p d .

6. The tensor Bayesian quantile regression method based on GSSL penalized prior according to claim 4, characterized in that: The step 7.6 comprises the following steps: S7.6.

1. Given the tensor coefficients for the tth iteration The intercept μ at the tth iteration (t) and the scale parameter σ of the t-1th iteration (t-1) Under the condition of i In a given data set Tensor coefficients The latent variable of the tth iteration is extracted from the posterior distribution expression under the condition of and scale parameter σ S7.6.

2. Repeat S7.6.1 until i=1, 2…, n is traversed.

Citation Information

Patent Citations

  • Hyperspectral image de-noising method based on Gaussian-Wardt priori

    CN115937006A

  • Spatial and temporal feature extraction method based on Bayesian tensor analysis and extraction system thereof

    CN118171086A

Cited By

  • DOA super-resolution estimation method and product based on Toeplitz covariance enhancement and neural network

    CN122310080A