Help with Power Curve MCMC I'm trying to analyze some $D$ non-logistic cumulative data in a time series, bounded below by 0 and unbounded above.
Splitting data into $W$ time windows of $d$ days, I know each window can be described by one of these four different growths:

*

*exponential

*linear

*logarithmic

*constant

Example of data:
require(RcppRoll)

rawData <- read.csv("https://raw.githubusercontent.com/maxdevblock/covid-19-time-series/master/csv/COVID-Confirmed.csv")
countries <- levels(rawData$Country.Region)
# Choose a country
country <- "Tanzania"

y <- rawData[rawData$Country.Region == country,]
# Data from 1st day
y <- y[5:length(y)]
# Smooth data
y <- roll_mean(y, 7)

I thought to use a very simple power curve (Freundlich)
$y = \alpha \cdot x ^ \beta$
where $x = [1 ... d]$
that can describe all wanted growth types:

*

*$\beta = 0$, constant

*$0 < \beta < 1$, logarithmic

*$\beta = 1$, linear

*$\beta > 1$, exponential

Using scipy module curve_fit in python it correctly works but I want to do it bayesian with a Markov chain Monte Carlo in R to obtain $\beta$ params HDIs.
So I thought to use JAGS and:

*

*split $D$ data into $W$ time windows of $d$ days (I chose $d=14$), where each window starts from $t_0 \in \{D_0, D_1, D_2 ... D_{n-d}\}$

*let each window first element be 1 (subtracting the first window element to the vector and adding 1)

*calculate $\mathbb{E}[y]$ expected with the chosen power equation

*distribute observed $y$ in each time window as Normal with $\tau$ precision

*distribute $\alpha$ and $\beta$ params priors as Uniform within an expected range

*distribute $\tau$ as uninformative Gamma
model {
  for ( s in 1:Stot ) {
    alpha[s] ~ dunif( 0 , 2 )
    beta[s] ~ dunif( -1 , 10 )

    tau[s] ~ dgamma( 0.001 , 0.001 )
    sigma[s] <- 1 / sqrt( tau[s] )
    
    for ( t in s:(s + Ttot) ) {
      E[s,t] <- alpha[s] * (t - s + 1) ^ beta[s]
      y[s,t] ~ dnorm( E[s,t] , tau[s] )
    }
  }
}

Running JAGS with
n.chains=4 ,
adapt=100 ,
burnin=500 , 
sample=1000 ,
thin=1 ,

Even if $\beta$ params Means are correctly estimated, many windows show autocorrelation and/or very bad traces.
Results of $\beta$ param:

Example of very bad traces:


Example of "not too bad" (but maybe not optimal) traces:


What am I missing?
Any suggestions on how to fix/improve the MCMC?
Thank you!
 A: I may have found a solution. Maybe not the best, but working...
Since I'm not interested in evaluating $\alpha$, but $\beta$ only, I did scale windows' data and days to a $[0..1]$ range
winDays <- 14

# Get and smooth data
y <- rawData[rawData$Country.Region == country,]
y <- y[5:length(y)]
y <- as.vector(t(y))
y <- roll_mean(y, 7)
  
Stot = length(y) - winDays
  
Y <- NULL

# Scale data to [0..1]
for(s in 1:Stot){
  yWin <- y[s:(s+winDays-1)]
  yWin <- yWin - yWin[1]
  if( yWin[winDays] != 0){
    yWin <- yWin / yWin[winDays]
  } else {
    # because x^0 = 1
    yWin <- rep(1.0, winDays)
  }
  yWin <- as.vector(yWin)
  Y <- rbind(Y, yWin)
}

# days range [0..1]
winRange <- seq(from=0, to=1, length.out=winDays)

and edited the model to
model {
  for ( s in 1:Stot ) {
    beta[s] ~ dunif( -1 , 10 )
    
    tau[s] ~ dgamma( 0.001 , 0.001 )
    sigma[s] <- 1 / sqrt( tau[s] )
    
    # start from 2 to avoid 0^0
    for ( t in 2:winDays ) {
      E[s,t] <- pow( winRange[t] , beta[s] )
      y[s,t] ~ dnorm( E[s,t] , tau[s] )
    }
  }
}

starting from the second element of each window to avoid evaluating the undefined $0^0$.
Now with only
n.chains=4 ,
adapt=250 ,
burnin=500 , 
sample=1000 ,
thin=1 ,

all traces look good enough and no more autocorrelation, even if $\beta \gg 1$.
Example:


A result:


