-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Milestone
Description
I use this issue to collect all my suggestions for the rm3
function. New suggestions might be added in the future.
- It is great that the
rm3
checks whether all the parameters used in the activation functions are provided. However, I don't think it's necessary to provide theb
parameter, as it is fixed to be 0 by default. - It would be more convenient if the
rm3
allowed me to provide the entire formula rather than just the activation formula. If I remember correctly, there should be some inner functions inbmm
that can extract the activation formulas from the entire formula. - I attempted to use the
rm3
function in themutate
function. It was not very convenient. I have provided my code below. I wonder if there is any way we can simplify the code.
data <- data_pars %>%
mutate(b=0) %>%
mutate(
pars = pmap(select(., all_of(param_names)),
function(...) setNames(c(...), param_names))
) %>%
# Generate the response variables
mutate(
results = map(
pars,
~ rm3(
n = 1,
size = nResp,
pars = .x,
m3_model = model_m3,
act_funs = act_form
)
)
) %>%
select(-pars) %>%
# Convert each results matrix to a named vector
mutate(
results_vec = map(results, ~ setNames(as.numeric(.x[1, ]), colnames(.x)))
) %>%
select(-results) %>%
# Unnest, using the names from the matrix columns
unnest_wider(results_vec)
Metadata
Metadata
Assignees
Labels
No labels