KerMor
0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
|
ParamTimeKernelExpansion: Kernel expansion class for time and/or parameter dependent kernels. More...
ParamTimeKernelExpansion: Kernel expansion class for time and/or parameter dependent kernels.
This class represents a function \(f\) in the space induced by given kernels \(\K_{s,t,\mu}\) for state, time and parameter space as
\[f(x,t,\mu) = \sum\limits_{i=1}^N c_i\K_s(x,x_i)\K_t(t,t_i)\K_\mu(\mu,\mu_i)\]
This class is the composition of three different kernels, which are one for time, parameters and state variables. Those kernels are combined using the function handle set by the property SubKernelCombinationFun.
Centers
This class is part of the framework
Homepage
http://www.morepas.org/software/index.htmlDocumentation
http://www.morepas.org/software/kermor/index.htmlLicense
KerMor license conditions Definition at line 18 of file ParamTimeKernelExpansion.m.
Public Member Functions | |
ParamTimeKernelExpansion () | |
Default constructor. More... | |
function fx = | evaluate (colvec< double > x,double t,colvec< double > mu) |
function phi = | getKernelVector (colvec< double > x,double t,colvec< double > mu) |
Returns the kernel vector \(\varphi(x,t,\mu) = (\K(x,x_i)\K(t,t_i)\K(\mu,\mu_i))_i\). (for the case of a product SubKernelCombinationFun More... | |
function J = | getStateJacobian (colvec< double > x,double t,colvec< double > mu) |
Evaluates the jacobian matrix of this function at the given point. More... | |
function c = | getGlobalLipschitz (double t,colvec< double > mu) |
Overrides the implementation in KernelExpansion. More... | |
function K = | getKernelMatrix () |
Computes the kernel matrix for the currently set center data. More... | |
function K = | getKernelMatrixColumn (idx,colvec< double > x,double t,colvec< double > mu) |
Computes the kernel matrix for the currently set center data. More... | |
function | setCentersFromATD (data.ApproxTrainData atd,rowvec< integer > idx) |
Sets the centers according to the indices idx of the training data. More... | |
function copy = | clone (copy) |
The interface method with returns a copy of the current class instance. More... | |
function | clear () |
Removes all centers and coefficients from the expansion and leaves the associated kernels untouched. More... | |
Public Member Functions inherited from kernels.KernelExpansion | |
KernelExpansion () | |
Default constructor. More... | |
function fx = | evaluate (matrix x, varargin) |
Evaluates the kernel expansion. More... | |
function phi = | getKernelVector (matrix x, varargin) |
Evaluates the kernel expansion. More... | |
function row = | getKernelMatrixColumn (integer idx,matrix x, varargin) |
Evaluates the kernel expansion. More... | |
function J = | getStateJacobian (x, varargin) |
Evaluates the jacobian matrix of this function at the given point. More... | |
function K = | getKernelMatrix () |
Computes the kernel matrix for the currently set center data. More... | |
function v = | scalarProductWith (f) |
function | normalize () |
function | setCentersFromATD (data.ApproxTrainData atd,rowvec< integer > idx) |
Sets the centers according to the indices idx of the data.ApproxTrainData. More... | |
function
kernels.KernelExpansion kexp = | toTranslateBase () |
Returns the same kernel expansion with the canonical translate base used. More... | |
function subexp = | getSubExpansion (arg) |
function target = | project (V, W) |
function | clear () |
Removes all centers and coefficients from the expansion and leaves the associated kernels untouched. More... | |
function sum = | plus (B) |
Adds two kernel expansions and will clone the frist argument's class as result type. More... | |
function diff = | minus (B) |
Adds two kernel expansions and will clone the frist argument's class as result type. More... | |
function neg = | uminus () |
function | exportToDirectory (dir) |
function json = | toJSON (filename) |
function res = | test_getStateJacobianInstance () |
Public Member Functions inherited from KerMorObject | |
KerMorObject () | |
Constructs a new KerMor object. More... | |
function | display () |
disp(object2str(this)); More... | |
function bool = | eq (B) |
Checks equality of two KerMor objects. More... | |
function bool = | ne (B) |
Checks if two KerMorObjects are different. More... | |
function cn = | getClassName () |
Returns the simple class name of this object without packages. More... | |
Public Member Functions inherited from DPCMObject | |
DPCMObject () | |
Creates a new DPCM object. More... | |
DPCMObject () | |
Public Member Functions inherited from general.AProjectable | |
function handle target = | project (matrix< double > V,matrix< double > W,handle target) |
Returns a NEW INSTANCE of the projected object that does not rely on data of the old one via references (everything must be copied to ensure separability of reduced(=projected) versions and full versions, unless. More... | |
Public Attributes | |
kernels.BaseKernel | TimeKernel |
The Kernel to use for time variables. More... | |
kernels.BaseKernel | ParamKernel |
The Kernel to use for parameter variables. More... | |
SubKernelCombinationFun = @("t,s,p")t .* s .* p | |
The function that combines the sub (time/system/param) kernels. Must be a function handle that takes three arguments. More... | |
StateNablaCombinationFun = @("t,s,p)bsxfun(\@times, s, t.*p") | |
The combination function for the nabla of the system/state kernel with the other kernels. More... | |
Public Attributes inherited from kernels.KernelExpansion | |
kernels.BaseKernel | Kernel |
The Kernel to use for system variables. More... | |
rowvec | Ma_norms |
The norms of the coefficient matrix of the kernel expansion. More... | |
double | NativeNorm |
Returns the norm \(||f||^2_{\H^q}\) of \(f\) in the RKHS \(\H^q,\quad q\in\N\). More... | |
colvec< double > | ComponentNorms |
Returns the native space norms \(||f_j||^2_\H\) for each component function \(j \equiv\)size(Ma,1) More... | |
MBnd | |
Returns the M upper bound for this KernelExpansion, which is \(M := \max\limits_{j=1}^d\sum\limits_{i=1}^m |c^d_i|\). More... | |
logical | HasCustomBase |
Flag that indicates if a base other than the direct translate base is used for this kernel expansion. More... | |
Size | |
The size of the kernel expansion. More... | |
struct | Centers = struct("'xi',[]") |
The kernel centers used in the approximation. More... | |
matrix< double > | Ma = "[]" |
The coefficient data for each dimension. More... | |
matrix< double > | Base = 1 |
This property lets the user store a custom base, for which the coefficients are set. The custom base tells which linear combinations of center elements belong to which base. More... | |
Public Attributes inherited from DPCMObject | |
WorkspaceVariableName = "" | |
The workspace variable name of this class. Optional. More... | |
ID = "[]" | |
An ID that allows to uniquely identify this DPCMObject (at least within the current MatLab session/context). More... | |
PropertiesChanged = "[]" | |
The Dictionary containing all the property settings as key/value pairs. More... | |
Public Attributes inherited from handle | |
addlistener | |
Creates a listener for the specified event and assigns a callback function to execute when the event occurs. More... | |
notify | |
Broadcast a notice that a specific event is occurring on a specified handle object or array of handle objects. More... | |
delete | |
Handle object destructor method that is called when the object's lifecycle ends. More... | |
disp | |
Handle object disp method which is called by the display method. See the MATLAB disp function. More... | |
display | |
Handle object display method called when MATLAB software interprets an expression returning a handle object that is not terminated by a semicolon. See the MATLAB display function. More... | |
findobj | |
Finds objects matching the specified conditions from the input array of handle objects. More... | |
findprop | |
Returns a meta.property objects associated with the specified property name. More... | |
fields | |
Returns a cell array of string containing the names of public properties. More... | |
fieldnames | |
Returns a cell array of string containing the names of public properties. See the MATLAB fieldnames function. More... | |
isvalid | |
Returns a logical array in which elements are true if the corresponding elements in the input array are valid handles. This method is Sealed so you cannot override it in a handle subclass. More... | |
eq | |
Relational functions example. See details for more information. More... | |
transpose | |
Transposes the elements of the handle object array. More... | |
permute | |
Rearranges the dimensions of the handle object array. See the MATLAB permute function. More... | |
reshape | |
hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape function. More... | |
sort | |
ort the handle objects in any array in ascending or descending order. More... | |
Public Attributes inherited from general.AProjectable | |
V | |
The \(V\) matrix of the biorthogonal pair \(V,W\). More... | |
W | |
The \(W\) matrix of the biorthogonal pair \(V,W\). More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from kernels.KernelExpansion | |
static function res = | test_getStateJacobian () |
Protected Member Functions inherited from KerMorObject | |
function | checkType (obj, type) |
Object typechecker. More... | |
Protected Member Functions inherited from DPCMObject | |
function | registerProps (varargin) |
Call this method at any class that defines DPCM observed properties. More... | |
function | registerProps (varargin) |
Static Protected Member Functions inherited from kernels.KernelExpansion | |
static function this = | loadobj (this, from) |
As the constant properties are transient, they have to be re-computed upon loading. More... | |
Static Protected Member Functions inherited from DPCMObject | |
static function obj = | loadobj (obj, from) |
Re-register any registered change listeners! More... | |
static function obj = | loadobj (obj, from) |
Static Protected Member Functions inherited from general.AProjectable | |
static function obj = | loadobj (obj, from) |
Protected Attributes inherited from kernels.KernelExpansion | |
kernels.BaseKernel | fSK |
The inner (state) kernel object. More... | |
kernels.ParamTimeKernelExpansion.ParamTimeKernelExpansion | ( | ) |
Default constructor.
Initializes default kernels.
Definition at line 160 of file ParamTimeKernelExpansion.m.
References kernels.KernelExpansion.Centers, and DPCMObject.registerProps().
function kernels.ParamTimeKernelExpansion.clear | ( | ) |
Removes all centers and coefficients from the expansion and leaves the associated kernels untouched.
Definition at line 347 of file ParamTimeKernelExpansion.m.
References kernels.KernelExpansion.Centers.
|
virtual |
The interface method with returns a copy of the current class instance.
target | If clone was called for a subclass of this class, target must contain the new instance of the subclass that is to be the cloned result. |
Reimplemented from kernels.KernelExpansion.
Definition at line 334 of file ParamTimeKernelExpansion.m.
References StateNablaCombinationFun, and SubKernelCombinationFun.
function fx = kernels.ParamTimeKernelExpansion.evaluate | ( | colvec< double > | x, |
double | t, | ||
colvec< double > | mu | ||
) |
Definition at line 190 of file ParamTimeKernelExpansion.m.
References kernels.KernelExpansion.Ma, and t.
|
virtual |
Overrides the implementation in KernelExpansion.
t | The current time(s) \(t \in [0, T]\) |
mu | The currently used parameter \(\vmu\). Set to \([]\) if not used. |
Reimplemented from kernels.KernelExpansion.
Definition at line 239 of file ParamTimeKernelExpansion.m.
References kernels.KernelExpansion.Centers, kernels.BaseKernel.evaluate(), kernels.BaseKernel.getGlobalLipschitz(), k, kernels.KernelExpansion.Kernel, kernels.KernelExpansion.Ma_norms, ParamKernel, and TimeKernel.
function K = kernels.ParamTimeKernelExpansion.getKernelMatrix | ( | ) |
Computes the kernel matrix for the currently set center data.
Convenience method, equal to call evaluateAtCenters with passing the center data as arguments. However, this method is (possibly, depends on kernel implementation) faster as it calls the kernels kernels.BaseKernel.evaluate -method with one argument.
Definition at line 255 of file ParamTimeKernelExpansion.m.
References kernels.KernelExpansion.Centers, and SubKernelCombinationFun.
function K = kernels.ParamTimeKernelExpansion.getKernelMatrixColumn | ( | idx, | |
colvec< double > | x, | ||
double | t, | ||
colvec< double > | mu | ||
) |
Computes the kernel matrix for the currently set center data.
Convenience method, equal to call evaluateAtCenters with passing the center data as arguments. However, this method is (possibly, depends on kernel implementation) faster as it calls the kernels kernels.BaseKernel.evaluate -method with one argument.
x | The state variable vector \(\vx(t)\) |
t | The current time(s) \(t \in [0, T]\) |
mu | The currently used parameter \(\vmu\). Set to \([]\) if not used. |
Definition at line 279 of file ParamTimeKernelExpansion.m.
References kernels.KernelExpansion.Centers, and SubKernelCombinationFun.
function phi = kernels.ParamTimeKernelExpansion.getKernelVector | ( | colvec< double > | x, |
double | t, | ||
colvec< double > | mu | ||
) |
Returns the kernel vector \(\varphi(x,t,\mu) = (\K(x,x_i)\K(t,t_i)\K(\mu,\mu_i))_i\). (for the case of a product SubKernelCombinationFun
x | The state variable vector \(\vx(t)\) |
t | The current time(s) \(t \in [0, T]\) |
mu | The currently used parameter \(\vmu\). Set to \([]\) if not used. |
Definition at line 195 of file ParamTimeKernelExpansion.m.
References kernels.KernelExpansion.Centers, kernels.BaseKernel.evaluate(), kernels.KernelExpansion.fSK, and SubKernelCombinationFun.
function J = kernels.ParamTimeKernelExpansion.getStateJacobian | ( | colvec< double > | x, |
double | t, | ||
colvec< double > | mu | ||
) |
Evaluates the jacobian matrix of this function at the given point.
As this is a component-wise kernel expansion, the jacobian is easily computed using the coefficient vectors and the state variable nablas.
x | The state variable vector \(\vx(t)\) |
t | The current time(s) \(t \in [0, T]\) |
mu | The currently used parameter \(\vmu\). Set to \([]\) if not used. |
Definition at line 213 of file ParamTimeKernelExpansion.m.
References kernels.KernelExpansion.Centers, kernels.KernelExpansion.fSK, kernels.BaseKernel.getNabla(), kernels.KernelExpansion.Ma, StateNablaCombinationFun, and t.
function kernels.ParamTimeKernelExpansion.setCentersFromATD | ( | data.ApproxTrainData | atd, |
rowvec< integer > | idx | ||
) |
Sets the centers according to the indices idx
of the training data.
atd | The training data |
idx | The indices in the training data for centers |
Definition at line 312 of file ParamTimeKernelExpansion.m.
References kernels.KernelExpansion.Centers, data.ApproxTrainData.hasParams, data.ApproxTrainData.hasTime, data.ApproxTrainData.mui, and data.ApproxTrainData.ti.
kernels.ParamTimeKernelExpansion.ParamKernel |
The Kernel to use for parameter variables.
Default: kernels.NoKernel
Dependent
set to true. SetObservable
set to true. Definition at line 93 of file ParamTimeKernelExpansion.m.
Referenced by getGlobalLipschitz().
kernels.ParamTimeKernelExpansion.StateNablaCombinationFun = @("t,s,p)bsxfun(\@times, s, t.*p") |
The combination function for the nabla of the system/state kernel with the other kernels.
Depends directly on the SubKernelCombinationFun
SetObservable
set to true. Definition at line 133 of file ParamTimeKernelExpansion.m.
Referenced by clone(), and getStateJacobian().
kernels.ParamTimeKernelExpansion.SubKernelCombinationFun = @("t,s,p")t .* s .* p |
The function that combines the sub (time/system/param) kernels. Must be a function handle that takes three arguments.
Default: @(t,s,p)t .* s .* p @(t,s,p)t .* s .* p
SetObservable
set to true. Definition at line 114 of file ParamTimeKernelExpansion.m.
Referenced by clone(), getKernelMatrix(), getKernelMatrixColumn(), and getKernelVector().
kernels.ParamTimeKernelExpansion.TimeKernel |
The Kernel to use for time variables.
Default: kernels.NoKernel
Dependent
set to true. SetObservable
set to true. Definition at line 74 of file ParamTimeKernelExpansion.m.
Referenced by getGlobalLipschitz().