from research import *
from algebra import Matrix
s=begin(1155,'Recover amplitudes from a minimal local observation set','Which three source differences identify the shared dictionary parameters?',{},['C1154'])
d=json.loads((ROOT/'model/postflood_amplitude_dictionary.json').read_text());idx=[d['labels'].index(x) for x in ['SP:Arphaxad:R','SP:Terah:A','LXX_OFF:Arphaxad:A']];A=Matrix([d['matrix'][i] for i in idx]);obs=[100,-60,27];v=list(A.inv()*Matrix(obs))
a=artifact('model/postflood_local_parameter_recovery.json',json.dumps({'observation_labels':[d['labels'][i] for i in idx],'observations':obs,'matrix':clean(A.tolist()),'determinant':clean(A.det()),'parameters':clean(v),'scope':'minimal for this3-parameter fixed-support model only'},indent=2)+'\n')
finish(s,{'local_parameter_recovery':a,'parameters':v},'One century begetting difference, the officialTerah lifespan difference and one early LXX life difference recover all three amplitudes. Other rows test the already fitted support pattern rather than introducing new parameter values.','Compare the information visible through regular and cumulative measurements.',{'nonsingular':A.det()!=0,'source_parameters':v==[100,60,27]})
