nonlinear sem

Nonlinear latent variable models

ML-inference in non-linear SEMs is complex. Computational intensive methods based on numerical integration are needed and results are sensitive to distributional assumptions. In a recent paper: A two-stage estimation procedure for non-linear structural equation models by Klaus Kähler Holst & Esben Budtz-Jørgensen (https://doi.org/10.1093/biostatistics/kxy082), we consider two-stage estimators as a computationally simple alternative to MLE. Here both steps are based on linear models: first we predict the non-linear terms and then these are related to latent outcomes in the second step. ...

June 2020 · Klaus Kähler Holst
solver class

A simple ODE Class

A small illustration on using the armadillo C++ linear algebra library for solving an ordinary differential equation of the form X(t)=F(t,X(t),U(t)). The abstract super class Solver defines the methods solve (for approximating the solution in user-defined time-points) and solveint (for interpolating user-defined input functions on a finer grid). As an illustration a simple Runge-Kutta solver is derived in the class RK4. The first step is to define the ODE, here a simple one-dimensional ODE X(t)=θ{U(t)X(t)} with a single input U(t): rowvec dX(const rowvec &input, // time (first element) and additional input variables const rowvec &x, // state variables const rowvec &theta) { // parameters rowvec res = { theta(0)*theta(1)*(input(1)-x(0)) }; return( res ); } The ODE may then be solved using the following syntax odesolver::RK4 MyODE(dX); arma::mat res = MyODE.solve(input, init, theta); with the step size defined implicitly by input (first column is the time variable and the following columns the optional different input variables) and boundary conditions defined by init. ...

November 2019 · Klaus Kähler Holst