001*randn(size(X)) % adding noise to observationsĬhecking the difference between ground truth model ( A and B) and recovered ABt: ABt. In this example instead of 50,000 dimension I work with only 2, instead of n=100,000 observations I settled for n=100: n = 100 Ĭ = A*X + B*Y +. Thank you and for your interest and enlightening comments. With these matrices we can write the model as: A matrix C of size 50,000 x n with its i-th column equals to observed c_i.A matrix Y of size 50,000 x n with its i-th column equals to observed y_i.A matrix X of size 50,000 x n with its i-th column equals to observed x_i.To write the system in a matrix form I proposed to stack all observations into matrices: If the number of samples n is greater than 100,000, then there are more than 50,000 * 100,000 ( > 5e9 ) equations and the system is over constraint. Now, each sample ( x_i, y_i, c_i) induces 50,000 equations of the form c_i = Ax_i + By_i in the unknown A and B. The task: given n observations (that is n triplets of vectors _ i=1.n) the task is to uncover A and B. The underlying model assumption is that an observation is generated by c = Ax + By in this model. Model: There are two (unknown) matrices A and B, each of size 50,000x50,000 (total 5e9 unknowns).Īn observation is a triplet of vectors: ( x, y, c) each such vector has 50,000 elements (total of 150,000 observed points at each sample). So, I'll try and make it as clear as possible. It seems like there is quite a fuss around dimensionality here. If you have more than 100,000 samples you may seek for a least-squares solution.
The input and output for solving this problem in MATLAB is given below. advectionpde, a MATLAB code which solves the advection partial differential equation (PDE) dudt + c dudx 0 in one spatial dimension, with a constant velocity c, and periodic boundary conditions, using the FTCS method, forward time difference, centered space difference.
(1.1) We can use MATLAB’s built-in dsolve(). To return implicit solutions of the differential equation, set the Implicit option to true. syms y (t) eqn diff (y) y+exp (-y) eqn (t). So, if the number of data vectors you have is 100,000 you have a single solution (up to linearly dependent samples). Though MATLAB is primarily a numerics package, it can certainly solve straightforward dierential equations symbolically.1 Suppose, for example, that we want to solve the rst order dierential equation y(x) xy. dsolve returns an explicit solution in terms of a Lambert W function that has a constant value. You have 2 * 50,000^2 unknowns (all entries of A and B) and numel(C) equations. Open a new M-File and type the following code. The code for solving the above equations using the ‘solve’ command is as shown. What you wish to solve is for A and B such that C = AX + BY The ‘solve’ command is a predefined function in MATLAB. In the same manner we can define Y and C as 2D collections of ys and cs respectively. Let X be the collection of all 100,000 xs you got (such that the i-th column of X equals the x_i-th vector).