real_data {GPEMR} | R Documentation |
Real Data Analysis with Model Fitting and Visualization
Description
This function performs parameter estimation for specified models (Logistic, Von-Bertalanffy, or Gompertz) using real data from a TXT or PDF file. It calculates global and local estimates of the model parameters, including their covariance matrices, and optionally generates plots of the estimates and p-values.
Usage
real_data(
data_path,
window_size,
model,
parameter,
cov = FALSE,
Plot_est = FALSE,
p_value_plot = FALSE,
tolerance = 0.05
)
Arguments
data_path |
A character string specifying the path to the data file. Supported file types are TXT and CSV. |
window_size |
An integer specifying the size of the moving window for localized estimation. Default is 3. |
model |
A character string specifying the model to fit. Options are "Logistic", "Von-Bertalanffy", and "Gompertz". |
parameter |
A list containing initial parameter estimates. For "Logistic" and "Von-Bertalanffy" models, the list should include |
cov |
A logical value indicating whether to return the covariance matrices. Default is FALSE. |
Plot_est |
A logical value indicating whether to generate plots of the estimated parameters. Default is FALSE. |
p_value_plot |
A logical value indicating whether to generate plots of p-values for local estimates. Default is FALSE. |
tolerance |
A numeric value specifying the alpha level for p-value calculation. Default is 0.05. |
Value
A list containing:
est_global |
A vector of global parameter estimates. |
cov_global |
A matrix of global covariance estimates (if |
est_local |
A matrix of local parameter estimates. |
cov_local |
A list of local covariance matrices (if |
est_plot |
A plot of the estimated parameters (if |
p_value_plot |
A plot of p-values for local estimates (if |
Examples
data_csv <- system.file("extdata", "sample_data.csv", package = "GPEMR")
results_logistic <- real_data(data_csv, window_size = 5, model = "Logistic",
parameter = list(r= 0.7), cov = TRUE, Plot_est = TRUE)