[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-348118-105":59,"doc-detail-348118-en":135,"doc-similar-348118":167},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":128,"head_meta":130,"extra_data":132,"updated_unix":134},105,"en","the-matrix-cookbook-linear-regression-lecture-notes","The Matrix Cookbook - Linear Regression - Lecture Notes","","These lecture notes develop matrix calculus and apply it to linear regression. They define row/column vectors, transpose and product identities, and derive inner products and gradients for vector-valued functions. Using chain rule, product rule, and linear/quadratic derivative examples, the notes establish how to minimize quadratic loss. They then present the least-squares solution with the pseudo-inverse, extend regression via polynomial and radial basis functions, and analyze generalization through a bias-variance decomposition of expected, structure, and approximation errors.",{"@graph":69,"@context":127},[70,84,106],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/the-matrix-cookbook-linear-regression-lecture-notes/348118/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/the-matrix-cookbook-linear-regression-lecture-notes/348118.png","ImageObject",300,407,{"name":92,"@type":93},"Jacob","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-28","2026-09-22",true,{"@type":102,"interactionType":103,"userInteractionCount":105},"InteractionCounter",{"@type":104},"ViewAction",17,{"@type":107,"mainEntity":108},"FAQPage",[109,115,119,123],{"name":110,"@type":111,"acceptedAnswer":112},"What is the gradient defined as for functions f(x) : R^d → R?","Question",{"text":113,"@type":114},"The gradient is defined as a row vector containing the partial derivatives with respect to each component of x.","Answer",{"name":116,"@type":111,"acceptedAnswer":117},"How is the least-squares solution for linear regression obtained?",{"text":118,"@type":114},"The notes minimize the quadratic error by setting its gradient with respect to w to 0, yielding w = (X^T X)^(-1) X^T y, where (X^T X)^(-1) X^T is the pseudo-inverse of X.",{"name":120,"@type":111,"acceptedAnswer":121},"What distinguishes structure error from approximation error?",{"text":122,"@type":114},"Structure error comes from the functional form used to fit data and can be estimated using a very large dataset, while approximation error reflects how much the learned function varies when sampling different training sets of size N (linked to the variance of estimates).",{"name":124,"@type":111,"acceptedAnswer":125},"How does bias-variance tradeoff relate to expected loss?",{"text":126,"@type":114},"The notes state that expected loss equals variance plus bias squared, so reducing bias by increasing model complexity typically increases variance.","https://schema.org",{"og:url":83,"og:type":129,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":131,"canonical":83},"index,follow",{"doc_id":133,"site_id":62},348118,1790464929,{"code":4,"msg":5,"data":136},{"doc_id":133,"user_id":137,"nickname":92,"user_avatar":138,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":139,"file_id":140,"file_url":141,"file_type":142,"file_size":143,"view_count":105,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":29,"language":144,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":145,"faqs":146,"seo_title":147,"seo_description":67,"update_tm":148,"read_time":149,"preview_page_count":19,"preview_urls":150},962084931830,"https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd","1 The Matrix Cookbook  \n2 aa1 3  \nNotation : A vector a = 6 .. 2 7 always denotes a row-vector. With aT = [a1 ; a2 ; : : : ; ad] we will  \n4 a. d 5  \ndenote a column vector.  \nTranspose :  \n(A + B)T = AT + BT ; (AB)T = BT AT ; (A 􀀀1)T = (AT ) 􀀀1 = A 􀀀T (1)  \nProduct :  \n(AB)ij = X AikBki (2)  \nk  \n(AB)C = A (BC) ; AB  BA (3)  \nInner product of 2 vectors:  \naTb = Xakbk (4)  \nk  \n1.1 Matrix derivatives  \nGradient of a function f (x) : Rd ! R: The gradient is de􀀌ned as row vector:  \n@@f~~x~~ = 􀀔 @@fx1 ; @@fx2 ; : : : ; @@fxd 􀀕 (5)  \nChain Rule  \n@@ZX = @@ZY @@YX~~ ~~ (6)  \nProduct Rule  \n@~~ ~~(YZ@X) = @@YXZ + Y @@ZX (7)  \nLinear derivatives  \n@aTx @xTa T  \n @x  =  @x  = a (8)  \n@A@~~x~~x = A ; ~~ @x~~@A = AT (9)  \nQuadratic derivatives  \n@xTAx = xTA + xTAT  @xTx = 2xT (10)  \n@x ; @x  \nFigure 1: Linear Regression: The training data points are given by the blue circles, the original function is plotted by the green line. Based on the knowledge from the data-points we want to 􀀌nd the original function.  \n2 Linear Regression  \nWe are given a dataset D = hxi ; yiii=1:::N (for simplicity we assume that y is a scalar, x is a vector of dimensionality d) . We want to 􀀌nd a linear function f (x; w) = w0 +Pdk=1 wkxk = Tw with T = [1xT ] which minimizes the quadratic error function :  \nE = 1=NX(Tiw 􀀀 yi )2 (11)  \ni  \nThe setting is illustrated in Figure 1.  \nThe error function can be easily written in matrix form by noting that a sum over the squared error terms can be represented as the inner product of the error vector  \n26 T1T2ww 􀀀 y 1y 2 37   \nz = 6 7 = Xw 􀀀 y (12)  \n6 .. 7  \n4 xTNw 􀀀 yN 5  \n2  \nwith X = 6 6  \n4  \nT1  \nT2  \n.  \n.  \n.  \nTN  \n3  \n7 7  \n7  \n5  \nand  \n2  \n6  \ny = 6  \n6  \n4  \ny 1  \ny2  \n.  \n.  \n.  \nyN  \n3  \n7 7  \n7  \n5  \nE = 1=NzTz = 1=N(Xw 􀀀 y)T (Xw 􀀀 y) (13)  \n2.1 Least Squares Solution  \nWe now derivate E w.r.t w and set the gradient to 0T Apply Eq. 6 , 10 and 9 :  \nFigure 2: Polynomial basis functions  \n@@E~~w~~ = 1=N@~~ ~~(Xw~~ ~~􀀀~~ ~~y@)T~~w~~(Xw~~ ~~􀀀~~ ~~y) = 0 ; Apply chain rule 6 (Xw 􀀀 y)TX = 0  \nwTXT X 􀀀 yTX = 0  \nwTXT X = yTX ; right multiply by (XTX)􀀀1  \nwT = yTX (XTX) 􀀀1 ; transpose...  \nw = (XTX) 􀀀1XTy  \n(XTX)􀀀1XT is also known as pseudo inverse of matrix X.  \n2.2 Basis functions  \nInstead of directly using the input vectors x in our regression, we can use arbitrary non-linear basis functions 􀀞 k (x) for our linear regression  \nd  \nf (x; w) =X 􀀞k (x)wk = 􀀞Tw (14)  \nk=1  \nPolynomial Basis functions : For a l degree polynomial we have l + 1 basis functions (for scalar x)  \n􀀞 k (x) = xk􀀀1 (15)  \nFor higher dimensional x we have to take all products of elements of x up to the order l, thus the number of basis functions quickly increases!  \nRadial Basis functions : Here we uniformly distribute l basis functions (also called receptive 􀀌elds) in the input space  \n􀀞 k (x) = exp(􀀀(x 􀀀 􀀖k )2 =(2􀀛2 )) ; (16)  \nwhere 􀀖 k is the location of the kth receptive 􀀌eld and 􀀛 denotes the bandwidth of the basis functions. The number of needed basis functions usually scales exponentially with the number of input dimensions !  \nFigure 3: RBF basis functions  \n3 Decomposition in Structure and Approximation Error  \nDe􀀌nitions :  \nExpected Error: ED [E (D)] Expected error if we sample a data set of given size N and use this data set to 􀀌t our function. Here, the expectation has to be done also over all possible datasets of size N! E (D ) denotes the error if we use training set D to 􀀌t the function (see below) .  \nStructure Error: Error that comes solely from the structure of the function used to 􀀌t the data. Can be estimated by 􀀌tting the function on a very large data set (thus, the approximation error vanishes) .  \nApproximation Error: Is given by the variance of the function estimates if we sample di􀀋erent training sets of size N. The more complex functions we use, the higher the variance of our estimate gets!  \nLets denote f(x; D) a function learned from the a speci􀀌c dataset D containing N examples andy (x) denote the target func","cbCaisDS7ERgyAdm","https://ap.wps.com/l/cbCaisDS7ERgyAdm","pdf",356758,"English","# Matrix derivatives\n## Vector notation and transpose/product rules\n## Gradient and chain/product rules\n## Linear and quadratic derivatives\n# Linear Regression\n## Dataset and quadratic error\n## Least squares solution\n## Basis functions: polynomial and radial basis\n# Decomposition in Structure and Approximation Error\n## Expected error, structure error, approximation error\n## Bias-variance tradeoff and expected loss","[{\"question\":\"What is the gradient defined as for functions f(x) : R^d → R?\",\"answer\":\"The gradient is defined as a row vector containing the partial derivatives with respect to each component of x.\"},{\"question\":\"How is the least-squares solution for linear regression obtained?\",\"answer\":\"The notes minimize the quadratic error by setting its gradient with respect to w to 0, yielding w = (X^T X)^(-1) X^T y, where (X^T X)^(-1) X^T is the pseudo-inverse of X.\"},{\"question\":\"What distinguishes structure error from approximation error?\",\"answer\":\"Structure error comes from the functional form used to fit data and can be estimated using a very large dataset, while approximation error reflects how much the learned function varies when sampling different training sets of size N (linked to the variance of estimates).\"},{\"question\":\"How does bias-variance tradeoff relate to expected loss?\",\"answer\":\"The notes state that expected loss equals variance plus bias squared, so reducing bias by increasing model complexity typically increases variance.\"}]","The Matrix Cookbook - Linear Regression - Lecture Notes | PDF",1790071210,15,[151,155,159,163],{"page_no":8,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/ac25aab0a2f2745409756c8cf2d6f180.webp",983,1272,{"page_no":14,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/bee7849c8bec8ba3c6cbf69b932b2412.webp",982,1270,{"page_no":81,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/2cc23db25b73aaaec84bff72ae37a830.webp",981,1269,{"page_no":19,"url":164,"width":165,"height":166},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/388bf9e2f3538580c61be7fb6320f23f.webp",980,1268,{"list":168,"token":66},[169,176,183,190,197,203,210,217,223,229],{"doc_id":170,"doc_title":171,"file_type":142,"home_preview_img_url":172,"slug":173,"view_count":174,"category_name":40,"create_tm":175},290834,"Matrix Calculus - (for Machine Learning and Beyond) - Lecture Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229903743673/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=ev91cm5Bugg%2BRQSQ%2Bwu9%2FzfBs8A%3D","matrix-calculus-for-machine-learning-and-beyond-lecture-notes",18,1789642709,{"doc_id":177,"doc_title":178,"file_type":142,"home_preview_img_url":179,"slug":180,"view_count":181,"category_name":40,"create_tm":182},134456,"PolySketchFormer - Fast Transformers via Sketching Polynomial Kernels","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229861044008/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=OH%2Bsjlkjd6vOQDeX39GVbrQPCoM%3D","polysketchformer-fast-transformers-via-sketching-polynomial-kernels",22,1787262769,{"doc_id":184,"doc_title":185,"file_type":142,"home_preview_img_url":186,"slug":187,"view_count":188,"category_name":40,"create_tm":189},86264,"Advancing Optimal Subset Oracle via Learning Relaxation of Neural Set Functions","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809395273/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=cwoNw3LyOfFEsNMTNuwBuVspRLE%3D","advancing-optimal-subset-oracle-via-learning-relaxation-of-neural-set-functions",27,1784209904,{"doc_id":191,"doc_title":192,"file_type":142,"home_preview_img_url":193,"slug":194,"view_count":195,"category_name":40,"create_tm":196},82734,"An LSQR-Based Algorithm for Large-Scale Null Space Computations","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229808906266/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=Slz9U3Xt3gmSKT7%2FDNAxmqN6WeQ%3D","an-lsqr-based-algorithm-for-large-scale-null-space-computations",24,1784182569,{"doc_id":198,"doc_title":199,"file_type":142,"home_preview_img_url":200,"slug":201,"view_count":174,"category_name":40,"create_tm":202},296930,"ECB Working Paper Series - No. 345 - Optimal Monetary and Fiscal Policy - A Linear-Quadratic Approach","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229905464964/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=6yOjRB1krc%2Bz%2FjO8LoJ6Ky81csI%3D","ecb-working-paper-series-no-345-optimal-monetary-and-fiscal-policy-a-linear-quadratic-approach",1789738833,{"doc_id":204,"doc_title":205,"file_type":142,"home_preview_img_url":206,"slug":207,"view_count":208,"category_name":40,"create_tm":209},82068,"Convergence of Fictitious Play for Fully Coupled FBSDEs in Infinite-Player Stochastic Differential Games","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229808708372/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=lmCBVbxe%2BzEKtw2gbgZ3r2Mv8Io%3D","convergence-of-fictitious-play-for-fully-coupled-fbsdes-in-infinite-player-stochastic-differential-games",21,1784178009,{"doc_id":211,"doc_title":212,"file_type":142,"home_preview_img_url":213,"slug":214,"view_count":215,"category_name":40,"create_tm":216},84574,"Ghost in the Kernel: In-Context Learning with Efficient Transformers via Domain Generalization","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809061911/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=iRVWZGVbDd0EbknmuEUTPDTYmTc%3D","ghost-in-the-kernel-in-context-learning-with-efficient-transformers-via-domain-generalization",25,1784196888,{"doc_id":218,"doc_title":219,"file_type":142,"home_preview_img_url":220,"slug":221,"view_count":149,"category_name":40,"create_tm":222},347101,"Metamodeling Complex Systems Using Linear and Nonlinear Regression Methods","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229910999895/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=AsuJ40qECAizZHOEMfdD%2BtBuusc%3D","metamodeling-complex-systems-using-linear-and-nonlinear-regression-methods",1790065312,{"doc_id":224,"doc_title":225,"file_type":142,"home_preview_img_url":226,"slug":227,"view_count":181,"category_name":40,"create_tm":228},119669,"Selective machine learning of doubly robust functionals - Research paper overview","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229835061075/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=QEJsaHQvW1l45y%2BPiziU8Q9htOY%3D","selective-machine-learning-of-doubly-robust-functionals-research-paper-overview",1785725605,{"doc_id":230,"doc_title":231,"file_type":142,"home_preview_img_url":232,"slug":233,"view_count":234,"category_name":40,"create_tm":235},83273,"Approximability of Electrical Distribution Network Reconfiguration for General Graphs","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229808833456/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110439&Signature=3ac6JxT4oKr79cN%2Biwyf9LvEtxk%3D","approximability-of-electrical-distribution-network-reconfiguration-for-general-graphs",23,1784186431]