Command:

modFactor (  
char* oldname,
char* newtype,
char* newname,
char* newnote
double* newparameters
)

What:

Modifies an existing factor in every possible setting or only part of them

Parameters:

name
[char*]
the name of the factor to be modified. It must begin with a letter and can contain only letters and numbers, this parameter cannot be null!
newtype
[char*]
defines the new distribution associated with the factor, it can assume one of the following values:

  • "normal"
  • "lognormal"
  • "uniform"
  • "piecewise uniform"
  • "loguniform"
  • "piecewise loguniform"
  • "weibull"
  • "constant"
  • "exponential"
  • "gamma"
  • "beta"
  • "triangular"
  • "discrete"
newname
[char*]
defines the new name for the factor. It must begin with a letter and can contain only letters and numbers, this parameter cannot be null!
newnotes
[char*]
new notes to be associated with the factor
newparameters
[array of double]
must contain the statistical parameters of the statistical distribution associated with the factor. See the command correspondent to each distribution for a detailed explication.

Return:

error_code [int]: 1 if the operation has occurred without errors, 0 if an error has occurred

Warnings:

If the command is called after a correlation is set, the correlation is discarded

Examples:

modFactor('fac1', 'normal', 'fac1mod', 'facnotes', [3, 1, 0.001, 0.999])

the factor fac1 is modified, its name is changed in fac1mod and the new distribution associated is a gaussian with mean 3, std deviation 1 and truncated before 0.001 and after 0.999



- A Matlab example script using this command set_model_inputs.m

All Factor Commands: