Learn R Programming

pmxNODE (version 0.1.0)

rhs_plot_mlx: Generate Right-hand side data plot (Monolix)

Description

This functions allows to generate right-hand side plot, i.e., combined derivative data of multiple NNs and base-R operations.

Usage

rhs_plot_mlx(
  rhs,
  x_var,
  inputs,
  est_parms = NULL,
  mlx_file = NULL,
  time_nn = NULL,
  act = NULL,
  beta = 20
)

Value

ggplot of right-hand side data.

Arguments

rhs

(string) String of right-hand side

x_var

(string) Name of the variable in inputs against which the right-hand data should be plotted.

inputs

(dataframe) Dataframe of inputs, with corresponding columns (including matching column names for each variable in rhs.

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 vector) Vector for each NN in rhs defining whether the neural network is a time-dependent neural network or not. Default value for all NN is FALSE.

act

(character vector) Vector for each NN in rhs defining the activation function used in the NN. Default value for all NN is "ReLU".

beta

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

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")
est_parms <- pre_fixef_extractor_mlx(mlx_path)
rhs_plot <- rhs_plot_mlx(rhs="NNc + WT * NNct",
                         x_var = "NNc",
                         inputs = data.frame(NNc = 1:100,
                                             NNct = seq(0,10,length.out=100),
                                             WT = rep(50,100)),
                         est_parms=est_parms,
                         time_nn = c(FALSE, TRUE))

Run the code above in your browser using DataLab