*! version 1.0 2021-08-03

Title

mlad -- Python utility finctions for mlad.

mlad has a number of utility functions written in Python. They been accessed after importing in Python, e.g. by using import mladutil as mu

The functions are described below.

invlogit(z)
Transforms from the log odds scale to the probability scale.

linpred(beta,X,eq) - extract linear predictor.

beta - full beta matrix

X - full covariates list

eq - equation number

rcsgen_beta(x,knots,beta,rmatrix) Restricted cubic splines basis functions multiplied by beta matrix.

x - orginal variable

knots - knots

beta - beta matrix

rmatrix - rmatrix for orthogonalization. Use jnp.ones((1,1)) if not orthogonalized.

rcsgen(x,knots,rmatrix) Restricted cubic splines basis functions.

x - orginal variable

knots - knots

rmatrix - rmatrix for orthogonalization. Use jnp.ones((1,1)) if not orthogonalized.

Use vrcsgen for a vectorized version of rcsgen.

drcsgen(x,knots,rmatrix) 1st derivatove of restricted cubic splines basis functions.

x - orginal variable

knots - knots

rmatrix - rmatrix for orthogonalization. Use jnp.ones((1,1)) if not orthogonalized.

Use vdrcsgen for a vectorized version of drcsgen.

sumoverid(id,x,Nid) - sum X over id

id - id indicator

x - variables to be summed

Nid - Number of unique individuals

vecquad_gl(fn,a,b,Nnodes,arglist) Gauss-Legendre quadrature

fn - function to be integrated

a - lower limit of integral

b - upper limit of integral

Nnodes - Number of nodes

arglist - List of additional arguments for function fn

vecquad_gh(fn,Nnodes,arglist) Gauss-Hermite quadrature

fn - function to be integrated

Nnodes - Number of nodes

arglist - List of additional arguments for function fn

weibsurv(t,lam,gam) - Weibull survival function.

t - time

lam - lambda

gam - gamma

weibdens(t,lam,gam) - Weibull density function.

t - time

lam - lambda

gam - gamma

mlvecsum(Z,X,eq) - equivalent of mlvecsum in Stata

Z - expression

X - full list of covariates

eq - equation number

mlmatsum(Z,X,eq) - equivalent of mlvecsum in Stata

Z - expression

X - full list of covariates

eq - equation number