data<-scan("D:\\Personal\\new\\Desktop\\R conference\\sde\\data.txt")
X<-ts(data,start=1939)

d <- function(t,x,theta) theta[1]*x
s <- function(t,x,theta) theta[2]*sqrt(x)


Euler.lik <- function(theta1,theta2){
  n <- length(X) 
  dt <- deltat(X)
   -sum(dcEuler(X[2:n], dt, X[1:(n-1)], 0 ,c(theta1,theta2), d,s,log=TRUE))
}

fit<- mle(Euler.lik,start=list(theta1=0,theta2=1),method="L-BFGS-B",lower=c(0,0))


