Description Usage Arguments Details Value Author(s) References Examples
Estimates the log-likelihood of the LNA approximation.
1 2 |
cout |
The parsed model. |
nthetas |
The vector of the parameters. |
mydata |
Either a matrix or a data frame of the data to be evaluated. The first column is assumed to correspond to the time of each observation. |
syssize |
Optional, a scalar indicating the system size. |
relerr |
Optional, a scalar indicating the relative error for the ODE solver. |
abserr |
Optional, a scalar indicating the absolute error for the ODE solver. |
method |
Optional, a scalar with possible options:
|
dfunction |
The compiled model. |
See Giagos (2010) for a discussion on the Restarting and the Non Restarting method.
Returns the estimated log-likelihood.
Vasileios Giagos
Giagos, V.: 2010, Inference for auto-regulatory genetic networks using diffusion process approximations, Thesis, Lancaster University, 2010.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## Not run:
require(lnar)
tt <- matrix(c(1,-1,0,0,1,-1),nrow=2,ncol=3,byrow=TRUE)
rfun <- c("con1 * Prey","con2 * Prey * Predator","con3 * Predator")
thetas <- paste("con",1:3,sep="")
species <- c("Prey","Predator")
cout <- parsemod(tt,rfun,thetas,species)
mydata<-c(0.0, 5000.0, 3000, 1, 5989, 2992, 2, 7165, 3107, 3, 8534,
3306,4, 10041, 3709, 5, 11624, 4265, 6, 13306, 5181, 7,
14741, 6492,8, 15867, 8337, 9, 16025, 10981)
mydata2 <- matrix(mydata,10,3,byrow=TRUE)#Example dataset
compmod(cout,"derivs")
#Our initial values
nthetas<-c(.25,.20,0.125)
print(derivs(mydata[1],c(mydata[2],mydata[3],
c(0,0,0,0,0)),rep(0,7),nthetas))
(l1<-lnalik(cout,nthetas=nthetas, mydata=mydata2, method=1,
relerr=1e-9, abserr=1e-9,
dfunction=derivs) )
nthetas2<-c(.25,.20/8000,0.125)
(l2<-lnalik(cout,nthetas=nthetas2, mydata=mydata2, method=0,
relerr=1e-9, abserr=1e-9,
dfunction=derivs) )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.