## Variances of Transition Probabilities

questions concerning analysis/theory using program PRESENCE

### Variances of Transition Probabilities

Greetings!

I am using the Psi, R, p, delta parameterization to compare the probability of occupancy and reproduction between survey stations on two different landownerships. I have successfully calculated the dynamic occupancy probabililities for each landownership, but I'm wondering if it is possible (or if it makes sense) to compare the actual transition probabilities (i.e. Transition Probability Matrices) for each landownership.

I can calculate the values themselves using the Transition Probability Matrix (parameterized as in Nichols et al. 2007 and MacKenzie et al. 2009) where the first column is obtained by subtraction, but I'm not sure how to calculate the variances for these values. Specifically, I used the Delta method to calculate the variance of psi^t+1 and R^t+1, but what is the variance of psi^t+1(1 - R^t+1) (for example)? It seems there should be a way to do it using the Delta method and the VC matrix, but I'm struggling to figure out what it is.

KB
kbrunk

Posts: 11
Joined: Fri Oct 12, 2018 11:51 am

### Re: Variances of Transition Probabilities

Dear KB,

You can use the delta method to get psi(1-R):

Code: Select all
`theta=[psi  R]                # vector of parametersZ=psi*(1-R)                   #  derived parameterdZ/dtheta = [1-R psi]         #  derivative of derived parm with respect to orig parametersvar(theta) = [var(psi)      covar(psi,R)]       #  var-cov matrix of orig parameters             [covar(psi,R)  var(R)      ]Var(Z) = dZ/dtheta * var(theta) * dZ/dtheta'  #  variance of derived parameter`
jhines

Posts: 502
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

### Re: Variances of Transition Probabilities

Hey Jim,

Thanks for the speedy reply! Conceptually, that makes perfect sense to me; however, when I tried to apply it, I got bogged down in the mathematical details.

My VC matrix for the occupancy portion of the model (psi0, psi, R0, R) is a 13x13 matrix with intercepts for each parameter, covariates for psi and R related to the state of each station in the previous year, as well as the ownership covariate, and I'm uncertain how to correctly get the dZ/dtheta vector. Is it as simple as utilizing all the parameters as they are and just doing 1-R (using whichever R parameter relates to the state I'm interested in calculating the variance for)?

Thanks!

KB
kbrunk

Posts: 11
Joined: Fri Oct 12, 2018 11:51 am

### Re: Variances of Transition Probabilities

I assume the VC matrix you're referring to is the VC matrix of the untransformed (Beta) parameters. So, you potentially have a different psi0, psi, R0, and R for each site. The transition parameter you want (Z=psi*(1-R)) will then be different for each site. To get the variance of that parameter, you would use the method I posted, but each psi and R in the formula would be the estimate for each site. You would also need the covariances for psi and R for each site, which would be a problem since Presence doesn't print all possible covariances of all real parameters.

The solution I usually use is to compute the derived parameter (Z) from the beta parameters. Then compute the derivatives numerically, instead of using the formula.

Programming it in R would look something like this:

Code: Select all
`epsilon=.0000001    # eps = small change in beta parameters for calc of derivativevarz=rep(0,nsites)   for (site in 1:nsites) {   #### compute Z from beta's...   psi=plogis(beta+beta*X1[site])   R=plogis(beta+beta*X1[site])   Z[site]=psi*(1-R)    ### compute derivatives (numerically) of Z wrt beta0, beta1,...   dzdb=matrix(0,nrow=1,ncol=length(beta))   for (i in 1:length(beta)) {      beta[i]=beta[i]+epsilon                    # increment beta(i) by small amount      psi2=plogis(beta+beta*X1[site]       # compute new psi       R2=plogis(beta+beta*X1[site])        # compute new R      Z2=psi2*(1-R2)                             # compute new Z      dzdb[1,i]=(Z2-Z)/epsilon       ## derivative = (change in Z) / (change in beta[i])      beta[i]=beta[i]-epsilon                    # put beta(i) back to orig. value   }   varz[site]=dzdb %*% varcovbeta %*% t(dzdb)}`

If you're not comfortable programming in R or this doesn't make sense, contact me off-list for help.
jhines

Posts: 502
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

### Re: Variances of Transition Probabilities

Thank you so much, Jim! I'm hoping I can figure it out from here - thanks for the code!

KB
kbrunk

Posts: 11
Joined: Fri Oct 12, 2018 11:51 am