Learn R Programming

pmxNODE (version 0.1.0)

der_state_plot_mlx: Generate Derivative versus State Plot (Monolix)

Description

This functions allows to generate a derivative versus state plot for a neural network from a NODE in Monolix.

Usage

der_state_plot_mlx(
  nn_name,
  min_state = NULL,
  max_state = NULL,
  inputs = NULL,
  est_parms = NULL,
  mlx_file = NULL,
  time_nn = FALSE,
  act = "ReLU",
  length_out = 100,
  plot_type = c("base", "ggplot"),
  beta = 20,
  transform = NULL
)

Value

Displaying derivative versus state plot; returns ggplot-object if plot_type="ggplot"

Arguments

nn_name

(string) Name of the NN, e.g., “c” for NNc(...)

min_state

(numeric) Value of minimal state for which the derivative should be calculated (optional if inputs is given, ignored if inputs is defined)

max_state

(numeric) Value of maximal state for which the derivative should be calculated (optional if inputs is given, ignored if inputs is defined)

inputs

(numeric vector) Vector of input values for which derivatives should be calculated (optional if min_state and max_state is given)

est_parms

(named vector; semi-optional) Named vector of estimated parameters from the NN extracted through the pre_fixef_extractor_mlx function. For optionality, see Details.

mlx_file

(string; semi-optional) (path)/name of the Monolix run. Must include ".mlxtran" and estimation bust have been run previously. For optionality, see Details.

time_nn

(boolean) Whether the neural network to analyze is a time-dependent neural network or not. Default values is FALSE.

act

(string) Activation function used in the NN. Currently "ReLU" and "Softplus" available.

length_out

(numeric) Number of points between min_state and max_state

plot_type

(string) What plot type should be used; "base" or "ggplot"

beta

(numeric) Beta value for the Softplus activation function, only applicable if act="Softplus"; Default to 20.

transform

(string) Mathematical exression as string to transform the NN output. Independent variable must be called NN, e.g., "1/(1+exp(-NN))" for sigmoidal transformation.

Author

Dominic Bräm

Details

Either est_parms or mlx_file must be given. If both arguments are given, est_parms is prioritized.

Examples

Run this code
mlx_path <- system.file("extdata","mlx_example1_ind.mlxtran",package="pmxNODE")
der_state_plot <- der_state_plot_mlx(nn="c",
                                     min_state=0,max_state=10,
                                     mlx_file=mlx_path,
                                     plot_type="ggplot")

Run the code above in your browser using DataLab