title: Proportion modeling - Betareg errors
body: <p>I wonder if somebody here can help me. </p>
  
  <p>I am trying to fit a beta GLM with <code>betareg</code> package since my dependent variable is a proportion (relative density of whales in 500m grid size) varying from 0 to 1. I have three covariates: </p>
  
  <ul>
  <li>Depth (measured in meters ranging from 4 to 100m), </li>
  <li>Distance to Coast (measured in meters ranging from 0 to 21346m) and </li>
  <li>distance to boats (measured in meters ranging from 0 to 20621). </li>
  </ul>
  
  <p>My dependent variable has a lot of 0s and many values that are too close to 0 (as in <code>7.8e-014</code>). When I try to fit the model the following error shows:  </p>
  
  <pre><code>invalid dependent variable, all observations must be in (0, 1). 
  </code></pre>
  
  <p>From what I looked from previous discussions it seems this is caused by my 0s in the dataset (I should not have any 0s or 1s). When I change all my 0 to only positive definite (e.g. 0.0000000000000001) the error message I get is: </p>
  
  <pre><code>Error in chol.default(K) : 
    the leading minor of order 2 is not positive definite
  In addition: Warning messages:
  1: In digamma(mu * phi) : NaNs produced
  2: In digamma(phi) : NaNs produced
  Error in chol.default(K) : 
    the leading minor of order 2 is not positive definite
  In addition: Warning messages:
  1: In betareg.fit(X, Y, Z, weights, offset, link, link.phi, type, control) :
    failed to invert the information matrix: iteration stopped prematurely
  2: In digamma(mu * phi) : NaNs produced
  </code></pre>
  
  <p>From what I saw at several forums it seems this is because my matrix is not positive definite. It may be either indefinite (i.e. have both positive and negative eigenvalues) or my matrix may be near singular, i.e. it's smallest eigenvalue is very close to 0 (and so computationally it is 0).</p>
  
  <p>My question is: since I only have this dataset, is there any way to solve these problems and run a beta regression? Or, is there any other model that I could use instead of betareg package that it could work?</p>
  
  <p>Here is my code: </p>
  
  <pre><code>betareg(Density~DEPTH+DISTANCE_TO_COAST+DIST_BOAT,data=misti)
  </code></pre>