I have this interesting data where I would like to estimate possibly a parameter of the difference (between $A+B$ and $A+C$, inference using both) that would allow me to infer the development of $A$ (whether there is a propensity to decrease or increase).
Any hint as to how to approach it included type of modeling/estimation procedure?
Here is part of the data: The data itself is a rate of observing number of species in days.
These have been calculated in R based on this formula for $A$:
A = obs / mean(obs.window)
The values of $B$ and $C$ in R are based on the formulas:
B = obs / min(obs.window)
and
C = obs / max(obs.window)
where obs
is a observed number of species per day and obs.window
is a average value of a sliding window of $10$ days (moving average).
x <- "A B C
1 0.63 0.67 0.61
2 0.62 0.64 0.60
3 0.64 0.65 0.59
4 0.70 0.70 0.63
5 0.71 0.73 0.68
6 0.70 0.75 0.69
7 0.71 0.75 0.70
8 0.74 0.76 0.71
9 0.79 0.81 0.74
10 0.80 0.83 0.76
11 0.82 0.84 0.78
12 0.82 0.84 0.80
13 0.83 0.85 0.81
14 0.81 0.88 0.80
15 0.78 0.84 0.77
16 0.75 0.79 0.74
17 0.73 0.77 0.72
18 0.72 0.75 0.71
19 0.73 0.75 0.71
20 0.73 0.75 0.71
21 0.74 0.76 0.72
22 0.72 0.76 0.71
23 0.71 0.74 0.69
24 0.73 0.75 0.70
25 0.78 0.79 0.71
26 0.82 0.84 0.77
27 0.80 0.84 0.78
28 0.77 0.81 0.76
29 0.79 0.81 0.75
30 0.83 0.84 0.78
31 0.86 0.87 0.82
32 0.85 0.87 0.83
33 0.83 0.84 0.82
34 0.78 0.85 0.77
35 0.74 0.80 0.72
36 0.72 0.76 0.71
37 0.74 0.77 0.70
38 0.75 0.75 0.70
39 0.78 0.81 0.72
40 0.78 0.82 0.75"
And here some adjustment:
data <- read.table(text=x, header = TRUE)
data$diff_AC <- with(data, (A-C))
data$diff_AB <- with(data, (A-B))
with(data, plot(A~1, col=1))
with(data, points(B~1, col=2))
with(data, points(C~1, col=3))
EDIT: I'm interested in estimation of the relationship of the interval and its overall with A
as an idicator.
However, I was thinking using Beta
distribution and simulation on rolling window of 20 days
, would this be anyhing meaningful?
windw <- 20; # rolling windows size
for(i in 1:10){
dt <- data[(1:i):(i+windw), ]
# mean & variance
dt$mu_A <- with(dt, mean(A))
dt$sig_A <- with(dt, var(A))
# estimate alpah & beta via moments
moment_alpha_A <- with(dt, mu_A*(mu_A*(1-mu_A)/sig_A-1))
moment_beta_A <- with(dt, (1-mu_A)*(mu_A*(1-mu_A)/sig_A-1))
# simulate
rb_A <- rbeta(10000, unique(moment_alpha_A), unique(moment_beta_A))
# plot
with(dt, plot(A~1, col=1))
abline(h=median(rb_A), col="blue3", lwd=3)
abline(h=tail(dt$A,1), col="red3", lwd=1)
Sys.sleep(1)
}