Learn R Programming

PBSmodelling (version 2.68.6)

restorePar: Get Actual Parameters from Scaled Values

Description

Restore scaled parameters to their original units. Used in minimization by calcMin.

Usage

restorePar(S,pvec)

Arguments

S

scaled parameter vector.

pvec

a data frame comprising four columns - c("val","min","max","active") and as many rows as there are model parameters. The "active" field (logical) determines whether the parameters are estimated (TRUE) or remain fixed (FALSE).

Value

Parameter vector converted from scaled units to original units specified by pvec.

Details

Restoration algorithm: \( P = P_{min} + (P_{max} - P_{min}) (sin(\frac{\pi S}{2}))^2 \)

See Also

scalePar, calcMin, GT0

Examples

Run this code
# NOT RUN {
local(envir=.PBSmodEnv,expr={
  pvec <- data.frame(val=c(1,100,10000),min=c(0,0,0),max=c(5,500,50000),
    active=c(TRUE,TRUE,TRUE))
  S    <- c(.5,.5,.5)
  P    <- restorePar(S,pvec)
  print(cbind(pvec,S,P))
})
# }

Run the code above in your browser using DataLab