single season two species parameterization

posts related to the RPresence library, which may not be of general interest to users of 'classic' PRESENCE.

Re: single season two species parameterization

Postby jhines » Mon Aug 15, 2022 8:49 am

occMod(list(psi~(SP+INT)*X,p~1),data=pao,type='so.2sp.1')

or

occMod(list(psi~SP*X+INT*X,p~1),data=pao,type='so.2sp.1')
jhines
 
Posts: 575
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Re: single season two species parameterization

Postby Prashant_mahajan » Wed Aug 17, 2022 3:00 am

Thank you so much.
Prashant_mahajan
 
Posts: 19
Joined: Wed Mar 31, 2021 11:14 am

Re: single season two species parameterization

Postby Prashant_mahajan » Tue Nov 15, 2022 6:59 am

Hello,

I was running my models with the sam codes but while running the model, I got this error:

Error in names(derived) <- v[i] :
'names' attribute [2] must be the same length as the vector [1]

I checked, but it showed the same error, even though the codes ran fine earlier.

The codes are as follows:

AB= read.csv("A_B.csv", header = FALSE)
cov = read.csv("Data_covariates.csv", header = TRUE)
data = createPao(A_B, cov, title = "A and B")

mod1<-occMod(model=list(psi~SP,p~SP),data=data,type="so.2sp.1",parameterization="PsiBA")

Please help me how I can resolve the error.

Thank You
Prashant_mahajan
 
Posts: 19
Joined: Wed Mar 31, 2021 11:14 am

Re: single season two species parameterization

Postby jhines » Tue Nov 15, 2022 9:14 am

Please send me the 2 csv files and I will diagnose and fix the error.

Jim
jhines
 
Posts: 575
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Re: single season two species parameterization

Postby jhines » Tue Nov 15, 2022 4:15 pm

I've corrected the error with the 2-sp derived estimates. Please download the latest version and let me know if you have any trouble. Thanks for sending the csv files.

install.packages('RPresence', repo='https://www.mbr-pwrc.usgs.gov/mbrCRAN')
jhines
 
Posts: 575
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Re: single season two species parameterization

Postby Prashant_mahajan » Wed Nov 16, 2022 7:08 am

Thank you for fixing the error. The models are running fine without any error, however, after running a few models, some models are taking an unexpectedly long time which was not the case earlier. For example, after running nine modes, I ran a model:

mod10<-occMod(list(psi~(SP+INT)*cov,p~SP),data=data,type="so.2sp.1",parameterization="PsiBA")

Earlier all models ran without delay, but now after running a few models, it shows a busy signal and doesn't proceed further.
Prashant_mahajan
 
Posts: 19
Joined: Wed Mar 31, 2021 11:14 am

Re: single season two species parameterization

Postby jhines » Wed Nov 16, 2022 9:18 am

I've updated RPresence again to fix the issue. Please re-install it and let me know if you have trouble.

Jim
jhines
 
Posts: 575
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Re: single season two species parameterization

Postby Prashant_mahajan » Wed Nov 16, 2022 12:31 pm

The codes are running fine now, thank you so much for fixing the errors.
Prashant_mahajan
 
Posts: 19
Joined: Wed Mar 31, 2021 11:14 am

Re: single season two species parameterization

Postby Prashant_mahajan » Thu Nov 17, 2022 2:58 am

Again it is freezing and showing busy at another model when I was running for two different species. The model I ran was:

mod8<-occMod(list(psi~(SP+INT)*frst_cvr,p~SP),data=data,type="so.2sp.1",parameterization="PsiBA")
Prashant_mahajan
 
Posts: 19
Joined: Wed Mar 31, 2021 11:14 am

Re: single season two species parameterization

Postby Prashant_mahajan » Thu Nov 17, 2022 4:10 am

Also, when I plot the psi values with a covariate, the graph shows a different curve than the beta estimate. For example, my beta estimates values are:

beta_parameters_cov est se
A1_psiA 2.31 0.79
A2_psiBA -3.40 0.94
A3_psiBa -0.11 2.83
A4_psiA.cov_psiA 2.53 1.11
A5_psiBA.SP2:cov_psiBA -2.90 1.23
A6_psiBa.INT2:cov_psiBa 0.13 3.82

The effect of "cov" on psiBa is positive however, my graph shows a decreasing probability of psiBa with an increase in cov. I am using the following codes:

cov=seq(min(data$unitcov$cov,
na.rm = TRUE),
max(data$unitcov$cov,
na.rm = TRUE),
by = 0.01);
nu=length(cov)

newdata=data.frame(
SP=factor(c(rep('A',nu),rep('B',2*nu))),
INT=c(rep(0,nu),rep(0,nu),rep(1,nu)),
cov=cov)

z = predict(object=mod3, newdata=newdata, param='psi')

# add parameter name to z data-frame
z$param = c(rep('psiA',nu),rep('psiBA',nu), rep('psiBa',nu))
z$cov = newdata$cov

ggplot(z,aes(x=cov,y=est)) + xlab('cov (standardized)') +
ylab('Occupancy Probability')+
ylim(0,1)+
geom_line(aes(color=param))+
theme_classic()

Is there any error in the codes, because of which my graph shows an opposite curve for psiBa.
Prashant_mahajan
 
Posts: 19
Joined: Wed Mar 31, 2021 11:14 am

Previous

Return to RPresence

Who is online

Users browsing this forum: No registered users and 1 guest

cron