Last data update: 2014.03.03

R: Creates a template for a model in PSM
PSM.templateR Documentation

Creates a template for a model in PSM

Description

Creates a template with R-syntax to help setup a model in PSM.

Usage

  PSM.template(Linear=FALSE,dimX=2,dimY=3,dimU=4,dimEta=5,file="")

Arguments

Linear

Boolean. Linear or non-linear model.

dimX

Number of state equations.

dimY

Number of response variables.

dimU

Number of input variables (can be zero).

dimEta

Number of random effects (can be zero).

file

A character string naming the file to print to. If '""' (the default), PSM.template prints to the standard output connection.

Value

None (invisible NULL).

Note

For further details please also read the package vignette pdf-document by writing vignette("PSM") in R.

Author(s)

Stig B. Mortensen and S<c3><b8>ren Klim

References

Please visit http://www.imm.dtu.dk/psm or refer to the help page for PSM.

See Also

PSM, PSM.estimate, PSM.smooth, PSM.template

Examples

# Linear model with input, random effects and dose
PSM.template(Linear=TRUE,dimX=1,dimY=2,dimU=3,dimEta=4)

# Non-linear model without input, random effects and dose
PSM.template(Linear=FALSE,dimX=1,dimY=2,dimU=0,dimEta=0)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PSM)
Loading required package: MASS
Loading required package: numDeriv
Loading required package: deSolve

Attaching package: 'deSolve'

The following object is masked from 'package:graphics':

    matplot

Loading required package: ucminf
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/PSM/PSM.template.Rd_%03d_medium.png", width=480, height=480)
> ### Name: PSM.template
> ### Title: Creates a template for a model in PSM
> ### Aliases: PSM.template
> ### Keywords: htest models multivariate ts
> 
> ### ** Examples
> 
> # Linear model with input, random effects and dose
> PSM.template(Linear=TRUE,dimX=1,dimY=2,dimU=3,dimEta=4)


MyModel <- vector(mode="list")
MyModel$Matrices=function(phi) {
  list(
       matA=matrix(c(  ), nrow=1, ncol=1),
       matB=matrix(c(  ), nrow=1, ncol=3),
       matC=matrix(c(  ), nrow=2, ncol=1),
       matD=matrix(c(  ), nrow=1, ncol=3)
       )
}
MyModel$h = function(eta,theta,covar) {
  phi <- theta
  phi
}
MyModel$S = function(phi) {
  matrix(c(  ), nrow=2, ncol=2)
}
MyModel$SIG = function(phi) {
  matrix(c(  ), nrow=1, ncol=1)
}
MyModel$X0 = function(Time,phi,U) {
  matrix(c(  ), nrow=1, ncol=1)
}
MyModel$ModelPar = function(THETA) {
  list(theta=list(  ),
       OMEGA=matrix(c(  ), nrow=4, ncol=4)
       )
}


> 
> # Non-linear model without input, random effects and dose
> PSM.template(Linear=FALSE,dimX=1,dimY=2,dimU=0,dimEta=0)


MyModel <- vector(mode="list")
MyModel$Functions$f = function(x,u,time,phi) {
  matrix(c(  ), nrow=1, ncol=1)
}
MyModel$Functions$df = function(x,u,time,phi) {
  matrix(c(  ), nrow=1, ncol=1)
}
MyModel$Functions$g = function(x,u,time,phi) {
  matrix(c(  ), nrow=2, ncol=1)
}
MyModel$Functions$dg = function(x,u,time,phi) {
  matrix(c(  ), nrow=2, ncol=1)
}
MyModel$h = function(eta,theta,covar) {
  phi <- theta
  phi
}
MyModel$S = function(u,time,phi) {
  matrix(c(  ), nrow=2, ncol=2)
}
MyModel$SIG = function(u,time,phi) {
  matrix(c(  ), nrow=1, ncol=1)
}
MyModel$X0 = function(Time,phi,U) {
  matrix(c(  ), nrow=1, ncol=1)
}
MyModel$ModelPar = function(THETA) {
  list(theta=list(  ))
}


> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>