Skip to contents

[Stable]

PM_fit objects comprise a PM_data and PM_model object ready for analysis

Details

Data and model objects can be previously created as PM_data or PM_model objects, or created on the fly when making a new PM_fit object. PM_fit objects contain methods to cross-check data and model objects for compatibility, as well as to run the analysis.

Public fields

data

PM_data object

model

PM_model object

arglist

Arguments passed to rust engine

backend

Backend used for calculations; default is value in PMoptions.

Methods


Method new()

Create a new object

Usage

PM_fit$new(data = data, model = model, backend = getPMoptions()$backend, ...)

Arguments

data

Either the name of a PM_data object in memory or the quoted name of a Pmetrics data file in the current working directory, which will crate a PM_data object on the fly. However, if created on the fly, this object will not be available to other methods or other instances of PM_fit.

model

Similarly, this is either the name of a PM_model object in memory or the quoted name of a Pmetrics text model file in the current working directory. Again, if created on the fly, the object will not be available to other methods or other instances of PM_fit.

backend

Backend used for calculations; default is value in PMoptions.

...

Other parameters passed to PM_data or PM_model if created from a filename


Method run()

Fit the model to the data

Usage

PM_fit$run(
  ...,
  engine = "NPAG",
  rundir = getwd(),
  backend = getPMoptions()$backend
)

Arguments

...

Other arguments passed to NPrun

engine

"NPAG" (default) or "IT2B"

rundir

This argument specifies an existing folder that will store the run inside.

backend

Backend used for calculations; default is value in PMoptions.


Method save()

Save the current PM_fit object to a .rds file.

Usage

PM_fit$save(file_name = "PMfit.rds")

Arguments

file_name

Name of the file to be created. The default is "PMfit.rds".


Method load()

PM_fit objects contain a save method which invokes saveRDS to write the object to the hard drive as an .rds file. This is the corresponding load function.

Usage

PM_fit$load(file_name)

Arguments

file_name

Name of the file to be read, the default is "PMfit.rds".

Returns

A PM_fit object.


Method check()

Checks for errors in data and model objects and agreement between them.

Usage

PM_fit$check()


Method clone()

The objects of this class are cloneable with this method.

Usage

PM_fit$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.