MLE for k-truncated poisson I need to implement an algorithm in R that finds the MLE for $\lambda$ and $k$ (the truncation level: only values larger than k are allowed) for a truncated Poisson distribution. I seem to not be able to find this anywhere on google, and I'm struggling to derive the MLE in the first place.
 A: Update:  Now that the question is more specific, I've added the log likelihood and R code for left-trunction.
Right-truncation.  For $Y_i$ distributed as a truncated Poisson with parameters $\lambda$ and truncation parameter $k$, the log likelihood of $n$ random samples is given by
$$\log(\lambda) \sum_{i=1}^n y_i -n \lambda -n \log \left({\sum_{j=0}^k {{e^{-\lambda}\lambda^j}\over{j!}}}\right) $$
This is maximized for any value of $\lambda$ when $\hat{k}=\max(y_1, y_2,\ldots, y_n)$ (which is the smallest value that $k$ can take).  The maximum likelihood estimate of $\lambda$ requires an iterative procedure.  Moore (1952, Biometrika) provides a good and easily calculated initial estimate of $\hat{\lambda}$:
$$\hat{\lambda}_0 ={{\sum_{i=1}^n y_i}\over{\sum_{i=1}^n I(y_i<\hat{k})}}$$
where $I(\cdot)$ is the indicator function taking on 1 if $y_i<\hat{k}$ and 0 otherwise.  (So it's a mean adjusted upwards a bit.)
Some not so elegant R code follows:
# MLE estimation of a truncated Poisson with unknown truncation level

# Objective is to find estimates of lambda (underlying Poisson mean) and
# k (unknown trunction value).

# Generate some samples from a known truncated Poisson distribution
  lambda <- 10  # Poisson mean
  k <- 8        # Truncation level
  n <- 100      # Sample size
  y <- rpois(n*4,lambda) # Oversample to be more certain of getting n samples
  # Keep just the first n legitimate observations
  y <- y[y <= k][1:n]

# MLE for k and initial estimate for lambda
# From Moore (1952)  Biometrika
# "The estimation of the Poisson parameter from a truncated distribution"
  khat <- max(y)
  lambda0 <- sum(y)/length(y[y < khat])

# Define log of the likelihood function
  logL <- function(lambda,ysum,n,k) {
    log(lambda)*ysum - n*lambda - n*ppois(k,lambda,log.p=TRUE)
  }

# Find maximum likelihood estimate of lambda  
  trPoisson <- optim(lambda0, logL, ysum=sum(y), n=length(y), k=khat, 
    method="BFGS", control=list(fnscale=-1))

# Show results
  cat("MLE of truncation value =",khat,"\n")
  # MLE of truncation value = 8 
  cat("MLE of lambda =",trPoisson$par,"\n")
  # MLE of lambda = 9.765054 

Left-truncation.  For left-truncation the log likelihood is the following:
$$\log(\lambda) \sum_{i=1}^n y_i -n \lambda -n \log \left(1-{\sum_{j=0}^{k-1} {{e^{-\lambda}\lambda^j}\over{j!}}}\right) $$
with the sum on the far right being zero when $k<0$.  Below is some R code:
# MLE estimation of a left-truncated Poisson with unknown truncation level

# Objective is to find estimates of lambda (underlying Poisson mean) and
# k (unknown trunction value).

# Generate some samples from a known truncated Poisson distribution
  lambda <- 10   # Poisson mean
  k <- 7         # Truncation level
  n <- 100       # Sample size
  y <- rpois(n*30,lambda) # Oversample to be more certain of getting n samples
  y <- y[y >= k][1:n]

# MLE for k and initial estimate for lambda
  khat <- min(y)
  lambda0 <- mean(y)  # Probably any starting value greater than zero will work

# Define log of the likelihood function
  logL <- function(lambda,ysum,n,k) {
       log(lambda)*ysum - n*lambda - n*log(1-ppois(k-1,lambda))
  }

# Find maximum likelihood estimate of lambda  
  trPoisson <- optim(lambda0, logL, ysum=sum(y), n=length(y), k=khat, 
    method="L-BFGS-B", lower=0, upper=Inf, control=list(fnscale=-1))

# Show results
  cat("MLE of truncation value =",khat,"\n")
  cat("MLE of lambda =",trPoisson$par,"\n")

